diff --git a/librarian.yaml b/librarian.yaml index 1a538d4e020e..9f3ea0636c54 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. language: nodejs -version: v0.24.0 +version: v0.25.0 repo: googleapis/google-cloud-node sources: googleapis: @@ -485,6 +485,13 @@ libraries: copyright_year: "2026" nodejs: default_version: v1 + - name: google-cloud-bigquery-api + version: 1.0.0 + apis: + - path: google/cloud/bigquery/v2 + copyright_year: "2026" + nodejs: + package_name: '@google-cloud/bigquery-api' - name: google-cloud-bigquery-connection version: 4.1.2 apis: diff --git a/packages/google-cloud-bigquery-api/.gitignore b/packages/google-cloud-bigquery-api/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/packages/google-cloud-bigquery-api/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-bigquery-api/.jsdoc.js b/packages/google-cloud-bigquery-api/.jsdoc.js new file mode 100644 index 000000000000..1208f774846f --- /dev/null +++ b/packages/google-cloud-bigquery-api/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-api', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-api/.nycrc b/packages/google-cloud-bigquery-api/.nycrc new file mode 100644 index 000000000000..81a95fc94b00 --- /dev/null +++ b/packages/google-cloud-bigquery-api/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-api/.repo-metadata.json b/packages/google-cloud-bigquery-api/.repo-metadata.json new file mode 100644 index 000000000000..1441159f3640 --- /dev/null +++ b/packages/google-cloud-bigquery-api/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_description": "A data platform for customers to create, manage, share and query data.", + "api_id": "bigquery.googleapis.com", + "api_shortname": "bigquery", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-api/latest", + "default_version": "v2", + "distribution_name": "@google-cloud/bigquery-api", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "bigquery", + "name_pretty": "BigQuery", + "release_level": "stable", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-api/README.md b/packages/google-cloud-bigquery-api/README.md new file mode 100644 index 000000000000..2c62d0fb66b0 --- /dev/null +++ b/packages/google-cloud-bigquery-api/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [BigQuery API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-api.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-api) + +BigQuery API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [BigQuery API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/bigquery/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the BigQuery API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/bigquery-api +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/bigquery-api@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquery.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery diff --git a/packages/google-cloud-bigquery-api/package.json b/packages/google-cloud-bigquery-api/package.json new file mode 100644 index 000000000000..778822e25b5d --- /dev/null +++ b/packages/google-cloud-bigquery-api/package.json @@ -0,0 +1,68 @@ +{ + "name": "@google-cloud/bigquery-api", + "version": "0.1.0", + "description": "Bigquery client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-bigquery-api", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google bigquery", + "bigquery", + "dataset service", + "job service", + "model service", + "project service", + "routine service", + "row access policy service", + "table service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha --config ../../.mocharc.cjs --no-parallel build/system-test", + "test": "c8 mocha --config ../../.mocharc.cjs build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^20.0.0", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^20.0.0" + }, + "engines": { + "node": ">=18" + } +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/biglake_config.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/biglake_config.proto new file mode 100644 index 000000000000..03190a1ce9be --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/biglake_config.proto @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "BigLakeConfigProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Configuration for BigQuery tables for Apache Iceberg (formerly BigLake +// managed tables.) +message BigLakeConfiguration { + // Supported file formats for BigQuery tables for Apache Iceberg. + enum FileFormat { + // Default Value. + FILE_FORMAT_UNSPECIFIED = 0; + + // Apache Parquet format. + PARQUET = 1; + } + + // Supported table formats for BigQuery tables for Apache Iceberg. + enum TableFormat { + // Default Value. + TABLE_FORMAT_UNSPECIFIED = 0; + + // Apache Iceberg format. + ICEBERG = 1; + } + + // Optional. 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}". + string connection_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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/` + string storage_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The file format the table data is stored in. + FileFormat file_format = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The table format the metadata only snapshots are stored in. + TableFormat table_format = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/clustering.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/clustering.proto new file mode 100644 index 000000000000..79438ad16719 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/clustering.proto @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "ClusteringProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Configures table clustering. +message 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). + repeated string fields = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/data_format_options.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/data_format_options.proto new file mode 100644 index 000000000000..9780f536647f --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/data_format_options.proto @@ -0,0 +1,51 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "DataFormatOptionsProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Options for data format adjustments. +message DataFormatOptions { + // The API output format for a timestamp. + enum TimestampOutputFormat { + // Corresponds to default API output behavior, which is FLOAT64. + TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED = 0; + + // Timestamp is output as float64 seconds since Unix epoch. + FLOAT64 = 1; + + // Timestamp is output as int64 microseconds since Unix epoch. + INT64 = 2; + + // Timestamp is output as ISO 8601 String + // ("YYYY-MM-DDTHH:MM:SS.FFFFFFFFFFFFZ"). + ISO8601_STRING = 3; + } + + // Optional. Output timestamp as usec int64. Default is false. + bool use_int64_timestamp = 1 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + TimestampOutputFormat timestamp_output_format = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset.proto new file mode 100644 index 000000000000..660eaaefbf54 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset.proto @@ -0,0 +1,754 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/dataset_reference.proto"; +import "google/cloud/bigquery/v2/encryption_config.proto"; +import "google/cloud/bigquery/v2/external_catalog_dataset_options.proto"; +import "google/cloud/bigquery/v2/external_dataset_reference.proto"; +import "google/cloud/bigquery/v2/restriction_config.proto"; +import "google/cloud/bigquery/v2/routine_reference.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/expr.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// DatasetService provides methods for managing BigQuery datasets. +service DatasetService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Returns the dataset specified by datasetID. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + }; + } + + // Creates a new empty dataset. + rpc InsertDataset(InsertDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets" + body: "dataset" + }; + } + + // 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. + rpc PatchDataset(UpdateOrPatchDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + body: "dataset" + }; + } + + // 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. + rpc UpdateDataset(UpdateOrPatchDatasetRequest) returns (Dataset) { + option (google.api.http) = { + put: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + body: "dataset" + }; + } + + // 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. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + }; + } + + // Lists all datasets in the specified project to which the user has been + // granted the READER dataset role. + rpc ListDatasets(ListDatasetsRequest) returns (DatasetList) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets" + }; + } + + // 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. + rpc UndeleteDataset(UndeleteDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}:undelete" + body: "*" + }; + } +} + +// 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. +message DatasetAccessEntry { + // Indicates the type of resources in a dataset that the entry applies to. + enum TargetType { + // Do not use. You must set a target type explicitly. + TARGET_TYPE_UNSPECIFIED = 0; + + // This entry applies to views in the dataset. + VIEWS = 1; + + // This entry applies to routines in the dataset. + ROUTINES = 2; + } + + // The dataset this entry applies to + DatasetReference dataset = 1; + + // Which resources in the dataset this entry applies to. Currently, only + // views are supported, but additional target types may be added in the + // future. + repeated TargetType target_types = 2; +} + +// An object that defines dataset access for an entity. +message Access { + // 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". + string role = 1; + + // [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". + string user_by_email = 2; + + // [Pick one] An email address of a Google Group to grant access to. + // Maps to IAM policy member "group:GROUP". + string group_by_email = 3; + + // [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". + string domain = 4; + + // [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. + string special_group = 5; + + // [Pick one] Some other type of member that appears in the IAM Policy but + // isn't a user, group, domain, or special group. + string iam_member = 7; + + // [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 = 6; + + // [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 = 8; + + // [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 = 9; + + // Optional. condition for the binding. If CEL expression in this field is + // true, this access binding will be considered + google.type.Expr condition = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a BigQuery dataset. +message Dataset { + // Indicates the billing model that will be applied to the dataset. + enum StorageBillingModel { + // Value not set. + STORAGE_BILLING_MODEL_UNSPECIFIED = 0; + + // Billing for logical bytes. + LOGICAL = 1; + + // Billing for physical bytes. + PHYSICAL = 2; + } + + // Output only. The resource type. + string kind = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A hash of the resource. + string etag = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The fully-qualified unique name of the dataset in the format + // projectId:datasetId. The dataset name without the project name is given in + // the datasetId field. When creating a new dataset, leave this field blank, + // and instead specify the datasetId field. + string id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URL that can be used to access the resource again. You can + // use this URL in Get or Update requests to the resource. + string self_link = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. A reference that identifies the dataset. + DatasetReference dataset_reference = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A descriptive name for the dataset. + google.protobuf.StringValue friendly_name = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A user-friendly description of the dataset. + google.protobuf.StringValue description = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default lifetime of all tables in the dataset, in + // milliseconds. The minimum lifetime value is 3600000 milliseconds (one + // hour). To clear an existing default expiration with a PATCH request, set to + // 0. Once this property is set, all newly-created tables in the dataset will + // have an expirationTime property set to the creation time plus the value in + // this property, and changing the value will only affect new tables, not + // existing ones. When the expirationTime for a given table is reached, that + // table will be deleted automatically. + // If a table's expirationTime is modified or removed before the table + // expires, or if you provide an explicit expirationTime when creating a + // table, that value takes precedence over the default expiration time + // indicated by this property. + google.protobuf.Int64Value default_table_expiration_ms = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + google.protobuf.Int64Value default_partition_expiration_ms = 14; + + // 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. + map labels = 9; + + // Optional. An array of objects that define dataset access for one or more + // entities. You can set this property when inserting or updating a dataset in + // order to control who is allowed to access the data. If unspecified at + // dataset creation time, BigQuery adds default dataset access for the + // following entities: access.specialGroup: projectReaders; access.role: + // READER; access.specialGroup: projectWriters; access.role: WRITER; + // access.specialGroup: projectOwners; access.role: OWNER; + // access.userByEmail: [dataset creator email]; access.role: OWNER; + // If you patch a dataset, then this field is overwritten by the patched + // dataset's access field. To add entities, you must supply the entire + // existing access array in addition to any new entities that you want to add. + repeated Access access = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when this dataset was created, in milliseconds since + // the epoch. + int64 creation_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The date when this dataset was last modified, in milliseconds + // since the epoch. + int64 last_modified_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The geographic location where the dataset should reside. See + // https://cloud.google.com/bigquery/docs/locations for supported + // locations. + string location = 13; + + // 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 default_encryption_configuration = 16; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzi = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Same as `type` in `ListFormatDataset`. + // The type of the dataset, one of: + // + // * DEFAULT - only accessible by owner and authorized accounts, + // * PUBLIC - accessible by everyone, + // * LINKED - linked dataset, + // * EXTERNAL - dataset with definition in external metadata catalog, + // * BIGLAKE_ICEBERG - a Biglake dataset accessible through the Iceberg API, + // * BIGLAKE_HIVE - a Biglake dataset accessible through the Hive API. + string type = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The origin of the dataset, one of: + // + // * (Unset) - Native BigQuery Dataset + // * BIGLAKE - Dataset is backed by a namespace stored natively in Biglake + optional string catalog_source = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The source dataset reference when the dataset is of type LINKED. + // For all other dataset types it is not set. This field cannot be updated + // once it is set. Any attempt to update this field using Update and Patch API + // Operations will be ignored. + LinkedDatasetSource linked_dataset_source = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Metadata about the LinkedDataset. Filled out when the dataset + // type is LINKED. + LinkedDatasetMetadata linked_dataset_metadata = 29 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Reference to a read-only external dataset defined in data + // catalogs outside of BigQuery. Filled out when the dataset type is EXTERNAL. + ExternalDatasetReference external_dataset_reference = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options defining open source compatible datasets living in the + // BigQuery catalog. Contains metadata of open source database, schema or + // namespace represented by the current dataset. + ExternalCatalogDatasetOptions external_catalog_dataset_options = 32 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TRUE if the dataset and its table names are case-insensitive, + // otherwise FALSE. By default, this is FALSE, which means the dataset and its + // table names are case-sensitive. This field does not affect routine + // references. + google.protobuf.BoolValue is_case_insensitive = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the default collation specification of future tables + // created in the dataset. If a table is created in this dataset without + // table-level default collation, then the table inherits the dataset default + // collation, which is applied to the string fields that do not have explicit + // collation specified. A change to this field affects only tables created + // afterwards, and does not alter the existing tables. + // The following values are supported: + // + // * 'und:ci': undetermined locale, case insensitive. + // * '': empty string. Default to case-sensitive behavior. + google.protobuf.StringValue default_collation = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the default rounding mode specification of new tables + // created within this dataset. During table creation, if this field is + // specified, the table within this dataset will inherit the default rounding + // mode of the dataset. Setting the default rounding mode on a table overrides + // this option. Existing tables in the dataset are unaffected. + // If columns are defined during that table creation, + // they will immediately inherit the table's default rounding mode, + // unless otherwise specified. + TableFieldSchema.RoundingMode default_rounding_mode = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the time travel window in hours. The value can be from 48 + // to 168 hours (2 to 7 days). The default value is 168 hours if this is not + // set. + google.protobuf.Int64Value max_time_travel_hours = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Tags for the dataset. To provide tags as inputs, use the + // `resourceTags` field. + repeated GcpTag tags = 24 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Updates storage_billing_model for the dataset. + StorageBillingModel storage_billing_model = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. Restriction config for all tables and dataset. If + // set, restrict certain accesses on the dataset and all its tables based on + // the config. See [Data + // egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress) + // for more details. + RestrictionConfig restrictions = 27 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The [tags](https://cloud.google.com/bigquery/docs/tags) attached + // to this dataset. Tag keys are globally unique. Tag key is expected to be in + // the namespaced format, for example "123456789012/environment" where + // 123456789012 is the ID of the parent organization or project resource for + // this tag key. Tag value is expected to be the short name, for example + // "Production". See [Tag + // definitions](https://cloud.google.com/iam/docs/tags-access-control#definitions) + // for more details. + map resource_tags = 30 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A global tag managed by Resource Manager. +// https://cloud.google.com/iam/docs/tags-access-control#definitions +message GcpTag { + // Required. The namespaced friendly name of the tag key, e.g. + // "12345/environment" where 12345 is org id. + string tag_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The friendly short name of the tag value, e.g. "production". + string tag_value = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A dataset source type which refers to another BigQuery dataset. +message LinkedDatasetSource { + // The source dataset reference contains project numbers and not project ids. + DatasetReference source_dataset = 1; +} + +// Metadata about the Linked Dataset. +message LinkedDatasetMetadata { + // Specifies whether Linked Dataset is currently in a linked state or not. + enum LinkState { + // The default value. + // Default to the LINKED state. + LINK_STATE_UNSPECIFIED = 0; + + // Normal Linked Dataset state. Data is queryable via the Linked Dataset. + LINKED = 1; + + // Data publisher or owner has unlinked this Linked Dataset. It means you + // can no longer query or see the data in the Linked Dataset. + UNLINKED = 2; + } + + // Output only. Specifies whether Linked Dataset is currently in a linked + // state or not. + LinkState link_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request format for getting information about a dataset. +message GetDatasetRequest { + // DatasetView specifies which dataset information is returned. + enum DatasetView { + // The default value. + // Default to the FULL view. + DATASET_VIEW_UNSPECIFIED = 0; + + // View metadata information for the dataset, such as friendlyName, + // description, labels, etc. + METADATA = 1; + + // View ACL information for the dataset, which defines dataset access + // for one or more entities. + ACL = 2; + + // View both dataset metadata and ACL information. + FULL = 3; + } + + // Required. Project ID of the requested dataset + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the requested dataset + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the view that determines which dataset information is + // returned. By default, metadata and ACL information are returned. + DatasetView dataset_view = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + int32 access_policy_version = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request format for inserting a dataset. +message InsertDatasetRequest { + // Required. Project ID of the new dataset + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Datasets resource to use for the new dataset + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + int32 access_policy_version = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating or patching a dataset. +message UpdateOrPatchDatasetRequest { + // UpdateMode specifies which dataset fields is updated. + enum UpdateMode { + // The default value. + // Default to the UPDATE_FULL. + UPDATE_MODE_UNSPECIFIED = 0; + + // Includes metadata information for the dataset, such as friendlyName, + // description, labels, etc. + UPDATE_METADATA = 1; + + // Includes ACL information for the dataset, which defines dataset access + // for one or more entities. + UPDATE_ACL = 2; + + // Includes both dataset metadata and ACL information. + UPDATE_FULL = 3; + } + + // Required. Project ID of the dataset being updated + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the dataset being updated + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Datasets resource which will replace or patch the specified + // dataset. + Dataset dataset = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the fields of dataset that update/patch operation is + // targeting By default, both metadata and ACL fields are updated. + UpdateMode update_mode = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + int32 access_policy_version = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request format for deleting a dataset. +message DeleteDatasetRequest { + // Required. Project ID of the dataset being deleted + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of dataset being deleted + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // If True, delete all the tables in the dataset. + // If False and the dataset contains tables, the request will fail. + // Default is False + bool delete_contents = 3; +} + +message ListDatasetsRequest { + // Required. Project ID of the datasets to be listed + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.UInt32Value max_results = 2; + + // Page token, returned by a previous call, to request the next page of + // results + string page_token = 3; + + // Whether to list all datasets, including hidden ones + bool all = 4; + + // 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. + string filter = 5; +} + +// A dataset resource with only a subset of fields, to be returned in a list of +// datasets. +message ListFormatDataset { + // The resource type. + // This property always returns the value "bigquery#dataset" + string kind = 1; + + // The fully-qualified, unique, opaque ID of the dataset. + string id = 2; + + // The dataset reference. + // Use this property to access specific parts of the dataset's ID, such as + // project ID or dataset ID. + DatasetReference dataset_reference = 3; + + // The labels associated with this dataset. + // You can use these to organize and group your datasets. + map labels = 4; + + // An alternate name for the dataset. The friendly name is purely + // decorative in nature. + google.protobuf.StringValue friendly_name = 5; + + // The geographic location where the dataset resides. + string location = 6; + + // Output only. 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. + string type = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The origin of the dataset, one of: + // + // * (Unset) - Native BigQuery Dataset. + // * BIGLAKE - Dataset is backed by a namespace stored natively in Biglake. + optional string catalog_source = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reference to a read-only external dataset defined in data + // catalogs outside of BigQuery. Filled out when the dataset type is EXTERNAL. + ExternalDatasetReference external_dataset_reference = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response format for a page of results when listing datasets. +message DatasetList { + // Output only. The resource type. + // This property always returns the value "bigquery#datasetList" + string kind = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A hash value of the results page. You can use this property to + // determine if the page has changed since the last request. + string etag = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A token that can be used to request the next results page. This property is + // omitted on the final results page. + string next_page_token = 3; + + // 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. + repeated ListFormatDataset datasets = 4; + + // 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" + repeated string unreachable = 5; +} + +// Request format for undeleting a dataset. +message UndeleteDatasetRequest { + // Required. Project ID of the dataset to be undeleted + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of dataset being deleted + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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. + google.protobuf.Timestamp deletion_time = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset_reference.proto new file mode 100644 index 000000000000..fb0ecadbec29 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/dataset_reference.proto @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "DatasetReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Identifier for a dataset. +message DatasetReference { + // Required. A unique ID for this dataset, without the project name. The ID + // must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + // The maximum length is 1,024 characters. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID of the project containing this dataset. + string project_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/decimal_target_types.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/decimal_target_types.proto new file mode 100644 index 000000000000..37a6cb08d31d --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/decimal_target_types.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "DecimalTargetTypesProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// The data types that could be used as a target type when converting decimal +// values. +enum DecimalTargetType { + // Invalid type. + DECIMAL_TARGET_TYPE_UNSPECIFIED = 0; + + // Decimal values could be converted to NUMERIC + // type. + NUMERIC = 1; + + // Decimal values could be converted to BIGNUMERIC + // type. + BIGNUMERIC = 2; + + // Decimal values could be converted to STRING type. + STRING = 3; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/encryption_config.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/encryption_config.proto new file mode 100644 index 000000000000..df0d1ea58c1a --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/encryption_config.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "EncryptionConfigProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Configuration for Cloud KMS encryption settings. +message EncryptionConfiguration { + // Optional. Describes the Cloud KMS encryption key that will be used to + // protect destination BigQuery table. The BigQuery Service Account associated + // with your project requires access to this encryption key. + google.protobuf.StringValue kms_key_name = 1 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/error.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/error.proto new file mode 100644 index 000000000000..1af1967dab14 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/error.proto @@ -0,0 +1,36 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Error details. +message ErrorProto { + // A short error code that summarizes the error. + string reason = 1; + + // Specifies where the error occurred, if present. + string location = 2; + + // Debugging information. This property is internal to Google and should not + // be used. + string debug_info = 3; + + // A human-readable description of the error. + string message = 4; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto new file mode 100644 index 000000000000..04ef45235240 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "ExternalCatalogDatasetOptionsProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// 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. +message ExternalCatalogDatasetOptions { + // Optional. A map of key value pairs defining the parameters and properties + // of the open source schema. Maximum size of 2MiB. + map parameters = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The storage location URI for all tables in the dataset. + // Equivalent to hive metastore's database locationUri. Maximum length of 1024 + // characters. + string default_storage_location_uri = 2 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_table_options.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_table_options.proto new file mode 100644 index 000000000000..4393bd1aefc9 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_catalog_table_options.proto @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "ExternalCatalogTableOptionsProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Metadata about open source compatible table. The fields contained in +// these options correspond to Hive metastore's table-level properties. +message ExternalCatalogTableOptions { + // Optional. 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. + map parameters = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A storage descriptor containing information about the physical + // storage of this table. + StorageDescriptor storage_descriptor = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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/`. + string connection_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Contains information about how a table's data is stored and accessed by open +// source query engines. +message StorageDescriptor { + // Optional. 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. + string location_uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + string input_format = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + string output_format = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Serializer and deserializer information. + SerDeInfo serde_info = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Serializer and deserializer information. +message SerDeInfo { + // Optional. Name of the SerDe. + // The maximum length is 256 characters. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. 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. + string serialization_library = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Key-value pairs that define the initialization parameters for the + // serialization library. + // Maximum size 10 Kib. + map parameters = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_data_config.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_data_config.proto new file mode 100644 index 000000000000..36a974bb4f4b --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_data_config.proto @@ -0,0 +1,594 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/v2/decimal_target_types.proto"; +import "google/cloud/bigquery/v2/file_set_specification_type.proto"; +import "google/cloud/bigquery/v2/hive_partitioning.proto"; +import "google/cloud/bigquery/v2/json_extension.proto"; +import "google/cloud/bigquery/v2/map_target_type.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "ExternalDataConfigProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Options for external data sources. +message AvroOptions { + // Optional. If sourceFormat is set to "AVRO", indicates whether to interpret + // logical types as the corresponding BigQuery data type (for example, + // TIMESTAMP), instead of using the raw type (for example, INTEGER). + google.protobuf.BoolValue use_avro_logical_types = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Parquet Options for load and make external tables. +message ParquetOptions { + // Optional. Indicates whether to infer Parquet ENUM logical type as STRING + // instead of BYTES by default. + google.protobuf.BoolValue enum_as_string = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether to use schema inference specifically for + // Parquet LIST logical type. + google.protobuf.BoolValue enable_list_inference = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates how to represent a Parquet map if present. + MapTargetType map_target_type = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information related to a CSV data source. +message CsvOptions { + // Optional. The separator character for fields in a CSV file. The separator + // is interpreted as a single byte. For files encoded in ISO-8859-1, any + // single character can be used as a separator. For files encoded in UTF-8, + // characters represented in decimal range 1-127 (U+0001-U+007F) can be used + // without any modification. UTF-8 characters encoded with multiple bytes + // (i.e. U+0080 and above) will have only the first byte used for separating + // fields. The remaining bytes will be treated as a part of the field. + // BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab + // separator. The default value is comma (",", U+002C). + string field_delimiter = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of rows at the top of a CSV file that BigQuery will + // skip when reading the data. The default value is 0. This property is + // useful if you have header rows in the file that should be skipped. + // When autodetect is on, the behavior is the following: + // + // * skipLeadingRows unspecified - Autodetect tries to detect headers in the + // first row. If they are not detected, the row is read as data. Otherwise + // data is read starting from the second row. + // * skipLeadingRows is 0 - Instructs autodetect that there are no headers and + // data should be read starting from the first row. + // * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect + // headers in row N. If headers are not detected, row N is just skipped. + // Otherwise row N is used to extract column names for the detected schema. + google.protobuf.Int64Value skip_leading_rows = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value that is used to quote data sections in a CSV file. + // BigQuery converts the string to ISO-8859-1 encoding, and then uses the + // first byte of the encoded string to split the data in its raw, binary + // state. + // The default value is a double-quote ("). + // If your data does not contain quoted sections, + // set the property value to an empty string. + // If your data contains quoted newline characters, you must also set the + // allowQuotedNewlines property to true. + // To include the specific quote character within a quoted value, precede it + // with an additional matching quote character. For example, if you want to + // escape the default character ' " ', use ' "" '. + google.protobuf.StringValue quote = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if BigQuery should allow quoted data sections that + // contain newline characters in a CSV file. The default value is false. + google.protobuf.BoolValue allow_quoted_newlines = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if BigQuery should accept rows that are missing + // trailing optional columns. If true, BigQuery treats missing trailing + // columns as null values. + // If false, records with missing trailing columns are treated as bad records, + // and if there are too many bad records, an invalid error is returned in the + // job result. The default value is false. + google.protobuf.BoolValue allow_jagged_rows = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The character encoding of the data. + // The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, + // and UTF-32LE. The default value is UTF-8. + // BigQuery decodes the data after the raw, binary data has been split using + // the values of the quote and fieldDelimiter properties. + string encoding = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the embedded ASCII control characters (the first 32 + // characters in the ASCII-table, from '\x00' to '\x1F') are preserved. + google.protobuf.BoolValue preserve_ascii_control_characters = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a string that represents a null value in a CSV file. + // For example, if you specify "\N", BigQuery interprets "\N" as a null value + // when querying a CSV file. + // The default value is the empty string. If you set this property to a custom + // value, BigQuery throws an error if an empty string is present for all data + // types except for STRING and BYTE. For STRING and BYTE columns, BigQuery + // interprets the empty string as an empty value. + google.protobuf.StringValue null_marker = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + repeated string null_markers = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + string source_column_match = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Json Options for load and make external tables. +message JsonOptions { + // Optional. 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. + string encoding = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information related to a Bigtable protobuf column. +message BigtableProtoConfig { + // Optional. 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). + string schema_bundle_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fully qualified proto message name of the protobuf. In the + // format of "foo.bar.Message". + string proto_message_name = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information related to a Bigtable column. +message BigtableColumn { + // [Required] Qualifier of the column. + // Columns in the parent column family that has this exact qualifier are + // exposed as `.` field. + // If the qualifier is valid UTF-8 string, it can be specified in the + // qualifier_string field. Otherwise, a base-64 encoded value must be set to + // qualifier_encoded. + // The column field name is the same as the column qualifier. However, if the + // qualifier is not a valid BigQuery field identifier i.e. does not match + // [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name. + google.protobuf.BytesValue qualifier_encoded = 1; + + // Qualifier string. + google.protobuf.StringValue qualifier_string = 2; + + // Optional. If the qualifier is not a valid BigQuery field identifier i.e. + // does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided + // as the column field name and is used as field name in queries. + string field_name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type to convert the value in cells of this column. + // The values are expected to be encoded using HBase Bytes.toBytes function + // when using the BINARY encoding value. + // Following BigQuery types are allowed (case-sensitive): + // + // * BYTES + // * STRING + // * INTEGER + // * FLOAT + // * BOOLEAN + // * JSON + // + // Default type is BYTES. + // 'type' can also be set at the column family level. However, the setting at + // this level takes precedence if 'type' is set at both levels. + string type = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encoding of the values when the type is not STRING. + // Acceptable encoding values are: + // TEXT - indicates values are alphanumeric text strings. + // BINARY - indicates values are encoded using HBase Bytes.toBytes family of + // functions. + // 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. + string encoding = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this is set, only the latest version of value in this column + // are exposed. + // 'onlyReadLatest' can also be set at the column family level. However, the + // setting at this level takes precedence if 'onlyReadLatest' is set at both + // levels. + google.protobuf.BoolValue only_read_latest = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Protobuf-specific configurations, only takes effect when the + // encoding is PROTO_BINARY. + BigtableProtoConfig proto_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Information related to a Bigtable column family. +message BigtableColumnFamily { + // Identifier of the column family. + string family_id = 1; + + // Optional. The type to convert the value in cells of this column family. + // The values are expected to be encoded using HBase Bytes.toBytes function + // when using the BINARY encoding value. + // Following BigQuery types are allowed (case-sensitive): + // + // * BYTES + // * STRING + // * INTEGER + // * FLOAT + // * BOOLEAN + // * JSON + // + // Default type is BYTES. + // This can be overridden for a specific column by listing that column in + // 'columns' and specifying a type for it. + string type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encoding of the values when the type is not STRING. + // Acceptable encoding values are: + // TEXT - indicates values are alphanumeric text strings. + // BINARY - indicates values are encoded using HBase Bytes.toBytes family of + // functions. + // 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. + string encoding = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Lists of columns that should be exposed as individual fields as + // opposed to a list of (column name, value) pairs. + // All columns whose qualifier matches a qualifier in this list can be + // accessed as `.`. + // Other columns can be accessed as a list through + // the `.Column` field. + repeated BigtableColumn columns = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this is set only the latest version of value are exposed for + // all columns in this column family. + // This can be overridden for a specific column by listing that column in + // 'columns' and specifying a different setting + // for that column. + google.protobuf.BoolValue only_read_latest = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Protobuf-specific configurations, only takes effect when the + // encoding is PROTO_BINARY. + BigtableProtoConfig proto_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Options specific to Google Cloud Bigtable data sources. +message BigtableOptions { + // Optional. List of column families to expose in the table schema along with + // their types. + // This list restricts the column families that can be referenced in queries + // and specifies their value types. + // You can use this list to do type conversions - see the 'type' field for + // more details. + // If you leave this list empty, all column families are present in the table + // schema and their values are read as BYTES. + // During a query only the column families referenced in that query are read + // from Bigtable. + repeated BigtableColumnFamily column_families = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If field is true, then the column families that are not + // specified in columnFamilies list are not exposed in the table schema. + // Otherwise, they are read with BYTES type values. + // The default value is false. + google.protobuf.BoolValue ignore_unspecified_column_families = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If field is true, then the rowkey column families will be read + // and converted to string. Otherwise they are read with BYTES type values and + // users need to manually cast them with CAST if necessary. + // The default value is false. + google.protobuf.BoolValue read_rowkey_as_string = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If field is true, then each column family will be read as a + // single JSON column. Otherwise they are read as a repeated cell structure + // containing timestamp/value tuples. The default value is false. + google.protobuf.BoolValue output_column_families_as_json = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Options specific to Google Sheets data sources. +message GoogleSheetsOptions { + // Optional. The number of rows at the top of a sheet that BigQuery will skip + // when reading the data. The default value is 0. This property is useful if + // you have header rows that should be skipped. When autodetect is on, + // the behavior is the following: + // * skipLeadingRows unspecified - Autodetect tries to detect headers in the + // first row. If they are not detected, the row is read as data. Otherwise + // data is read starting from the second row. + // * skipLeadingRows is 0 - Instructs autodetect that there are no headers and + // data should be read starting from the first row. + // * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect + // headers in row N. If headers are not detected, row N is just skipped. + // Otherwise row N is used to extract column names for the detected schema. + google.protobuf.Int64Value skip_leading_rows = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Range of a sheet to query from. Only used when non-empty. + // Typical format: sheet_name!top_left_cell_id:bottom_right_cell_id + // For example: sheet1!A1:B20 + string range = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +message ExternalDataConfiguration { + // Supported Object Metadata Types. + enum ObjectMetadata { + // Unspecified by default. + OBJECT_METADATA_UNSPECIFIED = 0; + + // A synonym for `SIMPLE`. + DIRECTORY = 1; + + // Directory listing of objects. + SIMPLE = 2; + } + + // MetadataCacheMode identifies if the table should use metadata caching for + // files from external source (eg Google Cloud Storage). + enum MetadataCacheMode { + // Unspecified metadata cache mode. + METADATA_CACHE_MODE_UNSPECIFIED = 0; + + // 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. + AUTOMATIC = 1; + + // 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. + MANUAL = 2; + } + + // [Required] The fully-qualified URIs that point to your data in Google + // Cloud. For Google Cloud Storage URIs: + // Each URI can contain one '*' wildcard character and it must come after + // the 'bucket' name. + // Size limits related to load jobs apply to external data sources. + // For Google Cloud Bigtable URIs: + // Exactly one URI can be specified and it has be a fully specified and + // valid HTTPS URL for a Google Cloud Bigtable table. + // For Google Cloud Datastore backups, exactly one URI can be specified. Also, + // the '*' wildcard character is not allowed. + repeated string source_uris = 1; + + // Optional. Specifies how source URIs are interpreted for constructing the + // file set to load. By default source URIs are expanded against the + // underlying storage. Other options include specifying manifest files. Only + // applicable to object storage systems. + FileSetSpecType file_set_spec_type = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema for the data. + // Schema is required for CSV and JSON formats if autodetect is not on. + // Schema is disallowed for Google Cloud Bigtable, Cloud Datastore backups, + // Avro, ORC and Parquet formats. + TableSchema schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // [Required] The data format. + // For CSV files, specify "CSV". + // For Google sheets, specify "GOOGLE_SHEETS". + // For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". + // For Avro files, specify "AVRO". + // For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". + // For Apache Iceberg tables, specify "ICEBERG". + // For ORC files, specify "ORC". + // For Parquet files, specify "PARQUET". + // [Beta] For Google Cloud Bigtable, specify "BIGTABLE". + string source_format = 3; + + // Optional. The maximum number of bad records that BigQuery can ignore when + // reading data. If the number of bad records exceeds this value, an invalid + // error is returned in the job result. The default value is 0, which requires + // that all records are valid. This setting is ignored for Google Cloud + // Bigtable, Google Cloud Datastore backups, Avro, ORC and Parquet formats. + google.protobuf.Int32Value max_bad_records = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Try to detect schema and format options automatically. + // Any option specified explicitly will be honored. + google.protobuf.BoolValue autodetect = 5; + + // Optional. Indicates if BigQuery should allow extra values that are not + // represented in the table schema. + // If true, the extra values are ignored. + // If false, records with extra columns are treated as bad records, and if + // there are too many bad records, an invalid error is returned in the job + // result. + // The default value is false. + // The sourceFormat property determines what BigQuery treats as an extra + // value: + // CSV: Trailing columns + // JSON: Named values that don't match any column names + // Google Cloud Bigtable: This setting is ignored. + // Google Cloud Datastore backups: This setting is ignored. + // Avro: This setting is ignored. + // ORC: This setting is ignored. + // Parquet: This setting is ignored. + google.protobuf.BoolValue ignore_unknown_values = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The compression type of the data source. + // Possible values include GZIP and NONE. The default value is NONE. + // This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore + // backups, Avro, ORC and Parquet + // formats. An empty string is an invalid value. + string compression = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional properties to set if sourceFormat is set to CSV. + CsvOptions csv_options = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional properties to set if sourceFormat is set to JSON. + JsonOptions json_options = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional options if sourceFormat is set to BIGTABLE. + BigtableOptions bigtable_options = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional options if sourceFormat is set to GOOGLE_SHEETS. + GoogleSheetsOptions google_sheets_options = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set, configures hive partitioning support. Not all storage + // formats support hive partitioning -- requesting hive partitioning on an + // unsupported format will lead to an error, as will providing an invalid + // specification. + HivePartitioningOptions hive_partitioning_options = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The connection specifying the credentials to be used to read + // external storage, such as Azure Blob, Cloud Storage, or S3. The + // connection_id can have the form + // `{project_id}.{location_id};{connection_id}` or + // `projects/{project_id}/locations/{location_id}/connections/{connection_id}`. + string connection_id = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Defines the list of possible SQL data types to which the source decimal + // values are converted. This list and the precision and the scale parameters + // of the decimal field determine the target type. In the order of NUMERIC, + // BIGNUMERIC, and STRING, a + // type is picked if it is in the specified list and if it supports the + // precision and the scale. STRING supports all precision and scale values. + // If none of the listed types supports the precision and the scale, the type + // supporting the widest range in the specified list is picked, and if a value + // exceeds the supported range when reading the data, an error will be thrown. + // + // Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. + // If (precision,scale) is: + // + // * (38,9) -> NUMERIC; + // * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); + // * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); + // * (76,38) -> BIGNUMERIC; + // * (77,38) -> BIGNUMERIC (error if value 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. + repeated DecimalTargetType decimal_target_types = 16; + + // Optional. Additional properties to set if sourceFormat is set to AVRO. + AvroOptions avro_options = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Load option to be used together with source_format + // newline-delimited JSON to indicate that a variant of JSON is being loaded. + // To load newline-delimited GeoJSON, specify GEOJSON (and source_format must + // be set to NEWLINE_DELIMITED_JSON). + JsonExtension json_extension = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional properties to set if sourceFormat is set to PARQUET. + ParquetOptions parquet_options = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. ObjectMetadata is used to create Object Tables. Object Tables + // contain a listing of objects (with their metadata) found at the + // source_uris. If ObjectMetadata is set, source_format should be omitted. + // + // Currently SIMPLE is the only supported Object Metadata type. + optional ObjectMetadata object_metadata = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When creating an external table, the user can provide a reference + // file with the table schema. This is enabled for the following formats: + // AVRO, PARQUET, ORC. + google.protobuf.StringValue reference_file_schema_uri = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata Cache Mode for the table. Set this to enable caching of + // metadata from external data source. + MetadataCacheMode metadata_cache_mode = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 string time_zone = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Format used to parse DATE values. Supports C-style and SQL-style + // values. + optional string date_format = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Format used to parse DATETIME values. Supports C-style and + // SQL-style values. + optional string datetime_format = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Format used to parse TIME values. Supports C-style and SQL-style + // values. + optional string time_format = 30 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Format used to parse TIMESTAMP values. Supports C-style and + // SQL-style values. + optional string timestamp_format = 31 + [(google.api.field_behavior) = OPTIONAL]; + + // 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, AVRO, and Iceberg External Table. + // + // 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. + repeated int32 timestamp_target_precision = 32; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_dataset_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_dataset_reference.proto new file mode 100644 index 000000000000..a0fc651e46d3 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/external_dataset_reference.proto @@ -0,0 +1,46 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "ExternalDatasetReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; +option (google.api.resource_definition) = { + type: "bigqueryconnection.googleapis.com/Connection" + pattern: "projects/{project}/locations/{location}/connections/{connection}" +}; + +// Configures the access a dataset defined in an external metadata storage. +message ExternalDatasetReference { + // Required. External source that backs this dataset. + string external_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The connection id that is used to access the external_source. + // + // Format: + // projects/{project_id}/locations/{location_id}/connections/{connection_id} + string connection = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryconnection.googleapis.com/Connection" + } + ]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/file_set_specification_type.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/file_set_specification_type.proto new file mode 100644 index 000000000000..ce0ab994d781 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/file_set_specification_type.proto @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "FileSetSpecificationTypeProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// This enum defines how to interpret source URIs for load jobs and external +// tables. +enum FileSetSpecType { + // 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_FILE_SYSTEM_MATCH = 0; + + // This option indicates that the provided URIs are newline-delimited manifest + // files, with one URI per line. Wildcard URIs are not supported. + FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/gen_ai_stats.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/gen_ai_stats.proto new file mode 100644 index 000000000000..e813732ca927 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/gen_ai_stats.proto @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "GenAiStatsProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Provides error statistics for a GenAi function call. +message GenAiFunctionErrorStats { + // A list of unique errors at function level (up to 5, truncated to 100 + // chars). + repeated string errors = 3; + + // Number of failed rows processed by the function + int64 num_failed_rows = 5; +} + +// Provides cost optimization statistics for a GenAi function call. +message GenAiFunctionCostOptimizationStats { + // Number of rows inferred via cost optimized workflow. + optional int64 num_cost_optimized_rows = 1; + + // System generated message to provide insights into cost optimization state. + optional string message = 2; +} + +// Provides cache statistics for a GenAi function call. +message GenAiFunctionCacheStats { + // Number of rows served from cache. + optional int64 num_cache_hit_rows = 1; +} + +// Provides statistics for each Ai function call within a query. +message GenAiFunctionStats { + // Name of the function. + optional string function_name = 1; + + // User input prompt of the function (truncated to 20 chars). + optional string prompt = 2; + + // Number of rows processed by this GenAi function. + // This includes all cost_optimized, llm_inferred and failed_rows. + optional int64 num_processed_rows = 3; + + // Error stats for the function. + optional GenAiFunctionErrorStats error_stats = 4; + + // Cost optimization stats if applied on the rows processed by the function. + optional GenAiFunctionCostOptimizationStats cost_optimization_stats = 5; + + // Cache stats for the function. + optional GenAiFunctionCacheStats cache_stats = 6; +} + +// Provides error statistics for the query job across all AI function calls. +message GenAiErrorStats { + // A list of unique errors at query level (up to 5, truncated to 100 chars) + repeated string errors = 1; +} + +// GenAi stats for the query job. +message GenAiStats { + // Job level error stats across all GenAi functions + optional GenAiErrorStats error_stats = 4; + + // Function level stats for GenAi Functions. + // See https://docs.cloud.google.com/bigquery/docs/generative-ai-overview + repeated GenAiFunctionStats function_stats = 5; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/hive_partitioning.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/hive_partitioning.proto new file mode 100644 index 000000000000..b91e09ba5a2b --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/hive_partitioning.proto @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "HivePartitioningProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Options for configuring hive partitioning detect. +message HivePartitioningOptions { + // Optional. When set, what mode of hive partitioning to use when reading + // data. The following modes are supported: + // + // * AUTO: automatically infer partition key name(s) and type(s). + // + // * STRINGS: automatically infer partition key name(s). All types are + // strings. + // + // * CUSTOM: partition key schema is encoded in the source URI prefix. + // + // Not all storage formats support hive partitioning. Requesting hive + // partitioning on an unsupported format will lead to an error. + // Currently supported formats are: JSON, CSV, ORC, Avro and Parquet. + string mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When hive partition detection is requested, a common prefix for + // all source uris must be required. The prefix must end immediately before + // the partition key encoding begins. For example, consider files following + // this data layout: + // + // gs://bucket/path_to_table/dt=2019-06-01/country=USA/id=7/file.avro + // + // gs://bucket/path_to_table/dt=2019-05-31/country=CA/id=3/file.avro + // + // When hive partitioning is requested with either AUTO or STRINGS detection, + // the common prefix can be either of gs://bucket/path_to_table or + // gs://bucket/path_to_table/. + // + // CUSTOM detection requires encoding the partitioning schema immediately + // after the common prefix. For CUSTOM, any of + // + // * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:INTEGER} + // + // * gs://bucket/path_to_table/{dt:STRING}/{country:STRING}/{id:INTEGER} + // + // * gs://bucket/path_to_table/{dt:DATE}/{country:STRING}/{id:STRING} + // + // would all be valid source URI prefixes. + string source_uri_prefix = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, queries over this table require a partition + // filter that can be used for partition elimination to be specified. + // + // Note that this field should only be true when creating a permanent + // external table or querying a temporary external table. + // + // Hive-partitioned loads with require_partition_filter explicitly set to + // true will fail. + google.protobuf.BoolValue require_partition_filter = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. For permanent external tables, this field is populated with + // the hive partition keys in the order they were inferred. The types of the + // partition keys can be deduced by checking the table schema (which will + // include the partition keys). Not every API will populate this field in the + // output. For example, Tables.Get will populate it, but Tables.List will not + // contain this field. + repeated string fields = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job.proto new file mode 100644 index 000000000000..201efbbe2303 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job.proto @@ -0,0 +1,806 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/v2/data_format_options.proto"; +import "google/cloud/bigquery/v2/dataset_reference.proto"; +import "google/cloud/bigquery/v2/encryption_config.proto"; +import "google/cloud/bigquery/v2/error.proto"; +import "google/cloud/bigquery/v2/job_config.proto"; +import "google/cloud/bigquery/v2/job_creation_reason.proto"; +import "google/cloud/bigquery/v2/job_reference.proto"; +import "google/cloud/bigquery/v2/job_stats.proto"; +import "google/cloud/bigquery/v2/job_status.proto"; +import "google/cloud/bigquery/v2/query_parameter.proto"; +import "google/cloud/bigquery/v2/session_info.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +service JobService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/devstorage.full_control," + "https://www.googleapis.com/auth/devstorage.read_only," + "https://www.googleapis.com/auth/devstorage.read_write"; + + // 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. + rpc CancelJob(CancelJobRequest) returns (JobCancelResponse) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/cancel" + }; + } + + // 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. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}" + }; + } + + // 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. + rpc InsertJob(InsertJobRequest) returns (Job) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/jobs" + body: "job" + }; + } + + // Requests the deletion of the metadata of a job. This call returns when the + // job's metadata is deleted. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/delete" + }; + } + + // 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. + rpc ListJobs(ListJobsRequest) returns (JobList) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/jobs" + }; + } + + // RPC to get the results of a query job. + rpc GetQueryResults(GetQueryResultsRequest) + returns (GetQueryResultsResponse) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/queries/{job_id=*}" + }; + } + + // Runs a BigQuery SQL query synchronously and returns query results if the + // query completes within a specified timeout. + rpc Query(PostQueryRequest) returns (QueryResponse) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/queries" + body: "query_request" + }; + } +} + +message Job { + // Output only. The type of the resource. + string kind = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A hash of this resource. + string etag = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Opaque ID field of the job. + string id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URL that can be used to access the resource again. + string self_link = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the user who ran the job. + string user_email = 5 + [json_name = "user_email", (google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Describes the job configuration. + JobConfiguration configuration = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Reference describing the unique-per-user name of the job. + JobReference job_reference = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Information about the job, including starting time and ending + // time of the job. + JobStatistics statistics = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of this job. Examine this value when polling an + // asynchronous job to see if the job is complete. + JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Full-projection-only] String representation of identity of + // requesting party. Populated for both first- and third-party identities. + // Only present for APIs that support third-party identities. + string principal_subject = 13 [ + json_name = "principal_subject", + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The reason why a Job was created. + JobCreationReason job_creation_reason = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes format of a jobs cancellation request. +message CancelJobRequest { + // Required. Project ID of the job to cancel + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job ID of the job to cancel + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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`) + string location = 3; +} + +// Describes format of a jobs cancellation response. +message JobCancelResponse { + // The resource type of the response. + string kind = 1; + + // The final state of the job. + Job job = 2; +} + +// Describes format of a jobs get request. +message GetJobRequest { + // Required. Project ID of the requested job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job ID of the requested job. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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). + string location = 3; +} + +// Describes format of a job insertion request. +message InsertJobRequest { + // Project ID of project that will be billed for the job. + string project_id = 1; + + // Jobs resource to insert. + Job job = 3; +} + +// Describes the format of a jobs deletion request. +message DeleteJobRequest { + // Required. Project ID of the job for which metadata is to be deleted. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The geographic location of the job. Required. + // + // For more information, see how to + // [specify + // locations](https://cloud.google.com/bigquery/docs/locations#specify_locations). + string location = 3; +} + +// Describes the format of the list jobs request. +message ListJobsRequest { + // Projection is used to control what job information is returned. + enum Projection { + option allow_alias = true; + + // Does not include the job configuration + minimal = 0; + + // Does not include the job configuration + MINIMAL = 0; + + // Includes all job data + full = 1; + + // Includes all job data + FULL = 1; + } + + // StateFilter allows filtration by job execution state. + enum StateFilter { + option allow_alias = true; + + // Finished jobs + done = 0; + + // Finished jobs + DONE = 0; + + // Pending jobs + pending = 1; + + // Pending jobs + PENDING = 1; + + // Running jobs + running = 2; + + // Running jobs. + RUNNING = 2; + } + + // Project ID of the jobs to list. + string project_id = 1; + + // Whether to display jobs owned by all users in the project. Default False. + bool all_users = 2; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.Int32Value max_results = 3; + + // Min value for job creation time, in milliseconds since the POSIX epoch. + // If set, only jobs created after or at this timestamp are returned. + uint64 min_creation_time = 4; + + // Max value for job creation time, in milliseconds since the POSIX epoch. + // If set, only jobs created before or at this timestamp are returned. + google.protobuf.UInt64Value max_creation_time = 5; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 6; + + // Restrict information returned to a set of selected fields + Projection projection = 7; + + // Filter for job state + repeated StateFilter state_filter = 8; + + // If set, show only child jobs of the specified parent. Otherwise, show all + // top-level jobs. + string parent_job_id = 9; +} + +// ListFormatJob is a partial projection of job information returned as part +// of a jobs.list response. +message ListFormatJob { + // Unique opaque ID of the job. + string id = 1; + + // The resource type. + string kind = 2; + + // Unique opaque ID of the job. + JobReference job_reference = 3; + + // Running state of the job. When the state is DONE, errorResult can be + // checked to determine whether the job succeeded or failed. + string state = 4; + + // A result object that will be present only if the job has failed. + ErrorProto error_result = 5; + + // Output only. Information about the job, including starting time and ending + // time of the job. + JobStatistics statistics = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Describes the job configuration. + JobConfiguration configuration = 7 [(google.api.field_behavior) = REQUIRED]; + + // [Full-projection-only] Describes the status of this job. + JobStatus status = 8; + + // [Full-projection-only] Email address of the user who ran the job. + string user_email = 9 [json_name = "user_email"]; + + // [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. + string principal_subject = 10 [json_name = "principal_subject"]; +} + +// JobList is the response format for a jobs.list call. +message JobList { + // A hash of this page of results. + string etag = 1; + + // The resource type of the response. + string kind = 2; + + // A token to request the next page of results. + string next_page_token = 3; + + // List of jobs that were requested. + repeated ListFormatJob jobs = 4; + + // 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" + repeated string unreachable = 5; +} + +// Request object of GetQueryResults. +message GetQueryResultsRequest { + // Required. Project ID of the query job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job ID of the query job. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Zero-based index of the starting row. + google.protobuf.UInt64Value start_index = 3; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 4; + + // Maximum number of results to read. + google.protobuf.UInt32Value max_results = 5; + + // 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. + google.protobuf.UInt32Value timeout_ms = 6; + + // 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). + string location = 7; + + // Optional. Output format adjustments. + DataFormatOptions format_options = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response object of GetQueryResults. +message GetQueryResultsResponse { + // The resource type of the response. + string kind = 1; + + // A hash of this response. + string etag = 2; + + // The schema of the results. Present only when the query completes + // successfully. + TableSchema schema = 3; + + // 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 job_reference = 4; + + // 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. + google.protobuf.UInt64Value total_rows = 5; + + // A token used for paging results. When this token is non-empty, it + // indicates additional results are available. + string page_token = 6; + + // 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. + repeated google.protobuf.Struct rows = 7; + + // The total number of bytes processed for this query. + google.protobuf.Int64Value total_bytes_processed = 8; + + // 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. + google.protobuf.BoolValue job_complete = 9; + + // Output only. The first errors or warnings encountered during the running + // of the job. The final message includes the number of errors that caused the + // process to stop. Errors here do not necessarily mean that the job has + // completed or was unsuccessful. For more information about error messages, + // see [Error + // messages](https://cloud.google.com/bigquery/docs/error-messages). + repeated ErrorProto errors = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether the query result was fetched from the query cache. + google.protobuf.BoolValue cache_hit = 11; + + // Output only. The number of rows affected by a DML statement. Present only + // for DML statements INSERT, UPDATE or DELETE. + google.protobuf.Int64Value num_dml_affected_rows = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request format for the query request. +message PostQueryRequest { + // Required. Project ID of the query request. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The query request body. + QueryRequest query_request = 2; +} + +// Describes the format of the jobs.query request. +message QueryRequest { + // Job Creation Mode provides different options on job creation. + enum JobCreationMode { + // If unspecified JOB_CREATION_REQUIRED is the default. + JOB_CREATION_MODE_UNSPECIFIED = 0; + + // Default. Job creation is always required. + JOB_CREATION_REQUIRED = 1; + + // 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. + JOB_CREATION_OPTIONAL = 2; + } + + // The resource type of the request. + string kind = 2; + + // Required. A query string to execute, using Google Standard SQL or legacy + // SQL syntax. Example: "SELECT COUNT(f1) FROM + // myProjectId.myDatasetId.myTableId". + string query = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of rows of data to return per page of + // results. Setting this flag to a small value such as 1000 and then paging + // through results might improve reliability when the query result set is + // large. In addition to this limit, responses are also limited to 10 MB. By + // default, there is no maximum row count, and only the byte limit applies. + google.protobuf.UInt32Value max_results = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the default datasetId and projectId to assume for any + // unqualified table names in the query. If not set, all table names in the + // query string must be qualified in the format 'datasetId.tableId'. + DatasetReference default_dataset = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.UInt32Value timeout_ms = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job timeout in milliseconds. If this time limit is exceeded, + // BigQuery will attempt to stop a longer job, but may not always succeed in + // canceling it before the job completes. For example, a job that takes more + // than 60 seconds to complete has a better chance of being stopped than a job + // that takes 10 seconds to complete. This timeout applies to the query even + // if a job does not need to be created. + optional int64 job_timeout_ms = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 int32 max_slots = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom encryption configuration (e.g., Cloud KMS keys) + EncryptionConfiguration destination_encryption_configuration = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, BigQuery doesn't run the job. Instead, if the + // query is valid, BigQuery returns statistics about the job such as how many + // bytes would be processed. If the query is invalid, an error returns. The + // default value is false. + bool dry_run = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to look for the result in the query cache. The query + // cache is a best-effort cache that will be flushed whenever tables in the + // query are modified. The default value is true. + google.protobuf.BoolValue use_query_cache = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + google.protobuf.BoolValue use_legacy_sql = 10; + + // GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters + // or to NAMED to use named (@myparam) query parameters in this query. + string parameter_mode = 11; + + // Query parameters for GoogleSQL queries. + repeated QueryParameter query_parameters = 12; + + // 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). + string location = 13; + + // Optional. Output format adjustments. + DataFormatOptions format_options = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Connection properties which can modify the query behavior. + repeated ConnectionProperty connection_properties = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + map labels = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.Int64Value maximum_bytes_billed = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + string request_id = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.BoolValue create_session = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If not set, jobs are always required. + // + // If set, the query request will follow the behavior described + // JobCreationMode. + JobCreationMode job_creation_mode = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 string reservation = 24 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // Optional. 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. + bool write_incremental_results = 25 [(google.api.field_behavior) = OPTIONAL]; +} + +message QueryResponse { + // The resource type. + string kind = 1; + + // The schema of the results. Present only when the query completes + // successfully. + TableSchema schema = 2; + + // 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 job_reference = 3; + + // Optional. 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. + JobCreationReason job_creation_reason = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Auto-generated ID for the query. + string query_id = 14; + + // Output only. The geographic location of the query. + // + // For more information about BigQuery locations, see: + // https://cloud.google.com/bigquery/docs/locations + string location = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.UInt64Value total_rows = 4; + + // 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). + string page_token = 5; + + // 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. + repeated google.protobuf.Struct rows = 6; + + // 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. + google.protobuf.Int64Value total_bytes_processed = 7; + + // Output only. 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. + optional int64 total_bytes_billed = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of slot ms the user is actually billed for. + optional int64 total_slot_ms = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.protobuf.BoolValue job_complete = 8; + + // Output only. The first errors or warnings encountered during the running of + // the job. The final message includes the number of errors that caused the + // process to stop. Errors here do not necessarily mean that the job has + // completed or was unsuccessful. For more information about error messages, + // see [Error + // messages](https://cloud.google.com/bigquery/docs/error-messages). + repeated ErrorProto errors = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether the query result was fetched from the query cache. + google.protobuf.BoolValue cache_hit = 10; + + // Output only. The number of rows affected by a DML statement. Present only + // for DML statements INSERT, UPDATE or DELETE. + google.protobuf.Int64Value num_dml_affected_rows = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information of the session if this job is part of one. + SessionInfo session_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE, + // MERGE or TRUNCATE. + DmlStats dml_stats = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this query, in milliseconds since the epoch. + // This field will be present on all queries. + optional int64 creation_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + optional int64 start_time = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. End time of this query, in milliseconds since the epoch. This + // field will be present whenever a query job is in the DONE state. + optional int64 end_time = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_config.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_config.proto new file mode 100644 index 000000000000..5e9b46004d21 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_config.proto @@ -0,0 +1,921 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/v2/clustering.proto"; +import "google/cloud/bigquery/v2/dataset_reference.proto"; +import "google/cloud/bigquery/v2/decimal_target_types.proto"; +import "google/cloud/bigquery/v2/encryption_config.proto"; +import "google/cloud/bigquery/v2/external_data_config.proto"; +import "google/cloud/bigquery/v2/file_set_specification_type.proto"; +import "google/cloud/bigquery/v2/hive_partitioning.proto"; +import "google/cloud/bigquery/v2/json_extension.proto"; +import "google/cloud/bigquery/v2/model_reference.proto"; +import "google/cloud/bigquery/v2/query_parameter.proto"; +import "google/cloud/bigquery/v2/range_partitioning.proto"; +import "google/cloud/bigquery/v2/system_variable.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/cloud/bigquery/v2/time_partitioning.proto"; +import "google/cloud/bigquery/v2/udf_resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "JobConfigProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Properties for the destination table. +message DestinationTableProperties { + // Optional. Friendly name for the destination table. If the table already + // exists, it should be same as the existing friendly name. + google.protobuf.StringValue friendly_name = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description for the destination table. + // This will only be used if the destination table is newly created. + // If the table already exists and a value different than the current + // description is provided, the job will fail. + google.protobuf.StringValue description = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels associated with this table. You can use these to + // organize and group your tables. This will only be used if the destination + // table is newly created. If the table already exists and labels are + // different than the current labels are provided, the job will fail. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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. +message ConnectionProperty { + // The key of the property to set. + string key = 1; + + // The value of the property to set. + string value = 2; +} + +// JobConfigurationQuery configures a BigQuery query job. +message JobConfigurationQuery { + // [Required] SQL query text to execute. The useLegacySql field can be used + // to indicate whether the query uses legacy SQL or GoogleSQL. + string query = 1; + + // Optional. Describes the table where the query results should be stored. + // This property must be set for large results that exceed the maximum + // response size. For queries that produce anonymous (cached) results, this + // field will be populated by BigQuery. + TableReference destination_table = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. You can specify external table definitions, which operate as + // ephemeral tables that can be queried. These definitions are configured + // using a JSON map, where the string key represents the table identifier, and + // the value is the corresponding external data configuration object. + map external_table_definitions = 23 + [json_name = "tableDefinitions", (google.api.field_behavior) = OPTIONAL]; + + // Describes user-defined function resources used in the query. + repeated UserDefinedFunctionResource user_defined_function_resources = 4; + + // Optional. Specifies whether the job is allowed to create new tables. + // The following values are supported: + // + // * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. + // * CREATE_NEVER: The table must already exist. If it does not, + // a 'notFound' error is returned in the job result. + // + // The default value is CREATE_IF_NEEDED. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + string create_disposition = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the action that occurs if the destination table + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // data, removes the constraints, and uses the schema from the query result. + // * WRITE_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. + string write_disposition = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the default dataset to use for unqualified + // table names in the query. This setting does not alter behavior of + // unqualified dataset names. Setting the system variable + // `@@dataset_id` achieves the same behavior. See + // https://cloud.google.com/bigquery/docs/reference/system-variables for more + // information on system variables. + DatasetReference default_dataset = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a priority for the query. Possible values include + // INTERACTIVE and BATCH. The default value is INTERACTIVE. + string priority = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and query uses legacy SQL dialect, allows the query + // to produce arbitrarily large result tables at a slight cost in performance. + // Requires destinationTable to be set. + // For GoogleSQL queries, this flag is ignored and large results are + // always allowed. However, you must still set destinationTable when result + // size exceeds the allowed maximum response size. + google.protobuf.BoolValue allow_large_results = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to look for the result in the query cache. The query + // cache is a best-effort cache that will be flushed whenever tables in the + // query are modified. Moreover, the query cache is only available when a + // query does not have a destination table specified. The default value is + // true. + google.protobuf.BoolValue use_query_cache = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and query uses legacy SQL dialect, flattens all nested + // and repeated fields in the query results. + // allowLargeResults must be true if this is set to false. + // For GoogleSQL queries, this flag is ignored and results are never + // flattened. + google.protobuf.BoolValue flatten_results = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Limits the bytes billed for this job. Queries that will have + // bytes billed beyond this limit will fail (without incurring a charge). + // If unspecified, this will be set to your project default. + google.protobuf.Int64Value maximum_bytes_billed = 14; + + // Optional. 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. + google.protobuf.BoolValue use_legacy_sql = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters + // or to NAMED to use named (@myparam) query parameters in this query. + string parameter_mode = 16; + + // Query parameters for GoogleSQL queries. + repeated QueryParameter query_parameters = 17; + + // Output only. System variables for GoogleSQL queries. A system variable is + // output if the variable is settable and its value differs from the system + // default. + // "@@" prefix is not included in the name of the System variables. + optional SystemVariables system_variables = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated string schema_update_options = 18; + + // Time-based partitioning specification for the destination table. Only one + // of timePartitioning and rangePartitioning should be specified. + TimePartitioning time_partitioning = 19; + + // Range partitioning specification for the destination table. + // Only one of timePartitioning and rangePartitioning should be specified. + RangePartitioning range_partitioning = 22; + + // Clustering specification for the destination table. + Clustering clustering = 20; + + // Custom encryption configuration (e.g., Cloud KMS keys) + EncryptionConfiguration destination_encryption_configuration = 21; + + // Options controlling the execution of scripts. + ScriptOptions script_options = 24; + + // Connection properties which can modify the query behavior. + repeated ConnectionProperty connection_properties = 33; + + // 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. + google.protobuf.BoolValue create_session = 34; + + // Optional. Whether to run the query as continuous or a regular query. + // Continuous query is currently in experimental stage and not ready for + // general usage. + google.protobuf.BoolValue continuous = 36 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + bool write_incremental_results = 37 [(google.api.field_behavior) = OPTIONAL]; +} + +// Options related to script execution. +message ScriptOptions { + // KeyResultStatementKind controls how the key result is determined. + enum KeyResultStatementKind { + // Default value. + KEY_RESULT_STATEMENT_KIND_UNSPECIFIED = 0; + + // The last result determines the key result. + LAST = 1; + + // The first SELECT statement determines the key result. + FIRST_SELECT = 2; + } + + // Timeout period for each statement in a script. + google.protobuf.Int64Value statement_timeout_ms = 1; + + // Limit on the number of bytes billed per statement. Exceeding this budget + // results in an error. + google.protobuf.Int64Value statement_byte_budget = 2; + + // 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. + KeyResultStatementKind key_result_statement = 4; +} + +// JobConfigurationLoad contains the configuration properties for loading data +// into a destination table. +message JobConfigurationLoad { + // Indicates the character map used for column names. + enum ColumnNameCharacterMap { + // Unspecified column name character map. + COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED = 0; + + // Support flexible column name and reject invalid column names. + STRICT = 1; + + // Support alphanumeric + underscore characters and names must start with a + // letter or underscore. Invalid column names will be normalized. + V1 = 2; + + // Support flexible column name. Invalid column names will be normalized. + V2 = 3; + } + + // Indicates the strategy used to match loaded columns to the schema. + enum SourceColumnMatch { + // 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. + SOURCE_COLUMN_MATCH_UNSPECIFIED = 0; + + // Matches by position. This assumes that the columns are ordered the same + // way as the schema. + POSITION = 1; + + // Matches by name. This reads the header row as column names and reorders + // columns to match the field names in the schema. + NAME = 2; + } + + // [Required] The fully-qualified URIs that point to your data in Google + // Cloud. + // For Google Cloud Storage URIs: + // Each URI can contain one '*' wildcard character and it must come after + // the 'bucket' name. Size limits related to load jobs apply to external + // data sources. + // For Google Cloud Bigtable URIs: + // Exactly one URI can be specified and it has be a fully specified and + // valid HTTPS URL for a Google Cloud Bigtable table. + // For Google Cloud Datastore backups: + // Exactly one URI can be specified. Also, the '*' wildcard character is not + // allowed. + repeated string source_uris = 1; + + // Optional. Specifies how source URIs are interpreted for constructing the + // file set to load. By default, source URIs are expanded against the + // underlying storage. You can also specify manifest files to control how the + // file set is constructed. This option is only applicable to object storage + // systems. + FileSetSpecType file_set_spec_type = 49 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The schema for the destination table. The schema can be + // omitted if the destination table already exists, or if you're loading data + // from Google Cloud Datastore. + TableSchema schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // [Required] The destination table to load the data into. + TableReference destination_table = 3; + + // Optional. [Experimental] Properties with which to create the destination + // table if it is new. + DestinationTableProperties destination_table_properties = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the job is allowed to create new tables. + // The following values are supported: + // + // * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. + // * CREATE_NEVER: The table must already exist. If it does not, + // a 'notFound' error is returned in the job result. + // The default value is CREATE_IF_NEEDED. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + string create_disposition = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the action that occurs if the destination table + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // data, removes the constraints and uses the schema from the load job. + // * WRITE_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. + string write_disposition = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a string that represents a null value in a CSV file. + // For example, if you specify "\N", BigQuery interprets "\N" as a null value + // when loading a CSV file. + // The default value is the empty string. If you set this property to a custom + // value, BigQuery throws an error if an empty string is present for all data + // types except for STRING and BYTE. For STRING and BYTE columns, BigQuery + // interprets the empty string as an empty value. + google.protobuf.StringValue null_marker = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The separator character for fields in a CSV file. The separator + // is interpreted as a single byte. For files encoded in ISO-8859-1, any + // single character can be used as a separator. For files encoded in UTF-8, + // characters represented in decimal range 1-127 (U+0001-U+007F) can be used + // without any modification. UTF-8 characters encoded with multiple bytes + // (i.e. U+0080 and above) will have only the first byte used for separating + // fields. The remaining bytes will be treated as a part of the field. + // BigQuery also supports the escape sequence "\t" (U+0009) to specify a tab + // separator. The default value is comma (",", U+002C). + string field_delimiter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of rows at the top of a CSV file that BigQuery will + // skip when loading the data. The default value is 0. This property is useful + // if you have header rows in the file that should be skipped. When autodetect + // is on, the behavior is the following: + // + // * skipLeadingRows unspecified - Autodetect tries to detect headers in the + // first row. If they are not detected, the row is read as data. Otherwise + // data is read starting from the second row. + // * skipLeadingRows is 0 - Instructs autodetect that there are no headers and + // data should be read starting from the first row. + // * skipLeadingRows = N > 0 - Autodetect skips N-1 rows and tries to detect + // headers in row N. If headers are not detected, row N is just skipped. + // Otherwise row N is used to extract column names for the detected schema. + google.protobuf.Int32Value skip_leading_rows = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The character encoding of the data. + // The supported values are UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-32BE, + // and UTF-32LE. The default value is UTF-8. BigQuery decodes the data after + // the raw, binary data has been split using the values of the `quote` and + // `fieldDelimiter` properties. + // + // If you don't specify an encoding, or if you specify a UTF-8 encoding when + // the CSV file is not UTF-8 encoded, BigQuery attempts to convert the data to + // UTF-8. Generally, your data loads successfully, but it may not match + // byte-for-byte what you expect. To avoid this, specify the correct encoding + // by using the `--encoding` flag. + // + // If BigQuery can't convert a character other than the ASCII `0` character, + // BigQuery converts the character to the standard Unicode replacement + // character: �. + string encoding = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value that is used to quote data sections in a CSV file. + // BigQuery converts the string to ISO-8859-1 encoding, and then uses the + // first byte of the encoded string to split the data in its raw, binary + // state. + // The default value is a double-quote ('"'). + // If your data does not contain quoted sections, set the property value to an + // empty string. + // If your data contains quoted newline characters, you must also set the + // allowQuotedNewlines property to true. + // To include the specific quote character within a quoted value, precede it + // with an additional matching quote character. For example, if you want to + // escape the default character ' " ', use ' "" '. + // @default " + google.protobuf.StringValue quote = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of bad records that BigQuery can ignore when + // running the job. If the number of bad records exceeds this value, an + // invalid error is returned in the job result. + // The default value is 0, which requires that all records are valid. + // This is only supported for CSV and NEWLINE_DELIMITED_JSON file formats. + google.protobuf.Int32Value max_bad_records = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Indicates if BigQuery should allow quoted data sections that contain + // newline characters in a CSV file. The default value is false. + google.protobuf.BoolValue allow_quoted_newlines = 15; + + // Optional. The format of the data files. + // For CSV files, specify "CSV". For datastore backups, + // specify "DATASTORE_BACKUP". For newline-delimited JSON, + // specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". + // For parquet, specify "PARQUET". For orc, specify "ORC". + // The default value is CSV. + string source_format = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Accept rows that are missing trailing optional columns. + // The missing values are treated as nulls. + // If false, records with missing trailing columns are treated as bad records, + // and if there are too many bad records, an invalid error is returned in the + // job result. + // The default value is false. + // Only applicable to CSV, ignored for other formats. + google.protobuf.BoolValue allow_jagged_rows = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if BigQuery should allow extra values that are not + // represented in the table schema. + // If true, the extra values are ignored. + // If false, records with extra columns are treated as bad records, and if + // there are too many bad records, an invalid error is returned in the job + // result. The default value is false. + // The sourceFormat property determines what BigQuery treats as an extra + // value: + // CSV: Trailing columns + // JSON: Named values that don't match any column names in the table schema + // Avro, Parquet, ORC: Fields in the file schema that don't exist in the + // table schema. + google.protobuf.BoolValue ignore_unknown_values = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + repeated string projection_fields = 19; + + // Optional. Indicates if we should automatically infer the options and + // schema for CSV and JSON sources. + google.protobuf.BoolValue autodetect = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + repeated string schema_update_options = 21; + + // Time-based partitioning specification for the destination table. Only one + // of timePartitioning and rangePartitioning should be specified. + TimePartitioning time_partitioning = 22; + + // Range partitioning specification for the destination table. + // Only one of timePartitioning and rangePartitioning should be specified. + RangePartitioning range_partitioning = 26; + + // Clustering specification for the destination table. + Clustering clustering = 23; + + // Custom encryption configuration (e.g., Cloud KMS keys) + EncryptionConfiguration destination_encryption_configuration = 24; + + // Optional. If sourceFormat is set to "AVRO", indicates whether to interpret + // logical types as the corresponding BigQuery data type (for example, + // TIMESTAMP), instead of using the raw type (for example, INTEGER). + google.protobuf.BoolValue use_avro_logical_types = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user can provide a reference file with the reader schema. + // This file is only loaded if it is part of source URIs, but is not loaded + // otherwise. It is enabled for the following formats: AVRO, PARQUET, ORC. + google.protobuf.StringValue reference_file_schema_uri = 45 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set, configures hive partitioning support. + // Not all storage formats support hive partitioning -- requesting hive + // partitioning on an unsupported format will lead to an error, as will + // providing an invalid specification. + HivePartitioningOptions hive_partitioning_options = 37 + [(google.api.field_behavior) = OPTIONAL]; + + // Defines the list of possible SQL data types to which the source decimal + // values are converted. This list and the precision and the scale parameters + // of the decimal field determine the target type. In the order of NUMERIC, + // BIGNUMERIC, and STRING, a + // type is picked if it is in the specified list and if it supports the + // precision and the scale. STRING supports all precision and scale values. + // If none of the listed types supports the precision and the scale, the type + // supporting the widest range in the specified list is picked, and if a value + // exceeds the supported range when reading the data, an error will be thrown. + // + // Example: Suppose the value of this field is ["NUMERIC", "BIGNUMERIC"]. + // If (precision,scale) is: + // + // * (38,9) -> NUMERIC; + // * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer digits); + // * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); + // * (76,38) -> BIGNUMERIC; + // * (77,38) -> BIGNUMERIC (error if value 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. + repeated DecimalTargetType decimal_target_types = 39; + + // Optional. Load option to be used together with source_format + // newline-delimited JSON to indicate that a variant of JSON is being loaded. + // To load newline-delimited GeoJSON, specify GEOJSON (and source_format must + // be set to NEWLINE_DELIMITED_JSON). + JsonExtension json_extension = 41 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional properties to set if sourceFormat is set to PARQUET. + ParquetOptions parquet_options = 42 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When sourceFormat is set to "CSV", this indicates whether the + // embedded ASCII control characters (the first 32 characters in the + // ASCII-table, from + // '\x00' to '\x1F') are preserved. + google.protobuf.BoolValue preserve_ascii_control_characters = 44 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Connection properties which can modify the load job behavior. + // Currently, only the 'session_id' connection property is supported, and is + // used to resolve _SESSION appearing as the dataset id. + repeated ConnectionProperty connection_properties = 46 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If this property is true, the job creates a new session using a + // randomly generated session_id. To continue using a created session with + // subsequent queries, pass the existing session identifier as a + // `ConnectionProperty` value. The session identifier is returned as part of + // the `SessionInfo` message within the query statistics. + // + // The new session's location will be set to `Job.JobReference.location` if it + // is present, otherwise it's set to the default location based on existing + // routing logic. + google.protobuf.BoolValue create_session = 47 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Character map supported for column names in CSV/Parquet loads. + // Defaults to STRICT and can be overridden by Project Config Service. Using + // this option with unsupporting load formats will result in an error. + ColumnNameCharacterMap column_name_character_map = 50 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. [Experimental] Configures the load job to copy files directly to + // the destination BigLake managed table, bypassing file content reading and + // rewriting. + // + // Copying files only is supported when all the following are true: + // + // * `source_uris` are located in the same Cloud Storage location as the + // destination table's `storage_uri` location. + // * `source_format` is `PARQUET`. + // * `destination_table` is an existing BigLake managed table. The table's + // schema does not have flexible column names. The table's columns do not + // have type parameters other than precision and scale. + // * No options other than the above are specified. + google.protobuf.BoolValue copy_files_only = 51 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default time zone that will apply when parsing timestamp values + // that have no specific time zone. + google.protobuf.StringValue time_zone = 52 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + repeated string null_markers = 53 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Date format used for parsing DATE values. + optional string date_format = 54 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Date format used for parsing DATETIME values. + optional string datetime_format = 55 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Date format used for parsing TIME values. + optional string time_format = 56 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Date format used for parsing TIMESTAMP values. + optional string timestamp_format = 57 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + SourceColumnMatch source_column_match = 58 + [(google.api.field_behavior) = OPTIONAL]; + + // 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, AVRO, and Iceberg External Table. + // + // 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. + repeated int32 timestamp_target_precision = 59; +} + +// 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). +message JobConfigurationTableCopy { + // Indicates different operation types supported in table copy job. + enum OperationType { + // Unspecified operation type. + OPERATION_TYPE_UNSPECIFIED = 0; + + // The source and destination table have the same table type. + COPY = 1; + + // The source table type is TABLE and + // the destination table type is SNAPSHOT. + SNAPSHOT = 2; + + // The source table type is SNAPSHOT and + // the destination table type is TABLE. + RESTORE = 3; + + // The source and destination table have the same table type, + // but only bill for unique data. + CLONE = 4; + } + + // [Pick one] Source table to copy. + TableReference source_table = 1; + + // [Pick one] Source tables to copy. + repeated TableReference source_tables = 2; + + // [Required] The destination table. + TableReference destination_table = 3; + + // Optional. Specifies whether the job is allowed to create new tables. + // The following values are supported: + // + // * CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the + // table. + // * CREATE_NEVER: The table must already exist. If it does not, + // a 'notFound' error is returned in the job result. + // + // The default value is CREATE_IF_NEEDED. + // Creation, truncation and append actions occur as one atomic update + // upon job completion. + string create_disposition = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the action that occurs if the destination table + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the + // table data and uses the schema 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. + string write_disposition = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Custom encryption configuration (e.g., Cloud KMS keys). + EncryptionConfiguration destination_encryption_configuration = 6; + + // Optional. Supported operation types in table copy job. + OperationType operation_type = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The time when the destination table expires. Expired tables will + // be deleted and their storage reclaimed. + google.protobuf.Timestamp destination_expiration_time = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// JobConfigurationExtract configures a job that exports data from a BigQuery +// table into Google Cloud Storage. +message JobConfigurationExtract { + // Options related to model extraction. + message 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. + google.protobuf.Int64Value trial_id = 1; + } + + // Required. Source reference for the export. + oneof source { + // A reference to the table being exported. + TableReference source_table = 1; + + // A reference to the model being exported. + ModelReference source_model = 9; + } + + // [Pick one] A list of fully-qualified Google Cloud Storage URIs where the + // extracted table should be written. + repeated string destination_uris = 3; + + // Optional. Whether to print out a header row in the results. + // Default is true. Not applicable when extracting models. + google.protobuf.BoolValue print_header = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When extracting data in CSV format, this defines the + // delimiter to use between fields in the exported data. + // Default is ','. Not applicable when extracting models. + string field_delimiter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The exported file format. Possible values include CSV, + // NEWLINE_DELIMITED_JSON, PARQUET, or AVRO for tables and ML_TF_SAVED_MODEL + // or ML_XGBOOST_BOOSTER for models. The default value for tables is CSV. + // Tables with nested or repeated fields cannot be exported as CSV. The + // default value for models is ML_TF_SAVED_MODEL. + string destination_format = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The compression type to use for exported files. Possible values + // include DEFLATE, GZIP, NONE, SNAPPY, and ZSTD. The default value is NONE. + // Not all compression formats are support for all file formats. DEFLATE is + // only supported for Avro. ZSTD is only supported for Parquet. Not applicable + // when extracting models. + string compression = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Whether to use logical types when extracting to AVRO format. Not applicable + // when extracting models. + google.protobuf.BoolValue use_avro_logical_types = 13; + + // Optional. Model extract options only applicable when extracting models. + ModelExtractOptions model_extract_options = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +message JobConfiguration { + // Output only. The type of the job. Can be QUERY, LOAD, EXTRACT, COPY or + // UNKNOWN. + string job_type = 8; + + // [Pick one] Configures a query job. + JobConfigurationQuery query = 1; + + // [Pick one] Configures a load job. + JobConfigurationLoad load = 2; + + // [Pick one] Copies a table. + JobConfigurationTableCopy copy = 3; + + // [Pick one] Configures an extract job. + JobConfigurationExtract extract = 4; + + // Optional. If set, don't actually run this job. A valid query will return + // a mostly empty response with some processing statistics, while an invalid + // query will return the same error it would if it wasn't a dry run. Behavior + // of non-query jobs is undefined. + google.protobuf.BoolValue dry_run = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.Int64Value job_timeout_ms = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 int32 max_slots = 12 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 7; + + // Optional. 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 string reservation = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_creation_reason.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_creation_reason.proto new file mode 100644 index 000000000000..8409dc597265 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_creation_reason.proto @@ -0,0 +1,58 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "JobCreationReasonProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// 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`. +message JobCreationReason { + // Indicates the high level reason why a job was created. + enum Code { + // Reason is not specified. + CODE_UNSPECIFIED = 0; + + // Job creation was requested. + REQUESTED = 1; + + // 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. + LONG_RUNNING = 2; + + // The results from the query cannot fit in the response. + LARGE_RESULTS = 3; + + // BigQuery has determined that the query needs to be executed as a Job. + OTHER = 4; + } + + // Output only. Specifies the high level reason why a Job was created. + Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_reference.proto new file mode 100644 index 000000000000..da814f6f7523 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_reference.proto @@ -0,0 +1,42 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "JobReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// A job reference is a fully qualified identifier for referring to a job. +message JobReference { + // Required. The ID of the project containing this job. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the job. The ID must contain only letters (a-z, A-Z), + // numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 + // characters. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 + google.protobuf.StringValue location = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_stats.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_stats.proto new file mode 100644 index 000000000000..6a0d8c9014cd --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_stats.proto @@ -0,0 +1,1705 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/v2/dataset_reference.proto"; +import "google/cloud/bigquery/v2/gen_ai_stats.proto"; +import "google/cloud/bigquery/v2/model.proto"; +import "google/cloud/bigquery/v2/property_graph_reference.proto"; +import "google/cloud/bigquery/v2/query_parameter.proto"; +import "google/cloud/bigquery/v2/routine_reference.proto"; +import "google/cloud/bigquery/v2/row_access_policy_reference.proto"; +import "google/cloud/bigquery/v2/session_info.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "JobStatsProto"; +option java_package = "com.google.cloud.bigquery.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "storage.googleapis.com/Bucket" + pattern: "*" +}; + +// An operation within a stage. +message ExplainQueryStep { + // Machine-readable operation type. + string kind = 1; + + // Human-readable description of the step(s). + repeated string substeps = 2; +} + +// A single stage of query execution. +message ExplainQueryStage { + // Indicates the type of compute mode. + enum ComputeMode { + // ComputeMode type not specified. + COMPUTE_MODE_UNSPECIFIED = 0; + + // This stage was processed using BigQuery slots. + BIGQUERY = 1; + + // This stage was processed using BI Engine compute. + BI_ENGINE = 2; + } + + // Human-readable name for the stage. + string name = 1; + + // Unique ID for the stage within the plan. + google.protobuf.Int64Value id = 2; + + // Stage start time represented as milliseconds since the epoch. + int64 start_ms = 3; + + // Stage end time represented as milliseconds since the epoch. + int64 end_ms = 4; + + // IDs for stages that are inputs to this stage. + repeated int64 input_stages = 5; + + // Relative amount of time the average shard spent waiting to be + // scheduled. + google.protobuf.DoubleValue wait_ratio_avg = 6; + + // Milliseconds the average shard spent waiting to be scheduled. + google.protobuf.Int64Value wait_ms_avg = 7; + + // Relative amount of time the slowest shard spent waiting to be + // scheduled. + google.protobuf.DoubleValue wait_ratio_max = 8; + + // Milliseconds the slowest shard spent waiting to be scheduled. + google.protobuf.Int64Value wait_ms_max = 9; + + // Relative amount of time the average shard spent reading input. + google.protobuf.DoubleValue read_ratio_avg = 10; + + // Milliseconds the average shard spent reading input. + google.protobuf.Int64Value read_ms_avg = 11; + + // Relative amount of time the slowest shard spent reading input. + google.protobuf.DoubleValue read_ratio_max = 12; + + // Milliseconds the slowest shard spent reading input. + google.protobuf.Int64Value read_ms_max = 13; + + // Relative amount of time the average shard spent on CPU-bound tasks. + google.protobuf.DoubleValue compute_ratio_avg = 14; + + // Milliseconds the average shard spent on CPU-bound tasks. + google.protobuf.Int64Value compute_ms_avg = 15; + + // Relative amount of time the slowest shard spent on CPU-bound tasks. + google.protobuf.DoubleValue compute_ratio_max = 16; + + // Milliseconds the slowest shard spent on CPU-bound tasks. + google.protobuf.Int64Value compute_ms_max = 17; + + // Relative amount of time the average shard spent on writing output. + google.protobuf.DoubleValue write_ratio_avg = 18; + + // Milliseconds the average shard spent on writing output. + google.protobuf.Int64Value write_ms_avg = 19; + + // Relative amount of time the slowest shard spent on writing output. + google.protobuf.DoubleValue write_ratio_max = 20; + + // Milliseconds the slowest shard spent on writing output. + google.protobuf.Int64Value write_ms_max = 21; + + // Total number of bytes written to shuffle. + google.protobuf.Int64Value shuffle_output_bytes = 22; + + // Total number of bytes written to shuffle and spilled to disk. + google.protobuf.Int64Value shuffle_output_bytes_spilled = 23; + + // Number of records read into the stage. + google.protobuf.Int64Value records_read = 24; + + // Number of records written by the stage. + google.protobuf.Int64Value records_written = 25; + + // Number of parallel input segments to be processed + google.protobuf.Int64Value parallel_inputs = 26; + + // Number of parallel input segments completed. + google.protobuf.Int64Value completed_parallel_inputs = 27; + + // Current status for this stage. + string status = 28; + + // List of operations within the stage in dependency order (approximately + // chronological). + repeated ExplainQueryStep steps = 29; + + // Slot-milliseconds used by the stage. + google.protobuf.Int64Value slot_ms = 30; + + // Output only. Compute mode for this stage. + ComputeMode compute_mode = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Summary of the state of query execution at a given time. +message QueryTimelineSample { + // Milliseconds elapsed since the start of query execution. + google.protobuf.Int64Value elapsed_ms = 1; + + // Cumulative slot-ms consumed by the query. + google.protobuf.Int64Value total_slot_ms = 2; + + // Total units of work remaining for the query. This number can be revised + // (increased or decreased) while the query is running. + google.protobuf.Int64Value pending_units = 3; + + // Total parallel units of work completed by this query. + google.protobuf.Int64Value completed_units = 4; + + // Total number of active workers. This does not correspond directly to + // slot usage. This is the largest value observed since the last sample. + google.protobuf.Int64Value active_units = 5; + + // Total shuffle usage ratio in shuffle RAM per reservation of this query. + // This will be provided for reservation customers only. + google.protobuf.DoubleValue shuffle_ram_usage_ratio = 6; + + // 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. + google.protobuf.Int64Value estimated_runnable_units = 7; +} + +// 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. +message ExternalServiceCost { + // External service name. + string external_service = 1; + + // External service cost in terms of bigquery bytes processed. + google.protobuf.Int64Value bytes_processed = 2; + + // External service cost in terms of bigquery bytes billed. + google.protobuf.Int64Value bytes_billed = 3; + + // External service cost in terms of bigquery slot milliseconds. + google.protobuf.Int64Value slot_ms = 4; + + // 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. + int64 reserved_slot_count = 5; + + // 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. + string billing_method = 6; +} + +// Statistics for the EXPORT DATA statement as part of Query Job. EXTRACT +// JOB statistics are populated in JobStatistics4. +message ExportDataStatistics { + // Number of destination files generated in case of EXPORT DATA + // statement only. + google.protobuf.Int64Value file_count = 1; + + // [Alpha] Number of destination rows generated in case of EXPORT DATA + // statement only. + google.protobuf.Int64Value row_count = 2; +} + +// Reason why BI Engine didn't accelerate the query (or sub-query). +message BiEngineReason { + // Indicates the high-level reason for no/partial acceleration + enum Code { + // BiEngineReason not specified. + CODE_UNSPECIFIED = 0; + + // No reservation available for BI Engine acceleration. + NO_RESERVATION = 1; + + // Not enough memory available for BI Engine acceleration. + INSUFFICIENT_RESERVATION = 2; + + // This particular SQL text is not supported for acceleration by BI Engine. + UNSUPPORTED_SQL_TEXT = 4; + + // Input too large for acceleration by BI Engine. + INPUT_TOO_LARGE = 5; + + // Catch-all code for all other cases for partial or disabled acceleration. + OTHER_REASON = 6; + + // One or more tables were not eligible for BI Engine acceleration. + TABLE_EXCLUDED = 7; + } + + // Output only. High-level BI Engine reason for partial or disabled + // acceleration + Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Free form human-readable reason for partial or disabled + // acceleration. + string message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a BI Engine specific query. +// Populated as part of JobStatistics2 +message BiEngineStatistics { + // Indicates the type of BI Engine acceleration. + enum BiEngineMode { + // BiEngineMode type not specified. + ACCELERATION_MODE_UNSPECIFIED = 0; + + // BI Engine disabled the acceleration. bi_engine_reasons + // specifies a more detailed reason. + DISABLED = 1; + + // Part of the query was accelerated using BI Engine. + // See bi_engine_reasons for why parts of the query were not + // accelerated. + PARTIAL = 2; + + // All of the query was accelerated using BI Engine. + FULL = 3; + } + + // Indicates the type of BI Engine acceleration. + enum BiEngineAccelerationMode { + // BiEngineMode type not specified. + BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED = 0; + + // BI Engine acceleration was attempted but disabled. bi_engine_reasons + // specifies a more detailed reason. + BI_ENGINE_DISABLED = 1; + + // Some inputs were accelerated using BI Engine. + // See bi_engine_reasons for why parts of the query were not + // accelerated. + PARTIAL_INPUT = 2; + + // All of the query inputs were accelerated using BI Engine. + FULL_INPUT = 3; + + // All of the query was accelerated using BI Engine. + FULL_QUERY = 4; + } + + // Output only. Specifies which mode of BI Engine acceleration was performed + // (if any). + BiEngineMode bi_engine_mode = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Specifies which mode of BI Engine acceleration was performed + // (if any). + BiEngineAccelerationMode acceleration_mode = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + repeated BiEngineReason bi_engine_reasons = 2; +} + +// Reason about why no search index was used in the search query (or +// sub-query). +message IndexUnusedReason { + // Indicates the high-level reason for the scenario when no search index was + // used. + enum Code { + // Code not specified. + CODE_UNSPECIFIED = 0; + + // Indicates the search index configuration has not been created. + INDEX_CONFIG_NOT_AVAILABLE = 1; + + // Indicates the search index creation has not been completed. + PENDING_INDEX_CREATION = 2; + + // 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. + BASE_TABLE_TRUNCATED = 3; + + // Indicates the search index configuration has been changed since the last + // time the search index was refreshed. + INDEX_CONFIG_MODIFIED = 4; + + // Indicates the search query accesses data at a timestamp before the last + // time the search index was refreshed. + TIME_TRAVEL_QUERY = 5; + + // 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. + NO_PRUNING_POWER = 6; + + // Indicates the search index does not cover all fields in the search + // function. + UNINDEXED_SEARCH_FIELDS = 7; + + // Indicates the search index does not support the given search query + // pattern. + UNSUPPORTED_SEARCH_PATTERN = 8; + + // Indicates the query has been optimized by using a materialized view. + OPTIMIZED_WITH_MATERIALIZED_VIEW = 9; + + // Indicates the query has been secured by data masking, and thus search + // indexes are not applicable. + SECURED_BY_DATA_MASKING = 11; + + // Indicates that the search index and the search function call do not + // have the same text analyzer. + MISMATCHED_TEXT_ANALYZER = 12; + + // 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_SMALL = 13; + + // 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. + BASE_TABLE_TOO_LARGE = 14; + + // Indicates that the estimated performance gain from using the search index + // is too low for the given search query. + ESTIMATED_PERFORMANCE_GAIN_TOO_LOW = 15; + + // 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. + COLUMN_METADATA_INDEX_NOT_USED = 21; + + // Indicates that search indexes can not be used for search query with + // STANDARD edition. + NOT_SUPPORTED_IN_STANDARD_EDITION = 17; + + // Indicates that an option in the search function that cannot make use of + // the index has been selected. + INDEX_SUPPRESSED_BY_FUNCTION_OPTION = 18; + + // Indicates that the query was cached, and thus the search index was not + // used. + QUERY_CACHE_HIT = 19; + + // The index cannot be used in the search query because it is stale. + STALE_INDEX = 20; + + // Indicates an internal error that causes the search index to be unused. + INTERNAL_ERROR = 10; + + // Indicates that the reason search indexes cannot be used in the query is + // not covered by any of the other IndexUnusedReason options. + OTHER_REASON = 16; + } + + // Specifies the high-level reason for the scenario when no search index was + // used. + optional Code code = 1; + + // Free form human-readable reason for the scenario when no search index was + // used. + optional string message = 2; + + // Specifies the base table involved in the reason that no search index was + // used. + optional TableReference base_table = 3; + + // Specifies the name of the unused search index, if available. + optional string index_name = 4; +} + +// Statistics for index pruning. +message IndexPruningStats { + // The base table reference. + optional TableReference base_table = 1; + + // The index id. + optional string index_id = 4; + + // The number of parallel inputs before index pruning. + optional int64 pre_index_pruning_parallel_input_count = 2; + + // The number of parallel inputs after index pruning. + optional int64 post_index_pruning_parallel_input_count = 3; +} + +// Indicates the stored columns usage in the query. +message StoredColumnsUsage { + // If the stored column was not used, explain why. + message StoredColumnsUnusedReason { + // Indicates the high-level reason for the scenario when stored columns + // cannot be used in the query. + enum Code { + // Default value. + CODE_UNSPECIFIED = 0; + + // If stored columns do not fully cover the columns. + STORED_COLUMNS_COVER_INSUFFICIENT = 1; + + // If the base table has RLS (Row Level Security). + BASE_TABLE_HAS_RLS = 2; + + // If the base table has CLS (Column Level Security). + BASE_TABLE_HAS_CLS = 3; + + // If the provided prefilter is not supported. + UNSUPPORTED_PREFILTER = 4; + + // If an internal error is preventing stored columns from being used. + INTERNAL_ERROR = 5; + + // Indicates that the reason stored columns cannot be used in the query is + // not covered by any of the other StoredColumnsUnusedReason options. + OTHER_REASON = 6; + } + + // Specifies the high-level reason for the unused scenario, each reason must + // have a code associated. + optional Code code = 1; + + // Specifies the detailed description for the scenario. + optional string message = 2; + + // 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. + repeated string uncovered_columns = 3; + } + + // Specifies whether the query was accelerated with stored columns. + optional bool is_query_accelerated = 1; + + // Specifies the base table. + optional TableReference base_table = 2; + + // If stored columns were not used, explain why. + repeated StoredColumnsUnusedReason stored_columns_unused_reasons = 3; +} + +// Statistics for a search query. +// Populated as part of JobStatistics2. +message SearchStatistics { + // Indicates the type of search index usage in the entire search query. + enum IndexUsageMode { + // Index usage mode not specified. + INDEX_USAGE_MODE_UNSPECIFIED = 0; + + // No search indexes were used in the search query. See + // [`indexUnusedReasons`] + // (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) + // for detailed reasons. + UNUSED = 1; + + // 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. + PARTIALLY_USED = 2; + + // The entire search query used search indexes. + FULLY_USED = 4; + } + + // Specifies the index usage mode for the query. + IndexUsageMode index_usage_mode = 1; + + // 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. + repeated IndexUnusedReason index_unused_reasons = 2; + + // 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. + repeated IndexPruningStats index_pruning_stats = 3; +} + +// Statistics for a vector search query. +// Populated as part of JobStatistics2. +message VectorSearchStatistics { + // Indicates the type of vector index usage in the entire vector search query. + enum IndexUsageMode { + // Index usage mode not specified. + INDEX_USAGE_MODE_UNSPECIFIED = 0; + + // No vector indexes were used in the vector search query. See + // [`indexUnusedReasons`] + // (/bigquery/docs/reference/rest/v2/Job#IndexUnusedReason) + // for detailed reasons. + UNUSED = 1; + + // 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. + PARTIALLY_USED = 2; + + // The entire vector search query used vector indexes. + FULLY_USED = 4; + } + + // Specifies the index usage mode for the query. + IndexUsageMode index_usage_mode = 1; + + // 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. + repeated IndexUnusedReason index_unused_reasons = 2; + + // Specifies the usage of stored columns in the query when stored columns are + // used in the query. + repeated StoredColumnsUsage stored_columns_usages = 3; +} + +// Query optimization information for a QUERY job. +message QueryInfo { + // Output only. Information about query optimizations. + google.protobuf.Struct optimization_details = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a LOAD query. +message LoadQueryStatistics { + // Output only. Number of source files in a LOAD query. + google.protobuf.Int64Value input_files = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of bytes of source data in a LOAD query. + google.protobuf.Int64Value input_file_bytes = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of rows imported in a LOAD query. + // Note that while a LOAD query is in the running state, this value may + // change. + google.protobuf.Int64Value output_rows = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the loaded data in bytes. Note that while a LOAD query + // is in the running state, this value may change. + google.protobuf.Int64Value output_bytes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Int64Value bad_records = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics related to Incremental Query Results. Populated as part of +// JobStatistics2. This feature is not yet available. +message IncrementalResultStats { + // Reason why incremental query results are/were not written by the query. + enum DisabledReason { + // Disabled reason not specified. + DISABLED_REASON_UNSPECIFIED = 0; + + // Incremental results are/were disabled for reasons not covered by the + // other enum values, e.g. runtime issues. + OTHER = 1; + + // Query includes an operation that is not supported. + UNSUPPORTED_OPERATOR = 2; + } + + // Output only. Reason why incremental query results are/were not written by + // the query. + DisabledReason disabled_reason = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional human-readable clarification, if available, for + // DisabledReason. + string disabled_reason_details = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Timestamp result_set_last_replace_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Timestamp result_set_last_modify_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the first incremental result was written. If + // the query needed to restart internally, this only describes the final + // attempt. + google.protobuf.Timestamp first_incremental_row_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the last incremental result was written. + // Does not include the final result written after query completion. + google.protobuf.Timestamp last_incremental_row_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of rows that were in the latest result set before query + // completion. + optional int64 incremental_row_count = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a query job. +message JobStatistics2 { + // Output only. Describes execution plan for the query. + repeated ExplainQueryStage query_plan = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The original estimate of bytes processed for the job. + google.protobuf.Int64Value estimated_bytes_processed = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes a timeline of job execution. + repeated QueryTimelineSample timeline = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total number of partitions processed from all partitioned + // tables referenced in the job. + google.protobuf.Int64Value total_partitions_processed = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total bytes processed for the job. + google.protobuf.Int64Value total_bytes_processed = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For dry-run jobs, totalBytesProcessed is an estimate and this + // field specifies the accuracy of the estimate. Possible values can be: + // UNKNOWN: accuracy of the estimate is unknown. + // PRECISE: estimate is precise. + // LOWER_BOUND: estimate is lower bound of what the query would cost. + // UPPER_BOUND: estimate is upper bound of what the query would cost. + string total_bytes_processed_accuracy = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Int64Value total_bytes_billed = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Int32Value billing_tier = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Slot-milliseconds for the job. + google.protobuf.Int64Value total_slot_ms = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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"`. + optional int64 total_services_sku_slot_ms = 52 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the query result was fetched from the query cache. + google.protobuf.BoolValue cache_hit = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced tables for the job. + repeated TableReference referenced_tables = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced routines for the job. + repeated RoutineReference referenced_routines = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced property graphs for the job. Queries that reference + // more than 50 property graphs will not have a complete list. + repeated PropertyGraphReference referenced_property_graphs = 49 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The schema of the results. Present only for successful dry + // run of non-legacy SQL queries. + TableSchema schema = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of rows affected by a DML statement. Present + // only for DML statements INSERT, UPDATE or DELETE. + google.protobuf.Int64Value num_dml_affected_rows = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Detailed statistics for DML statements INSERT, UPDATE, DELETE, + // MERGE or TRUNCATE. + DmlStats dml_stats = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. GoogleSQL only: list of undeclared query + // parameters detected during a dry run validation. + repeated QueryParameter undeclared_query_parameters = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + string statement_type = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DDL operation performed, possibly + // dependent on the pre-existence of the DDL target. + string ddl_operation_performed = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DDL target table. Present only for + // CREATE/DROP TABLE/VIEW and DROP ALL ROW ACCESS POLICIES queries. + TableReference ddl_target_table = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The table after rename. Present only for ALTER TABLE RENAME TO + // query. + TableReference ddl_destination_table = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DDL target row access policy. Present only for + // CREATE/DROP ROW ACCESS POLICY queries. + RowAccessPolicyReference ddl_target_row_access_policy = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of row access policies affected by a DDL statement. + // Present only for DROP ALL ROW ACCESS POLICIES queries. + google.protobuf.Int64Value ddl_affected_row_access_policy_count = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Beta] The DDL target routine. Present only for + // CREATE/DROP FUNCTION/PROCEDURE queries. + RoutineReference ddl_target_routine = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The DDL target dataset. Present only for CREATE/ALTER/DROP + // SCHEMA(dataset) queries. + DatasetReference ddl_target_dataset = 30 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics of a BigQuery ML training job. + MlStatistics ml_statistics = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Stats for EXPORT DATA statement. + ExportDataStatistics export_data_statistics = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Job cost breakdown as bigquery internal cost and external + // service costs. + repeated ExternalServiceCost external_service_costs = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. BI Engine specific Statistics. + BiEngineStatistics bi_engine_statistics = 29 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for a LOAD query. + LoadQueryStatistics load_query_statistics = 33 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced table for DCL statement. + TableReference dcl_target_table = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced view for DCL statement. + TableReference dcl_target_view = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Referenced dataset for DCL statement. + DatasetReference dcl_target_dataset = 36 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Search query specific statistics. + SearchStatistics search_statistics = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Vector Search query specific statistics. + VectorSearchStatistics vector_search_statistics = 44 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Performance insights. + PerformanceInsights performance_insights = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Query optimization information for a QUERY job. + QueryInfo query_info = 39 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics of a Spark procedure job. + SparkStatistics spark_statistics = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total bytes transferred for cross-cloud queries such as Cross + // Cloud Transfer and CREATE TABLE AS SELECT (CTAS). + google.protobuf.Int64Value transferred_bytes = 41 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics of materialized views of a query job. + MaterializedViewStatistics materialized_view_statistics = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics of metadata cache usage in a query for BigLake + // tables. + MetadataCacheStatistics metadata_cache_statistics = 43 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics related to incremental query results, if enabled + // for the query. This feature is not yet available. + IncrementalResultStats incremental_result_stats = 53 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics related to GenAI usage in the query. + GenAiStats gen_ai_stats = 54 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a load job. +message JobStatistics3 { + // Output only. Number of source files in a load job. + google.protobuf.Int64Value input_files = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of bytes of source data in a load job. + google.protobuf.Int64Value input_file_bytes = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of rows imported in a load job. + // Note that while an import job is in the running state, this + // value may change. + google.protobuf.Int64Value output_rows = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the loaded data in bytes. Note + // that while a load job is in the running state, this value may change. + google.protobuf.Int64Value output_bytes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of bad records encountered. Note that if the job + // has failed because of more bad records encountered than the maximum + // allowed in the load job configuration, then this number can be less than + // the total number of bad records present in the input data. + google.protobuf.Int64Value bad_records = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes a timeline of job execution. + repeated QueryTimelineSample timeline = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for an extract job. +message JobStatistics4 { + // Output only. Number of files per destination URI or URI pattern + // specified in the extract configuration. These values will be in the same + // order as the URIs specified in the 'destinationUris' field. + repeated int64 destination_uri_file_counts = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Int64Value input_bytes = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes a timeline of job execution. + repeated QueryTimelineSample timeline = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a copy job. +message CopyJobStatistics { + // Output only. Number of rows copied to the destination table. + google.protobuf.Int64Value copied_rows = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of logical bytes copied to the destination table. + google.protobuf.Int64Value copied_logical_bytes = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Job statistics specific to a BigQuery ML training job. +message MlStatistics { + // Training type. + enum TrainingType { + // Unspecified training type. + TRAINING_TYPE_UNSPECIFIED = 0; + + // Single training with fixed parameter space. + SINGLE_TRAINING = 1; + + // [Hyperparameter tuning + // training](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview). + HPARAM_TUNING = 2; + } + + // Output only. 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. + int64 max_iterations = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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). + repeated Model.TrainingRun.IterationResult iteration_results = 2; + + // Output only. The type of the model that is being trained. + Model.ModelType model_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Training type of the job. + TrainingType training_type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + repeated Model.HparamTuningTrial hparam_trials = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Job statistics specific to the child job of a script. +message ScriptStatistics { + // Describes how the job is evaluated. + enum EvaluationKind { + // Default value. + EVALUATION_KIND_UNSPECIFIED = 0; + + // The statement appears directly in the script. + STATEMENT = 1; + + // The statement evaluates an expression that appears in the script. + EXPRESSION = 2; + } + + // 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. + message ScriptStackFrame { + // Output only. One-based start line. + int32 start_line = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. One-based start column. + int32 start_column = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. One-based end line. + int32 end_line = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. One-based end column. + int32 end_column = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the active procedure, empty if in a top-level + // script. + string procedure_id = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Text of the current statement/expression. + string text = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Whether this child job was a statement or expression. + EvaluationKind evaluation_kind = 1; + + // 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. + repeated ScriptStackFrame stack_frames = 2; +} + +// Statistics for row-level security. +message RowLevelSecurityStatistics { + // Whether any accessed data was protected by row access policies. + bool row_level_security_applied = 1; +} + +// Statistics for data-masking. +message DataMaskingStatistics { + // Whether any accessed data was protected by the data masking. + bool data_masking_applied = 1; +} + +// Statistics for a single job execution. +message JobStatistics { + // [Alpha] Information of a multi-statement transaction. + message TransactionInfo { + // Output only. [Alpha] Id of the transaction. + string transaction_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Creation time of this job, in milliseconds since the epoch. + // This field will be present on all jobs. + int64 creation_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Start time of this job, in milliseconds since the epoch. + // This field will be present when the job transitions from the PENDING state + // to either RUNNING or DONE. + int64 start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. End time of this job, in milliseconds since the epoch. This + // field will be present whenever a job is in the DONE state. + int64 end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total bytes processed for the job. + google.protobuf.Int64Value total_bytes_processed = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [TrustedTester] Job progress (0.0 -> 1.0) for LOAD and + // EXTRACT jobs. + google.protobuf.DoubleValue completion_ratio = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Quotas which delayed this job's start time. + repeated string quota_deferments = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for a query job. + JobStatistics2 query = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for a load job. + JobStatistics3 load = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for an extract job. + JobStatistics4 extract = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for a copy job. + CopyJobStatistics copy = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Slot-milliseconds for the job. + google.protobuf.Int64Value total_slot_ms = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the primary reservation assigned to this job. Note + // that this could be different than reservations reported in the reservation + // usage field if parent reservations were used to execute this job. + string reservation_id = 15 + [json_name = "reservation_id", (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of child jobs executed. + int64 num_child_jobs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this is a child job, specifies the job ID of the parent. + string parent_job_id = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If this a child job of a script, specifies information about + // the context of this job within the script. + ScriptStatistics script_statistics = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for row-level security. Present only for query and + // extract jobs. + RowLevelSecurityStatistics row_level_security_statistics = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for data-masking. Present only for query and + // extract jobs. + DataMaskingStatistics data_masking_statistics = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [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. + TransactionInfo transaction_info = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information of the session if this job is part of one. + SessionInfo session_info = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The duration in milliseconds of the execution of the final + // attempt of this job, as BigQuery may internally re-attempt to execute the + // job. + int64 final_execution_duration_ms = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of edition corresponding to the reservation for this job + // at the time of this update. + ReservationEdition edition = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + repeated string reservation_group_path = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Detailed statistics for DML statements +message DmlStats { + // Enum to specify the DML mode used. + enum DmlMode { + // Default value. This value is unused. + DML_MODE_UNSPECIFIED = 0; + + // Coarse-grained DML was used. + COARSE_GRAINED_DML = 1; + + // Fine-grained DML was used. + FINE_GRAINED_DML = 2; + } + + // Reason for disabling fine-grained DML. Additional values may be added in + // the future. + enum FineGrainedDmlUnusedReason { + // Default value. This value is unused. + FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED = 0; + + // Max partition size threshold exceeded. [Fine-grained DML Limitations] + // (https://docs.cloud.google.com/bigquery/docs/data-manipulation-language#fine-grained-dml-limitations) + MAX_PARTITION_SIZE_EXCEEDED = 1; + + // The table is not enrolled for fine-grained DML. + TABLE_NOT_ENROLLED = 2; + + // The DML statement is part of a multi-statement transaction. + DML_IN_MULTI_STATEMENT_TRANSACTION = 3; + } + + // Output only. Number of inserted Rows. Populated by DML INSERT and MERGE + // statements + google.protobuf.Int64Value inserted_row_count = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of deleted Rows. populated by DML DELETE, MERGE and + // TRUNCATE statements. + google.protobuf.Int64Value deleted_row_count = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of updated Rows. Populated by DML UPDATE and MERGE + // statements. + google.protobuf.Int64Value updated_row_count = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DML mode used. + DmlMode dml_mode = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reason for disabling fine-grained DML if applicable. + FineGrainedDmlUnusedReason fine_grained_dml_unused_reason = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Performance insights for the job. +message PerformanceInsights { + // Output only. 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. + int64 avg_previous_execution_ms = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Standalone query stage performance insights, for exploring + // potential improvements. + repeated StagePerformanceStandaloneInsight + stage_performance_standalone_insights = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Query stage performance insights compared to previous runs, + // for diagnosing performance regression. + repeated StagePerformanceChangeInsight stage_performance_change_insights = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Performance insights for table-level attributes that changed + // compared to previous runs. + repeated TableChangeInsight table_change_insights = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Performance insights compared to the previous executions for a specific +// stage. +message StagePerformanceChangeInsight { + // Output only. The stage id that the insight mapped to. + int64 stage_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Input data change insight of the query stage. + optional InputDataChange input_data_change = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details about the input data change insight. +message InputDataChange { + // Output only. Records read difference percentage compared to a previous run. + float records_read_diff_percentage = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Standalone performance insights for a specific stage. +message StagePerformanceStandaloneInsight { + // Output only. The stage id that the insight mapped to. + int64 stage_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if the stage has a slot contention issue. + optional bool slot_contention = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if the stage has insufficient shuffle quota. + optional bool insufficient_shuffle_quota = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the stage had the following reasons for being + // disqualified from BI Engine execution. + repeated BiEngineReason bi_engine_reasons = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. High cardinality joins in the stage. + repeated HighCardinalityJoin high_cardinality_joins = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Partition skew in the stage. + optional PartitionSkew partition_skew = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// High cardinality join detailed information. +message HighCardinalityJoin { + // Output only. Count of left input rows. + int64 left_rows = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Count of right input rows. + int64 right_rows = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Count of the output rows. + int64 output_rows = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The index of the join operator in the ExplainQueryStep lists. + int32 step_index = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Partition skew detailed information. +message PartitionSkew { + // Details about source stages which produce skewed data. + message SkewSource { + // Output only. Stage id of the skew source stage. + int64 stage_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Source stages which produce skewed data. + repeated SkewSource skew_sources = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Table-level performance insights compared to previous runs. These insights +// don't apply to specific query stages, rather they apply to the whole table. +message TableChangeInsight { + // Output only. The table that was queried. + TableReference table_reference = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, indicates that the table's metadata column index + // staleness has increased significantly compared to previous jobs with the + // same query hash. + optional MetadataCacheStalenessInsight metadata_cache_staleness_insight = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if the table's column metadata index was not used in the + // current job, but was used in a previous job with the same query hash. + optional bool metadata_cache_not_used_but_used_previously = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Column Metadata Index staleness detailed infnormation. +message MetadataCacheStalenessInsight { + // Output only. Average column metadata index staleness of previous runs with + // the same query hash. + google.protobuf.Duration avg_previous_staleness_ms = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The percent increase in staleness between the current job and + // the average staleness of previous jobs with the same query hash. + double staleness_percentage_increase = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Statistics for a BigSpark query. +// Populated as part of JobStatistics2 +message SparkStatistics { + // Spark job logs can be filtered by these fields in Cloud Logging. + message LoggingInfo { + // Output only. Resource type used for logging. + string resource_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Project ID where the Spark logs were written. + string project_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Spark job ID if a Spark job is created successfully. + optional string spark_job_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Location where the Spark job is executed. + // A location is selected by BigQueury for jobs configured to run in a + // multi-region. + optional string spark_job_location = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Endpoints returned from Dataproc. + // Key list: + // - history_server_endpoint: A link to Spark job UI. + map endpoints = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Logging info is used to generate a link to Cloud Logging. + optional LoggingInfo logging_info = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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]` + optional string kms_key_name = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. 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]` + optional string gcs_staging_bucket = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "storage.googleapis.com/Bucket" } + ]; +} + +// Statistics of materialized views considered in a query job. +message 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. + repeated MaterializedView materialized_view = 1; +} + +// A materialized view considered for a query job. +message MaterializedView { + // Reason why a materialized view was not chosen for a query. For more + // information, see [Understand why materialized views were + // rejected](https://cloud.google.com/bigquery/docs/materialized-views-use#understand-rejected). + enum RejectedReason { + // Default unspecified value. + REJECTED_REASON_UNSPECIFIED = 0; + + // View has no cached data because it has not refreshed yet. + NO_DATA = 1; + + // 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. + COST = 2; + + // View has no cached data because a base table is truncated. + BASE_TABLE_TRUNCATED = 3; + + // 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_DATA_CHANGE = 4; + + // View is invalidated because a base table's partition expiration has + // changed. + BASE_TABLE_PARTITION_EXPIRATION_CHANGE = 5; + + // View is invalidated because a base table's partition has expired. + BASE_TABLE_EXPIRED_PARTITION = 6; + + // View is invalidated because a base table has an incompatible metadata + // change. + BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE = 7; + + // View is invalidated because it was refreshed with a time zone other than + // that of the current job. + TIME_ZONE = 8; + + // View is outside the time travel window. + OUT_OF_TIME_TRAVEL_WINDOW = 9; + + // View is inaccessible to the user because of a fine-grained security + // policy on one of its base tables. + BASE_TABLE_FINE_GRAINED_SECURITY_POLICY = 10; + + // One of the view's base tables is too stale. For example, the cached + // metadata of a BigLake external table needs to be updated. + BASE_TABLE_TOO_STALE = 11; + } + + // The candidate materialized view. + optional TableReference table_reference = 1; + + // 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. + optional bool chosen = 2; + + // If present, specifies a best-effort estimation of the bytes saved by using + // the materialized view rather than its base tables. + optional int64 estimated_bytes_saved = 3; + + // If present, specifies the reason why the materialized view was not chosen + // for the query. + optional RejectedReason rejected_reason = 4; +} + +// The column metadata index pruning statistics. +message PruningStats { + // The number of partitions matched. + optional int64 post_cmeta_pruning_partition_count = 1; + + // The number of parallel inputs scanned. + optional int64 pre_cmeta_pruning_parallel_input_count = 2; + + // The number of parallel inputs matched. + optional int64 post_cmeta_pruning_parallel_input_count = 3; +} + +// Table level detail on the usage of metadata caching. Only set for Metadata +// caching eligible tables referenced in the query. +message TableMetadataCacheUsage { + // Reasons for not using metadata caching. + enum UnusedReason { + // Unused reasons not specified. + UNUSED_REASON_UNSPECIFIED = 0; + + // Metadata cache was outside the table's maxStaleness. + EXCEEDED_MAX_STALENESS = 1; + + // Metadata caching feature is not enabled. [Update BigLake tables] + // (/bigquery/docs/create-cloud-storage-table-biglake#update-biglake-tables) + // to enable the metadata caching. + METADATA_CACHING_NOT_ENABLED = 3; + + // Other unknown reason. + OTHER_REASON = 2; + } + + // Metadata caching eligible table referenced in the query. + optional TableReference table_reference = 1; + + // Reason for not using metadata caching for the table. + optional UnusedReason unused_reason = 2; + + // Free form human-readable reason metadata caching was unused for + // the job. + optional string explanation = 3; + + // Duration since last refresh as of this job for managed tables (indicates + // metadata cache staleness as seen by this job). + google.protobuf.Duration staleness = 5; + + // [Table + // type](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#Table.FIELDS.type). + string table_type = 6; + + // The column metadata index pruning statistics. + optional PruningStats pruning_stats = 7; +} + +// Statistics for metadata caching in queried tables. +message MetadataCacheStatistics { + // Set for the Metadata caching eligible tables referenced in the query. + repeated TableMetadataCacheUsage table_metadata_cache_usage = 1; +} + +// The type of editions. +// Different features and behaviors are provided to different editions +// Capacity commitments and reservations are linked to editions. +enum ReservationEdition { + // Default value, which will be treated as ENTERPRISE. + RESERVATION_EDITION_UNSPECIFIED = 0; + + // Standard edition. + STANDARD = 1; + + // Enterprise edition. + ENTERPRISE = 2; + + // Enterprise Plus edition. + ENTERPRISE_PLUS = 3; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_status.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_status.proto new file mode 100644 index 000000000000..d83a3735c03c --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/job_status.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/error.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "JobStatusProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +message JobStatus { + // Output only. Final error result of the job. If present, indicates that the + // job has completed and was unsuccessful. + ErrorProto error_result = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The first errors encountered during the running of the job. + // The final message includes the number of errors that caused the process to + // stop. Errors here do not necessarily mean that the job has not completed or + // was unsuccessful. + repeated ErrorProto errors = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Running state of the job. Valid states include 'PENDING', + // 'RUNNING', and 'DONE'. + string state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/json_extension.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/json_extension.proto new file mode 100644 index 000000000000..d3857cc557fe --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/json_extension.proto @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "JsonExtensionProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Used to indicate that a JSON variant, rather than normal JSON, is being used +// as the source_format. This should only be used in combination with the +// JSON source format. +enum JsonExtension { + // 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. + JSON_EXTENSION_UNSPECIFIED = 0; + + // Use GeoJSON variant of JSON. See https://tools.ietf.org/html/rfc7946. + GEOJSON = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/location_metadata.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/location_metadata.proto new file mode 100644 index 000000000000..55fcf2ebbae7 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/location_metadata.proto @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "LocationMetadataProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// BigQuery-specific metadata about a location. This will be set on +// google.cloud.location.Location.metadata in Cloud Location API +// responses. +message LocationMetadata { + // The legacy BigQuery location ID, e.g. “EU” for the “europe” location. + // This is for any API consumers that need the legacy “US” and “EU” locations. + string legacy_location_id = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/managed_table_type.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/managed_table_type.proto new file mode 100644 index 000000000000..16aa4483fd38 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/managed_table_type.proto @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "ManagedTableTypeProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// The classification of managed table types that can be created. +enum ManagedTableType { + // No managed table type specified. + MANAGED_TABLE_TYPE_UNSPECIFIED = 0; + + // The managed table is a native BigQuery table. + NATIVE = 1; + + // The managed table is a BigLake table for Apache Iceberg in BigQuery. + BIGLAKE = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/map_target_type.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/map_target_type.proto new file mode 100644 index 000000000000..3e63fd643865 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/map_target_type.proto @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "MapTargetTypeProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Indicates the map target type. Only applies to parquet maps. +enum MapTargetType { + // In this mode, the map will have the following schema: + // struct map_field_name { repeated struct key_value { key value } }. + MAP_TARGET_TYPE_UNSPECIFIED = 0; + + // In this mode, the map will have the following schema: + // repeated struct map_field_name { key value }. + ARRAY_OF_STRUCT = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model.proto new file mode 100644 index 000000000000..fd7519457835 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model.proto @@ -0,0 +1,2128 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/encryption_config.proto"; +import "google/cloud/bigquery/v2/model_reference.proto"; +import "google/cloud/bigquery/v2/standard_sql.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "ModelProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Model Service for BigQuery ML +service ModelService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Gets the specified model resource by model ID. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}" + }; + option (google.api.method_signature) = "project_id,dataset_id,model_id"; + } + + // 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. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models" + }; + option (google.api.method_signature) = "project_id,dataset_id,max_results"; + } + + // Patch specific fields in the specified model. + rpc PatchModel(PatchModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}" + body: "model" + }; + option (google.api.method_signature) = + "project_id,dataset_id,model_id,model"; + } + + // Deletes the model specified by modelId from the dataset. + rpc DeleteModel(DeleteModelRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}" + }; + option (google.api.method_signature) = "project_id,dataset_id,model_id"; + } +} + +// Remote Model Info +message RemoteModelInfo { + // Supported service type for remote model. + enum RemoteServiceType { + // Unspecified remote service type. + REMOTE_SERVICE_TYPE_UNSPECIFIED = 0; + + // V3 Cloud AI Translation API. See more details at [Cloud Translation API] + // (https://cloud.google.com/translate/docs/reference/rest). + CLOUD_AI_TRANSLATE_V3 = 1; + + // V1 Cloud AI Vision API See more details at [Cloud Vision API] + // (https://cloud.google.com/vision/docs/reference/rest). + CLOUD_AI_VISION_V1 = 2; + + // 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_NATURAL_LANGUAGE_V1 = 3; + + // 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) + CLOUD_AI_SPEECH_TO_TEXT_V2 = 7; + } + + // Remote services are services outside of BigQuery used by remote models for + // predictions. A remote service is backed by either an arbitrary endpoint or + // a selected remote service type, but not both. + oneof remote_service { + // Output only. The endpoint for remote model. + string endpoint = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The remote service type for remote model. + RemoteServiceType remote_service_type = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Fully qualified name of the user-provided connection object of + // the remote model. Format: + // ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"``` + string connection = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Max number of rows in each batch sent to the remote service. + // If unset, the number of rows in each batch is set dynamically. + int64 max_batching_rows = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model version for LLM. + string remote_model_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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) + string speech_recognizer = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about a single transform column. +message TransformColumn { + // Output only. Name of the column. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Data type of the column after the transform. + StandardSqlDataType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The SQL expression used in the column transform. + string transform_sql = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message Model { + // Indicates the type of the Model. + enum ModelType { + // Default value. + MODEL_TYPE_UNSPECIFIED = 0; + + // Linear regression model. + LINEAR_REGRESSION = 1; + + // Logistic regression based classification model. + LOGISTIC_REGRESSION = 2; + + // K-means clustering model. + KMEANS = 3; + + // Matrix factorization model. + MATRIX_FACTORIZATION = 4; + + // DNN classifier model. + DNN_CLASSIFIER = 5; + + // An imported TensorFlow model. + TENSORFLOW = 6; + + // DNN regressor model. + DNN_REGRESSOR = 7; + + // An imported XGBoost model. + XGBOOST = 8; + + // Boosted tree regressor model. + BOOSTED_TREE_REGRESSOR = 9; + + // Boosted tree classifier model. + BOOSTED_TREE_CLASSIFIER = 10; + + // ARIMA model. + ARIMA = 11; + + // AutoML Tables regression model. + AUTOML_REGRESSOR = 12; + + // AutoML Tables classification model. + AUTOML_CLASSIFIER = 13; + + // Prinpical Component Analysis model. + PCA = 14; + + // Wide-and-deep classifier model. + DNN_LINEAR_COMBINED_CLASSIFIER = 16; + + // Wide-and-deep regressor model. + DNN_LINEAR_COMBINED_REGRESSOR = 17; + + // Autoencoder model. + AUTOENCODER = 18; + + // New name for the ARIMA model. + ARIMA_PLUS = 19; + + // ARIMA with external regressors. + ARIMA_PLUS_XREG = 23; + + // Random forest regressor model. + RANDOM_FOREST_REGRESSOR = 24; + + // Random forest classifier model. + RANDOM_FOREST_CLASSIFIER = 25; + + // An imported TensorFlow Lite model. + TENSORFLOW_LITE = 26; + + // An imported ONNX model. + ONNX = 28; + + // Model to capture the columns and logic in the TRANSFORM clause along with + // statistics useful for ML analytic functions. + TRANSFORM_ONLY = 29; + + // The contribution analysis model. + CONTRIBUTION_ANALYSIS = 37; + } + + // Loss metric to evaluate model training performance. + enum LossType { + // Default value. + LOSS_TYPE_UNSPECIFIED = 0; + + // Mean squared loss, used for linear regression. + MEAN_SQUARED_LOSS = 1; + + // Mean log loss, used for logistic regression. + MEAN_LOG_LOSS = 2; + } + + // Distance metric used to compute the distance between two points. + enum DistanceType { + // Default value. + DISTANCE_TYPE_UNSPECIFIED = 0; + + // Eculidean distance. + EUCLIDEAN = 1; + + // Cosine distance. + COSINE = 2; + } + + // Indicates the method to split input data into multiple tables. + enum DataSplitMethod { + // Default value. + DATA_SPLIT_METHOD_UNSPECIFIED = 0; + + // Splits data randomly. + RANDOM = 1; + + // Splits data with the user provided tags. + CUSTOM = 2; + + // Splits data sequentially. + SEQUENTIAL = 3; + + // Data split will be skipped. + NO_SPLIT = 4; + + // Splits data automatically: Uses NO_SPLIT if the data size is small. + // Otherwise uses RANDOM. + AUTO_SPLIT = 5; + } + + // Type of supported data frequency for time series forecasting models. + enum DataFrequency { + // Default value. + DATA_FREQUENCY_UNSPECIFIED = 0; + + // Automatically inferred from timestamps. + AUTO_FREQUENCY = 1; + + // Yearly data. + YEARLY = 2; + + // Quarterly data. + QUARTERLY = 3; + + // Monthly data. + MONTHLY = 4; + + // Weekly data. + WEEKLY = 5; + + // Daily data. + DAILY = 6; + + // Hourly data. + HOURLY = 7; + + // Per-minute data. + PER_MINUTE = 8; + } + + // Type of supported holiday regions for time series forecasting models. + enum HolidayRegion { + // Holiday region unspecified. + HOLIDAY_REGION_UNSPECIFIED = 0; + + // Global. + GLOBAL = 1; + + // North America. + NA = 2; + + // Japan and Asia Pacific: Korea, Greater China, India, Australia, and New + // Zealand. + JAPAC = 3; + + // Europe, the Middle East and Africa. + EMEA = 4; + + // Latin America and the Caribbean. + LAC = 5; + + // United Arab Emirates + AE = 6; + + // Argentina + AR = 7; + + // Austria + AT = 8; + + // Australia + AU = 9; + + // Belgium + BE = 10; + + // Brazil + BR = 11; + + // Canada + CA = 12; + + // Switzerland + CH = 13; + + // Chile + CL = 14; + + // China + CN = 15; + + // Colombia + CO = 16; + + // Czechoslovakia + CS = 17; + + // Czech Republic + CZ = 18; + + // Germany + DE = 19; + + // Denmark + DK = 20; + + // Algeria + DZ = 21; + + // Ecuador + EC = 22; + + // Estonia + EE = 23; + + // Egypt + EG = 24; + + // Spain + ES = 25; + + // Finland + FI = 26; + + // France + FR = 27; + + // Great Britain (United Kingdom) + GB = 28; + + // Greece + GR = 29; + + // Hong Kong + HK = 30; + + // Hungary + HU = 31; + + // Indonesia + ID = 32; + + // Ireland + IE = 33; + + // Israel + IL = 34; + + // India + IN = 35; + + // Iran + IR = 36; + + // Italy + IT = 37; + + // Japan + JP = 38; + + // Korea (South) + KR = 39; + + // Latvia + LV = 40; + + // Morocco + MA = 41; + + // Mexico + MX = 42; + + // Malaysia + MY = 43; + + // Nigeria + NG = 44; + + // Netherlands + NL = 45; + + // Norway + NO = 46; + + // New Zealand + NZ = 47; + + // Peru + PE = 48; + + // Philippines + PH = 49; + + // Pakistan + PK = 50; + + // Poland + PL = 51; + + // Portugal + PT = 52; + + // Romania + RO = 53; + + // Serbia + RS = 54; + + // Russian Federation + RU = 55; + + // Saudi Arabia + SA = 56; + + // Sweden + SE = 57; + + // Singapore + SG = 58; + + // Slovenia + SI = 59; + + // Slovakia + SK = 60; + + // Thailand + TH = 61; + + // Turkey + TR = 62; + + // Taiwan + TW = 63; + + // Ukraine + UA = 64; + + // United States + US = 65; + + // Venezuela + VE = 66; + + // Vietnam + VN = 67; + + // South Africa + ZA = 68; + } + + // Enums for seasonal period. + message SeasonalPeriod { + // Seasonal period type. + enum SeasonalPeriodType { + // Unspecified seasonal period. + SEASONAL_PERIOD_TYPE_UNSPECIFIED = 0; + + // No seasonality + NO_SEASONALITY = 1; + + // Daily period, 24 hours. + DAILY = 2; + + // Weekly period, 7 days. + WEEKLY = 3; + + // Monthly period, 30 days or irregular. + MONTHLY = 4; + + // Quarterly period, 90 days or irregular. + QUARTERLY = 5; + + // Yearly period, 365 days or irregular. + YEARLY = 6; + + // Hourly period, 1 hour. + HOURLY = 7; + } + } + + // Enums for color space, used for processing images in Object Table. + // See more details at + // https://www.tensorflow.org/io/tutorials/colorspace. + enum ColorSpace { + // Unspecified color space + COLOR_SPACE_UNSPECIFIED = 0; + + // RGB + RGB = 1; + + // HSV + HSV = 2; + + // YIQ + YIQ = 3; + + // YUV + YUV = 4; + + // GRAYSCALE + GRAYSCALE = 5; + } + + // Enums for kmeans model type. + message KmeansEnums { + // Indicates the method used to initialize the centroids for KMeans + // clustering algorithm. + enum KmeansInitializationMethod { + // Unspecified initialization method. + KMEANS_INITIALIZATION_METHOD_UNSPECIFIED = 0; + + // Initializes the centroids randomly. + RANDOM = 1; + + // Initializes the centroids using data specified in + // kmeans_initialization_column. + CUSTOM = 2; + + // Initializes with kmeans++. + KMEANS_PLUS_PLUS = 3; + } + } + + // Enums for XGBoost model type. + message BoostedTreeOptionEnums { + // Booster types supported. Refer to booster parameter in XGBoost. + enum BoosterType { + // Unspecified booster type. + BOOSTER_TYPE_UNSPECIFIED = 0; + + // Gbtree booster. + GBTREE = 1; + + // Dart booster. + DART = 2; + } + + // Type of normalization algorithm for boosted tree models using dart + // booster. Refer to normalize_type in XGBoost. + enum DartNormalizeType { + // Unspecified dart normalize type. + DART_NORMALIZE_TYPE_UNSPECIFIED = 0; + + // New trees have the same weight of each of dropped trees. + TREE = 1; + + // New trees have the same weight of sum of dropped trees. + FOREST = 2; + } + + // Tree construction algorithm used in boosted tree models. + // Refer to tree_method in XGBoost. + enum TreeMethod { + // Unspecified tree method. + TREE_METHOD_UNSPECIFIED = 0; + + // Use heuristic to choose the fastest method. + AUTO = 1; + + // Exact greedy algorithm. + EXACT = 2; + + // Approximate greedy algorithm using quantile sketch and gradient + // histogram. + APPROX = 3; + + // Fast histogram optimized approximate greedy algorithm. + HIST = 4; + } + } + + // Enums for hyperparameter tuning. + message HparamTuningEnums { + // Available evaluation metrics used as hyperparameter tuning objectives. + enum HparamTuningObjective { + // Unspecified evaluation metric. + HPARAM_TUNING_OBJECTIVE_UNSPECIFIED = 0; + + // Mean absolute error. + // mean_absolute_error = AVG(ABS(label - predicted)) + MEAN_ABSOLUTE_ERROR = 1; + + // Mean squared error. + // mean_squared_error = AVG(POW(label - predicted, 2)) + MEAN_SQUARED_ERROR = 2; + + // Mean squared log error. + // mean_squared_log_error = AVG(POW(LN(1 + label) - LN(1 + predicted), 2)) + MEAN_SQUARED_LOG_ERROR = 3; + + // Mean absolute error. + // median_absolute_error = APPROX_QUANTILES(absolute_error, 2)[OFFSET(1)] + MEDIAN_ABSOLUTE_ERROR = 4; + + // R^2 score. This corresponds to r2_score in ML.EVALUATE. + // r_squared = 1 - SUM(squared_error)/(COUNT(label)*VAR_POP(label)) + R_SQUARED = 5; + + // Explained variance. + // explained_variance = 1 - VAR_POP(label_error)/VAR_POP(label) + EXPLAINED_VARIANCE = 6; + + // 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. + PRECISION = 7; + + // Recall is the fraction of actual positive labels that were given a + // positive prediction. For multiclass this is a macro-averaged metric. + RECALL = 8; + + // Accuracy is the fraction of predictions given the correct label. For + // multiclass this is a globally micro-averaged metric. + ACCURACY = 9; + + // The F1 score is an average of recall and precision. For multiclass this + // is a macro-averaged metric. + F1_SCORE = 10; + + // Logarithmic Loss. For multiclass this is a macro-averaged metric. + LOG_LOSS = 11; + + // Area Under an ROC Curve. For multiclass this is a macro-averaged + // metric. + ROC_AUC = 12; + + // Davies-Bouldin Index. + DAVIES_BOULDIN_INDEX = 13; + + // Mean Average Precision. + MEAN_AVERAGE_PRECISION = 14; + + // Normalized Discounted Cumulative Gain. + NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = 15; + + // Average Rank. + AVERAGE_RANK = 16; + } + } + + // Indicates the learning rate optimization strategy to use. + enum LearnRateStrategy { + // Default value. + LEARN_RATE_STRATEGY_UNSPECIFIED = 0; + + // Use line search to determine learning rate. + LINE_SEARCH = 1; + + // Use a constant learning rate. + CONSTANT = 2; + } + + // Indicates the optimization strategy used for training. + enum OptimizationStrategy { + // Default value. + OPTIMIZATION_STRATEGY_UNSPECIFIED = 0; + + // Uses an iterative batch gradient descent algorithm. + BATCH_GRADIENT_DESCENT = 1; + + // Uses a normal equation to solve linear regression problem. + NORMAL_EQUATION = 2; + } + + // Indicates the training algorithm to use for matrix factorization models. + enum FeedbackType { + // Default value. + FEEDBACK_TYPE_UNSPECIFIED = 0; + + // Use weighted-als for implicit feedback problems. + IMPLICIT = 1; + + // Use nonweighted-als for explicit feedback problems. + EXPLICIT = 2; + } + + // Evaluation metrics for regression and explicit feedback type matrix + // factorization models. + message RegressionMetrics { + // Mean absolute error. + google.protobuf.DoubleValue mean_absolute_error = 1; + + // Mean squared error. + google.protobuf.DoubleValue mean_squared_error = 2; + + // Mean squared log error. + google.protobuf.DoubleValue mean_squared_log_error = 3; + + // Median absolute error. + google.protobuf.DoubleValue median_absolute_error = 4; + + // R^2 score. This corresponds to r2_score in ML.EVALUATE. + google.protobuf.DoubleValue r_squared = 5; + } + + // 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. + message AggregateClassificationMetrics { + // 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. + google.protobuf.DoubleValue precision = 1; + + // Recall is the fraction of actual positive labels that were given a + // positive prediction. For multiclass this is a macro-averaged metric. + google.protobuf.DoubleValue recall = 2; + + // Accuracy is the fraction of predictions given the correct label. For + // multiclass this is a micro-averaged metric. + google.protobuf.DoubleValue accuracy = 3; + + // 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. + google.protobuf.DoubleValue threshold = 4; + + // The F1 score is an average of recall and precision. For multiclass + // this is a macro-averaged metric. + google.protobuf.DoubleValue f1_score = 5; + + // Logarithmic Loss. For multiclass this is a macro-averaged metric. + google.protobuf.DoubleValue log_loss = 6; + + // Area Under a ROC Curve. For multiclass this is a macro-averaged + // metric. + google.protobuf.DoubleValue roc_auc = 7; + } + + // Evaluation metrics for binary classification/classifier models. + message BinaryClassificationMetrics { + // Confusion matrix for binary classification models. + message BinaryConfusionMatrix { + // Threshold value used when computing each of the following metric. + google.protobuf.DoubleValue positive_class_threshold = 1; + + // Number of true samples predicted as true. + google.protobuf.Int64Value true_positives = 2; + + // Number of false samples predicted as true. + google.protobuf.Int64Value false_positives = 3; + + // Number of true samples predicted as false. + google.protobuf.Int64Value true_negatives = 4; + + // Number of false samples predicted as false. + google.protobuf.Int64Value false_negatives = 5; + + // The fraction of actual positive predictions that had positive actual + // labels. + google.protobuf.DoubleValue precision = 6; + + // The fraction of actual positive labels that were given a positive + // prediction. + google.protobuf.DoubleValue recall = 7; + + // The equally weighted average of recall and precision. + google.protobuf.DoubleValue f1_score = 8; + + // The fraction of predictions given the correct label. + google.protobuf.DoubleValue accuracy = 9; + } + + // Aggregate classification metrics. + AggregateClassificationMetrics aggregate_classification_metrics = 1; + + // Binary confusion matrix at multiple thresholds. + repeated BinaryConfusionMatrix binary_confusion_matrix_list = 2; + + // Label representing the positive class. + string positive_label = 3; + + // Label representing the negative class. + string negative_label = 4; + } + + // Evaluation metrics for multi-class classification/classifier models. + message MultiClassClassificationMetrics { + // Confusion matrix for multi-class classification models. + message ConfusionMatrix { + // A single entry in the confusion matrix. + message Entry { + // The predicted label. For confidence_threshold > 0, we will + // also add an entry indicating the number of items under the + // confidence threshold. + string predicted_label = 1; + + // Number of items being predicted as this label. + google.protobuf.Int64Value item_count = 2; + } + + // A single row in the confusion matrix. + message Row { + // The original label of this row. + string actual_label = 1; + + // Info describing predicted label distribution. + repeated Entry entries = 2; + } + + // Confidence threshold used when computing the entries of the + // confusion matrix. + google.protobuf.DoubleValue confidence_threshold = 1; + + // One row per actual label. + repeated Row rows = 2; + } + + // Aggregate classification metrics. + AggregateClassificationMetrics aggregate_classification_metrics = 1; + + // Confusion matrix at different thresholds. + repeated ConfusionMatrix confusion_matrix_list = 2; + } + + // Evaluation metrics for clustering models. + message ClusteringMetrics { + // Message containing the information about one cluster. + message Cluster { + // Representative value of a single feature within the cluster. + message FeatureValue { + // Representative value of a categorical feature. + message CategoricalValue { + // Represents the count of a single category within the cluster. + message CategoryCount { + // The name of category. + string category = 1; + + // The count of training samples matching the category within the + // cluster. + google.protobuf.Int64Value count = 2; + } + + // 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. + repeated CategoryCount category_counts = 1; + } + + // The feature column name. + string feature_column = 1; + + // Value. + oneof value { + // The numerical feature value. This is the centroid value for this + // feature. + google.protobuf.DoubleValue numerical_value = 2; + + // The categorical feature value. + CategoricalValue categorical_value = 3; + } + } + + // Centroid id. + int64 centroid_id = 1; + + // Values of highly variant features for this cluster. + repeated FeatureValue feature_values = 2; + + // Count of training data rows that were assigned to this cluster. + google.protobuf.Int64Value count = 3; + } + + // Davies-Bouldin index. + google.protobuf.DoubleValue davies_bouldin_index = 1; + + // Mean of squared distances between each sample to its cluster centroid. + google.protobuf.DoubleValue mean_squared_distance = 2; + + // Information for all clusters. + repeated Cluster clusters = 3; + } + + // Evaluation metrics used by weighted-ALS models specified by + // feedback_type=implicit. + message RankingMetrics { + // Calculates a precision per user for all the items by ranking them and + // then averages all the precisions across all the users. + google.protobuf.DoubleValue mean_average_precision = 1; + + // 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. + google.protobuf.DoubleValue mean_squared_error = 2; + + // 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. + google.protobuf.DoubleValue normalized_discounted_cumulative_gain = 3; + + // Determines the goodness of a ranking by computing the percentile rank + // from the predicted confidence and dividing it by the original rank. + google.protobuf.DoubleValue average_rank = 4; + } + + // Model evaluation metrics for ARIMA forecasting models. + message ArimaForecastingMetrics { + // Model evaluation metrics for a single ARIMA forecasting model. + message ArimaSingleModelForecastingMetrics { + // Non-seasonal order. + ArimaOrder non_seasonal_order = 1; + + // Arima fitting metrics. + ArimaFittingMetrics arima_fitting_metrics = 2; + + // Is arima model fitted with drift or not. It is always false when d + // is not 1. + google.protobuf.BoolValue has_drift = 3; + + // 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. + string time_series_id = 4; + + // 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. + repeated string time_series_ids = 9; + + // Seasonal periods. Repeated because multiple periods are supported + // for one time series. + repeated SeasonalPeriod.SeasonalPeriodType seasonal_periods = 5; + + // If true, holiday_effect is a part of time series decomposition result. + google.protobuf.BoolValue has_holiday_effect = 6; + + // If true, spikes_and_dips is a part of time series decomposition result. + google.protobuf.BoolValue has_spikes_and_dips = 7; + + // If true, step_changes is a part of time series decomposition result. + google.protobuf.BoolValue has_step_changes = 8; + } + + // Repeated as there can be many metric sets (one for each model) in + // auto-arima and the large-scale case. + repeated ArimaSingleModelForecastingMetrics + arima_single_model_forecasting_metrics = 6; + } + + // Model evaluation metrics for dimensionality reduction models. + message DimensionalityReductionMetrics { + // Total percentage of variance explained by the selected principal + // components. + google.protobuf.DoubleValue total_explained_variance_ratio = 1; + } + + // 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. + message EvaluationMetrics { + // Metrics. + oneof metrics { + // Populated for regression models and explicit feedback type matrix + // factorization models. + RegressionMetrics regression_metrics = 1; + + // Populated for binary classification/classifier models. + BinaryClassificationMetrics binary_classification_metrics = 2; + + // Populated for multi-class classification/classifier models. + MultiClassClassificationMetrics multi_class_classification_metrics = 3; + + // Populated for clustering models. + ClusteringMetrics clustering_metrics = 4; + + // Populated for implicit feedback type matrix factorization models. + RankingMetrics ranking_metrics = 5; + + // Populated for ARIMA models. + ArimaForecastingMetrics arima_forecasting_metrics = 6; + + // Evaluation metrics when the model is a dimensionality reduction model, + // which currently includes PCA. + DimensionalityReductionMetrics dimensionality_reduction_metrics = 7; + } + } + + // Data split result. This contains references to the training and evaluation + // data tables that were used to train the model. + message DataSplitResult { + // Table reference of the training data after split. + TableReference training_table = 1; + + // Table reference of the evaluation data after split. + TableReference evaluation_table = 2; + + // Table reference of the test data after split. + TableReference test_table = 3; + } + + // Arima order, can be used for both non-seasonal and seasonal parts. + message ArimaOrder { + // Order of the autoregressive part. + google.protobuf.Int64Value p = 1; + + // Order of the differencing part. + google.protobuf.Int64Value d = 2; + + // Order of the moving-average part. + google.protobuf.Int64Value q = 3; + } + + // ARIMA model fitting metrics. + message ArimaFittingMetrics { + // Log-likelihood. + google.protobuf.DoubleValue log_likelihood = 1; + + // AIC. + google.protobuf.DoubleValue aic = 2; + + // Variance. + google.protobuf.DoubleValue variance = 3; + } + + // Global explanations containing the top most important features + // after training. + message GlobalExplanation { + // Explanation for a single feature. + message Explanation { + // 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. + string feature_name = 1; + + // Attribution of feature. + google.protobuf.DoubleValue attribution = 2; + } + + // A list of the top global explanations. Sorted by absolute value of + // attribution in descending order. + repeated Explanation explanations = 1; + + // Class label for this set of global explanations. Will be empty/null for + // binary logistic and linear regression models. Sorted alphabetically in + // descending order. + string class_label = 2; + } + + // Encoding methods for categorical features. + message CategoryEncodingMethod { + // Supported encoding methods for categorical features. + enum EncodingMethod { + // Unspecified encoding method. + ENCODING_METHOD_UNSPECIFIED = 0; + + // Applies one-hot encoding. + ONE_HOT_ENCODING = 1; + + // Applies label encoding. + LABEL_ENCODING = 2; + + // Applies dummy encoding. + DUMMY_ENCODING = 3; + } + } + + // PCA solver options. + message PcaSolverOptionEnums { + // Enums for supported PCA solvers. + enum PcaSolver { + // Default value. + UNSPECIFIED = 0; + + // Full eigen-decoposition. + FULL = 1; + + // Randomized SVD. + RANDOMIZED = 2; + + // Auto. + AUTO = 3; + } + } + + // Model registry options. + message ModelRegistryOptionEnums { + // Enums for supported model registries. + enum ModelRegistry { + // Default value. + MODEL_REGISTRY_UNSPECIFIED = 0; + + // Vertex AI. + VERTEX_AI = 1; + } + } + + // Information about a single training query run for the model. + message TrainingRun { + // Options used in model training. + message TrainingOptions { + // Supported reservation affinity types to configure a Vertex AI + // resource. + enum ReservationAffinityType { + // Default value. + RESERVATION_AFFINITY_TYPE_UNSPECIFIED = 0; + + // No reservation. + NO_RESERVATION = 1; + + // Any reservation. + ANY_RESERVATION = 2; + + // Specific reservation. + SPECIFIC_RESERVATION = 3; + } + + // The maximum number of iterations in training. Used only for iterative + // training algorithms. + int64 max_iterations = 1; + + // Type of loss function used during training run. + LossType loss_type = 2; + + // Learning rate in training. Used only for iterative training algorithms. + double learn_rate = 3; + + // L1 regularization coefficient. + google.protobuf.DoubleValue l1_regularization = 4; + + // L2 regularization coefficient. + google.protobuf.DoubleValue l2_regularization = 5; + + // When early_stop is true, stops training when accuracy improvement is + // less than 'min_relative_progress'. Used only for iterative training + // algorithms. + google.protobuf.DoubleValue min_relative_progress = 6; + + // Whether to train a model from the last checkpoint. + google.protobuf.BoolValue warm_start = 7; + + // Whether to stop early when the loss doesn't improve significantly + // any more (compared to min_relative_progress). Used only for iterative + // training algorithms. + google.protobuf.BoolValue early_stop = 8; + + // Name of input label columns in training data. + repeated string input_label_columns = 9; + + // The data split type for training and evaluation, e.g. RANDOM. + DataSplitMethod data_split_method = 10; + + // 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. + double data_split_eval_fraction = 11; + + // 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 + string data_split_column = 12; + + // The strategy to determine learn rate for the current iteration. + LearnRateStrategy learn_rate_strategy = 13; + + // Specifies the initial learning rate for the line search learn rate + // strategy. + double initial_learn_rate = 16; + + // Weights associated with each label class, for rebalancing the + // training data. Only applicable for classification models. + map label_class_weights = 17; + + // User column specified for matrix factorization models. + string user_column = 18; + + // Item column specified for matrix factorization models. + string item_column = 19; + + // Distance type for clustering models. + DistanceType distance_type = 20; + + // Number of clusters for clustering models. + int64 num_clusters = 21; + + // Google Cloud Storage URI from which the model was imported. Only + // applicable for imported models. + string model_uri = 22; + + // Optimization strategy for training linear regression models. + OptimizationStrategy optimization_strategy = 23; + + // Hidden units for dnn models. + repeated int64 hidden_units = 24; + + // Batch size for dnn models. + int64 batch_size = 25; + + // Dropout probability for dnn models. + google.protobuf.DoubleValue dropout = 26; + + // Maximum depth of a tree for boosted tree models. + int64 max_tree_depth = 27; + + // Subsample fraction of the training data to grow tree to prevent + // overfitting for boosted tree models. + double subsample = 28; + + // Minimum split loss for boosted tree models. + google.protobuf.DoubleValue min_split_loss = 29; + + // Booster type for boosted tree models. + BoostedTreeOptionEnums.BoosterType booster_type = 60; + + // Number of parallel trees constructed during each iteration for boosted + // tree models. + google.protobuf.Int64Value num_parallel_tree = 61; + + // Type of normalization algorithm for boosted tree models using + // dart booster. + BoostedTreeOptionEnums.DartNormalizeType dart_normalize_type = 62; + + // Tree construction algorithm for boosted tree models. + BoostedTreeOptionEnums.TreeMethod tree_method = 63; + + // Minimum sum of instance weight needed in a child for boosted tree + // models. + google.protobuf.Int64Value min_tree_child_weight = 64; + + // Subsample ratio of columns when constructing each tree for boosted tree + // models. + google.protobuf.DoubleValue colsample_bytree = 65; + + // Subsample ratio of columns for each level for boosted tree models. + google.protobuf.DoubleValue colsample_bylevel = 66; + + // Subsample ratio of columns for each node(split) for boosted tree + // models. + google.protobuf.DoubleValue colsample_bynode = 67; + + // Num factors specified for matrix factorization models. + int64 num_factors = 30; + + // Feedback type that specifies which algorithm to run for matrix + // factorization. + FeedbackType feedback_type = 31; + + // Hyperparameter for matrix factoration when implicit feedback type is + // specified. + google.protobuf.DoubleValue wals_alpha = 32; + + // The method used to initialize the centroids for kmeans algorithm. + KmeansEnums.KmeansInitializationMethod kmeans_initialization_method = 33; + + // The column used to provide the initial centroids for kmeans algorithm + // when kmeans_initialization_method is CUSTOM. + string kmeans_initialization_column = 34; + + // Column to be designated as time series timestamp for ARIMA model. + string time_series_timestamp_column = 35; + + // Column to be designated as time series data for ARIMA model. + string time_series_data_column = 36; + + // Whether to enable auto ARIMA or not. + google.protobuf.BoolValue auto_arima = 37; + + // 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 non_seasonal_order = 38; + + // The data frequency of a time series. + DataFrequency data_frequency = 39; + + // Whether or not p-value test should be computed for this model. Only + // available for linear and logistic regression models. + google.protobuf.BoolValue calculate_p_values = 40; + + // Include drift when fitting an ARIMA model. + google.protobuf.BoolValue include_drift = 41; + + // 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. + HolidayRegion holiday_region = 42; + + // A list of geographical regions that are used for time series modeling. + repeated HolidayRegion holiday_regions = 71; + + // The time series id column that was used during ARIMA model training. + string time_series_id_column = 43; + + // The time series id columns that were used during ARIMA model training. + repeated string time_series_id_columns = 51; + + // 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 + double forecast_limit_lower_bound = 99; + + // The forecast limit upper bound that was used during ARIMA model + // training with limits. + double forecast_limit_upper_bound = 100; + + // The number of periods ahead that need to be forecasted. + int64 horizon = 44; + + // The max value of the sum of non-seasonal p and q. + int64 auto_arima_max_order = 46; + + // The min value of the sum of non-seasonal p and q. + int64 auto_arima_min_order = 83; + + // Number of trials to run this hyperparameter tuning job. + int64 num_trials = 47; + + // Maximum number of trials to run in parallel. + int64 max_parallel_trials = 48; + + // The target evaluation metrics to optimize the hyperparameters for. + repeated HparamTuningEnums.HparamTuningObjective + hparam_tuning_objectives = 54; + + // If true, perform decompose time series and save the results. + google.protobuf.BoolValue decompose_time_series = 50; + + // If true, clean spikes and dips in the input time series. + google.protobuf.BoolValue clean_spikes_and_dips = 52; + + // If true, detect step changes and make data adjustment in the input time + // series. + google.protobuf.BoolValue adjust_step_changes = 53; + + // If true, enable global explanation during training. + google.protobuf.BoolValue enable_global_explain = 55; + + // Number of paths for the sampled Shapley explain method. + int64 sampled_shapley_num_paths = 56; + + // Number of integral steps for the integrated gradients explain method. + int64 integrated_gradients_num_steps = 57; + + // Categorical feature encoding method. + CategoryEncodingMethod.EncodingMethod category_encoding_method = 58; + + // Based on the selected TF version, the corresponding docker image is + // used to train external models. + string tf_version = 70; + + // Enums for color space, used for processing images in Object Table. + // See more details at + // https://www.tensorflow.org/io/tutorials/colorspace. + ColorSpace color_space = 72; + + // Name of the instance weight column for training data. + // This column isn't be used as a feature. + string instance_weight_column = 73; + + // 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. + int64 trend_smoothing_window_size = 74; + + // 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`. + double time_series_length_fraction = 75; + + // 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. + int64 min_time_series_length = 76; + + // 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. + int64 max_time_series_length = 77; + + // User-selected XGBoost versions for training of XGBoost models. + string xgboost_version = 78; + + // Whether to use approximate feature contribution method in XGBoost model + // explanation for global explain. + google.protobuf.BoolValue approx_global_feature_contrib = 84; + + // Whether the model should include intercept during model training. + google.protobuf.BoolValue fit_intercept = 85; + + // Number of principal components to keep in the PCA model. Must be <= the + // number of features. + int64 num_principal_components = 86; + + // The minimum ratio of cumulative explained variance that needs to be + // given by the PCA model. + double pca_explained_variance_ratio = 87; + + // If true, scale the feature values by dividing the feature standard + // deviation. Currently only apply to PCA. + google.protobuf.BoolValue scale_features = 88; + + // The solver for PCA. + PcaSolverOptionEnums.PcaSolver pca_solver = 89; + + // Whether to calculate class weights automatically based on the + // popularity of each label. + google.protobuf.BoolValue auto_class_weights = 90; + + // Activation function of the neural nets. + string activation_fn = 91; + + // Optimizer used for training the neural nets. + string optimizer = 92; + + // Budget in hours for AutoML training. + double budget_hours = 93; + + // Whether to standardize numerical features. Default to true. + google.protobuf.BoolValue standardize_features = 94; + + // L1 regularization coefficient to activations. + double l1_reg_activation = 95; + + // The model registry. + ModelRegistryOptionEnums.ModelRegistry model_registry = 96; + + // The version aliases to apply in Vertex AI model registry. Always + // overwrite if the version aliases exists in a existing model. + repeated string vertex_ai_model_version_aliases = 97; + + // Optional. Names of the columns to slice on. Applies to contribution + // analysis models. + repeated string dimension_id_columns = 104 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + optional string contribution_metric = 105; + + // Name of the column used to determine the rows corresponding to control + // and test. Applies to contribution analysis models. + optional string is_test_column = 106; + + // The apriori support minimum. Applies to contribution analysis models. + optional double min_apriori_support = 107; + + // The id that uniquely identifies an external model. + oneof external_model_id { + // The id of a Hugging Face model. For example, `google/gemma-2-2b-it`. + string hugging_face_model_id = 113; + + // The name of a Vertex model garden publisher model. Format is + // `publishers/{publisher}/models/{model}@{optional_version_id}`. + string model_garden_model_name = 114; + } + + // The idle TTL of the endpoint before the resources get destroyed. The + // default value is 6.5 hours. + optional google.protobuf.Duration endpoint_idle_ttl = 115; + + // The type of the machine used to deploy and serve the model. + optional string machine_type = 117; + + // 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. + optional int64 min_replica_count = 118; + + // The maximum number of machine replicas that will be deployed on an + // endpoint. The default value is equal to min_replica_count. + optional int64 max_replica_count = 119; + + // Specifies the reservation affinity type used to configure a Vertex AI + // resource. The default value is `NO_RESERVATION`. + optional ReservationAffinityType reservation_affinity_type = 120; + + // 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. + optional string reservation_affinity_key = 121; + + // 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. + repeated string reservation_affinity_values = 122; + } + + // Information about a single iteration of the training run. + message IterationResult { + // Information about a single cluster for clustering model. + message ClusterInfo { + // Centroid id. + int64 centroid_id = 1; + + // Cluster radius, the average distance from centroid + // to each point assigned to the cluster. + google.protobuf.DoubleValue cluster_radius = 2; + + // Cluster size, the total number of points assigned to the cluster. + google.protobuf.Int64Value cluster_size = 3; + } + + // (Auto-)arima fitting result. Wrap everything in ArimaResult for easier + // refactoring if we want to use model-specific iteration results. + message ArimaResult { + // Arima coefficients. + message ArimaCoefficients { + // Auto-regressive coefficients, an array of double. + repeated double auto_regressive_coefficients = 1; + + // Moving-average coefficients, an array of double. + repeated double moving_average_coefficients = 2; + + // Intercept coefficient, just a double not an array. + google.protobuf.DoubleValue intercept_coefficient = 3; + } + + // Arima model information. + message ArimaModelInfo { + // Non-seasonal order. + ArimaOrder non_seasonal_order = 1; + + // Arima coefficients. + ArimaCoefficients arima_coefficients = 2; + + // Arima fitting metrics. + ArimaFittingMetrics arima_fitting_metrics = 3; + + // Whether Arima model fitted with drift or not. It is always false + // when d is not 1. + google.protobuf.BoolValue has_drift = 4; + + // 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. + string time_series_id = 5; + + // 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. + repeated string time_series_ids = 10; + + // Seasonal periods. Repeated because multiple periods are supported + // for one time series. + repeated SeasonalPeriod.SeasonalPeriodType seasonal_periods = 6; + + // If true, holiday_effect is a part of time series decomposition + // result. + google.protobuf.BoolValue has_holiday_effect = 7; + + // If true, spikes_and_dips is a part of time series decomposition + // result. + google.protobuf.BoolValue has_spikes_and_dips = 8; + + // If true, step_changes is a part of time series decomposition + // result. + google.protobuf.BoolValue has_step_changes = 9; + } + + // This message is repeated because there are multiple arima models + // fitted in auto-arima. For non-auto-arima model, its size is one. + repeated ArimaModelInfo arima_model_info = 1; + + // Seasonal periods. Repeated because multiple periods are supported for + // one time series. + repeated SeasonalPeriod.SeasonalPeriodType seasonal_periods = 2; + } + + // Principal component infos, used only for eigen decomposition based + // models, e.g., PCA. Ordered by explained_variance in the descending + // order. + message PrincipalComponentInfo { + // Id of the principal component. + google.protobuf.Int64Value principal_component_id = 1; + + // Explained variance by this principal component, which is simply the + // eigenvalue. + google.protobuf.DoubleValue explained_variance = 2; + + // Explained_variance over the total explained variance. + google.protobuf.DoubleValue explained_variance_ratio = 3; + + // The explained_variance is pre-ordered in the descending order to + // compute the cumulative explained variance ratio. + google.protobuf.DoubleValue cumulative_explained_variance_ratio = 4; + } + + // Index of the iteration, 0 based. + google.protobuf.Int32Value index = 1; + + // Time taken to run the iteration in milliseconds. + google.protobuf.Int64Value duration_ms = 4; + + // Loss computed on the training data at the end of iteration. + google.protobuf.DoubleValue training_loss = 5; + + // Loss computed on the eval data at the end of iteration. + google.protobuf.DoubleValue eval_loss = 6; + + // Learn rate used for this iteration. + double learn_rate = 7; + + // Information about top clusters for clustering models. + repeated ClusterInfo cluster_infos = 8; + + // Arima result. + ArimaResult arima_result = 9; + + // The information of the principal components. + repeated PrincipalComponentInfo principal_component_infos = 10; + } + + // Output only. Options that were used for this training run, includes + // user specified and default options that were used. + TrainingOptions training_options = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The start time of this training run. + google.protobuf.Timestamp start_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output of each iteration run, results.size() <= + // max_iterations. + repeated IterationResult results = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The evaluation metrics over training/eval data that were + // computed at the end of training. + EvaluationMetrics evaluation_metrics = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Data split result of the training run. Only set when the + // input data is actually split. + DataSplitResult data_split_result = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Global explanation contains the explanation of top features + // on the model level. Applies to both regression and classification models. + GlobalExplanation model_level_global_explanation = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Global explanation contains the explanation of top features + // on the class level. Applies to classification models only. + repeated GlobalExplanation class_level_global_explanations = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The model id in the [Vertex AI Model + // Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) + // for this training run. + string vertex_ai_model_id = 14; + + // Output only. The model version in the [Vertex AI Model + // Registry](https://cloud.google.com/vertex-ai/docs/model-registry/introduction) + // for this training run. + string vertex_ai_model_version = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Search space for a double hyperparameter. + message DoubleHparamSearchSpace { + // Range of a double hyperparameter. + message DoubleRange { + // Min value of the double parameter. + google.protobuf.DoubleValue min = 1; + + // Max value of the double parameter. + google.protobuf.DoubleValue max = 2; + } + + // Discrete candidates of a double hyperparameter. + message DoubleCandidates { + // Candidates for the double parameter in increasing order. + repeated google.protobuf.DoubleValue candidates = 1; + } + + // Search space. + oneof search_space { + // Range of the double hyperparameter. + DoubleRange range = 1; + + // Candidates of the double hyperparameter. + DoubleCandidates candidates = 2; + } + } + + // Search space for an int hyperparameter. + message IntHparamSearchSpace { + // Range of an int hyperparameter. + message IntRange { + // Min value of the int parameter. + google.protobuf.Int64Value min = 1; + + // Max value of the int parameter. + google.protobuf.Int64Value max = 2; + } + + // Discrete candidates of an int hyperparameter. + message IntCandidates { + // Candidates for the int parameter in increasing order. + repeated google.protobuf.Int64Value candidates = 1; + } + + // Search space. + oneof search_space { + // Range of the int hyperparameter. + IntRange range = 1; + + // Candidates of the int hyperparameter. + IntCandidates candidates = 2; + } + } + + // Search space for string and enum. + message StringHparamSearchSpace { + // Canididates for the string or enum parameter in lower case. + repeated string candidates = 1; + } + + // Search space for int array. + message IntArrayHparamSearchSpace { + // An array of int. + message IntArray { + // Elements in the int array. + repeated int64 elements = 1; + } + + // Candidates for the int array parameter. + repeated IntArray candidates = 1; + } + + // Hyperparameter search spaces. + // These should be a subset of training_options. + message HparamSearchSpaces { + // Learning rate of training jobs. + DoubleHparamSearchSpace learn_rate = 2; + + // L1 regularization coefficient. + DoubleHparamSearchSpace l1_reg = 3; + + // L2 regularization coefficient. + DoubleHparamSearchSpace l2_reg = 4; + + // Number of clusters for k-means. + IntHparamSearchSpace num_clusters = 26; + + // Number of latent factors to train on. + IntHparamSearchSpace num_factors = 31; + + // Hidden units for neural network models. + IntArrayHparamSearchSpace hidden_units = 34; + + // Mini batch sample size. + IntHparamSearchSpace batch_size = 37; + + // Dropout probability for dnn model training and boosted tree models + // using dart booster. + DoubleHparamSearchSpace dropout = 38; + + // Maximum depth of a tree for boosted tree models. + IntHparamSearchSpace max_tree_depth = 41; + + // Subsample the training data to grow tree to prevent overfitting for + // boosted tree models. + DoubleHparamSearchSpace subsample = 42; + + // Minimum split loss for boosted tree models. + DoubleHparamSearchSpace min_split_loss = 43; + + // Hyperparameter for matrix factoration when implicit feedback type is + // specified. + DoubleHparamSearchSpace wals_alpha = 49; + + // Booster type for boosted tree models. + StringHparamSearchSpace booster_type = 56; + + // Number of parallel trees for boosted tree models. + IntHparamSearchSpace num_parallel_tree = 57; + + // Dart normalization type for boosted tree models. + StringHparamSearchSpace dart_normalize_type = 58; + + // Tree construction algorithm for boosted tree models. + StringHparamSearchSpace tree_method = 59; + + // Minimum sum of instance weight needed in a child for boosted tree models. + IntHparamSearchSpace min_tree_child_weight = 60; + + // Subsample ratio of columns when constructing each tree for boosted tree + // models. + DoubleHparamSearchSpace colsample_bytree = 61; + + // Subsample ratio of columns for each level for boosted tree models. + DoubleHparamSearchSpace colsample_bylevel = 62; + + // Subsample ratio of columns for each node(split) for boosted tree models. + DoubleHparamSearchSpace colsample_bynode = 63; + + // Activation functions of neural network models. + StringHparamSearchSpace activation_fn = 67; + + // Optimizer of TF models. + StringHparamSearchSpace optimizer = 68; + } + + // Training info of a trial in [hyperparameter + // tuning](https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) + // models. + message HparamTuningTrial { + // Current status of the trial. + enum TrialStatus { + // Default value. + TRIAL_STATUS_UNSPECIFIED = 0; + + // Scheduled but not started. + NOT_STARTED = 1; + + // Running state. + RUNNING = 2; + + // The trial succeeded. + SUCCEEDED = 3; + + // The trial failed. + FAILED = 4; + + // The trial is infeasible due to the invalid params. + INFEASIBLE = 5; + + // Trial stopped early because it's not promising. + STOPPED_EARLY = 6; + } + + // 1-based index of the trial. + int64 trial_id = 1; + + // Starting time of the trial. + int64 start_time_ms = 2; + + // Ending time of the trial. + int64 end_time_ms = 3; + + // The hyperprameters selected for this trial. + TrainingRun.TrainingOptions hparams = 4; + + // Evaluation metrics of this trial calculated on the test data. + // Empty in Job API. + EvaluationMetrics evaluation_metrics = 5; + + // The status of the trial. + TrialStatus status = 6; + + // Error message for FAILED and INFEASIBLE trial. + string error_message = 7; + + // Loss computed on the training data at the end of trial. + google.protobuf.DoubleValue training_loss = 8; + + // Loss computed on the eval data at the end of trial. + google.protobuf.DoubleValue eval_loss = 9; + + // 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 hparam_tuning_evaluation_metrics = 10; + } + + // Output only. A hash of this resource. + string etag = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Unique identifier for this model. + ModelReference model_reference = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time when this model was created, in millisecs since the + // epoch. + int64 creation_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this model was last modified, in millisecs since + // the epoch. + int64 last_modified_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A user-friendly description of this model. + string description = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A descriptive name for this model. + string friendly_name = 14 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 15; + + // Optional. The time when this model expires, in milliseconds since the + // epoch. If not present, the model will persist indefinitely. Expired models + // will be deleted and their storage reclaimed. The defaultTableExpirationMs + // property of the encapsulating dataset can be used to set a default + // expirationTime on newly created models. + int64 expiration_time = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The geographic location where the model resides. This value + // is inherited from the dataset. + string location = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 encryption_configuration = 17; + + // Output only. Type of the model resource. + ModelType model_type = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Information for all training runs in increasing order of start_time. + repeated TrainingRun training_runs = 9; + + // Output only. Input feature columns for the model inference. If the model is + // trained with TRANSFORM clause, these are the input of the TRANSFORM clause. + repeated StandardSqlField feature_columns = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Label columns that were used to train this model. + // The output of the model will have a "predicted_" prefix to these columns. + repeated StandardSqlField label_columns = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + repeated TransformColumn transform_columns = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. All hyperparameter search spaces in this model. + HparamSearchSpaces hparam_search_spaces = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + int64 default_trial_id = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + repeated HparamTuningTrial hparam_trials = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + repeated int64 optimal_trial_ids = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Remote model info + RemoteModelInfo remote_model_info = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request format for getting information about a BigQuery ML model. +message GetModelRequest { + // Required. Project ID of the requested model. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the requested model. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Model ID of the requested model. + string model_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +message PatchModelRequest { + // Required. Project ID of the model to patch. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the model to patch. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Model ID of the model to patch. + string model_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Patched model. + // Follows RFC5789 patch semantics. Missing fields are not updated. + // To clear a field, explicitly set to default value. + Model model = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request format for deleting BigQuery ML models. +message DeleteModelRequest { + // Required. Project ID of the model to delete. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the model to delete. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Model ID of the model to delete. + string model_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request format for listing BigQuery ML models. +message ListModelsRequest { + // Required. Project ID of the models to list. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the models to list. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.UInt32Value max_results = 3; + + // Page token, returned by a previous call to request the next page of + // results + string page_token = 4; +} + +// Response format for a single page when listing BigQuery ML models. +message ListModelsResponse { + // Models in the requested dataset. Only the following fields are populated: + // model_reference, model_type, creation_time, last_modified_time and + // labels. + repeated Model models = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model_reference.proto new file mode 100644 index 000000000000..a9da9ac32578 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/model_reference.proto @@ -0,0 +1,37 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "ModelReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Id path of a model. +message ModelReference { + // Required. The ID of the project containing this model. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the dataset containing this model. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the model. The ID must contain only + // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum + // length is 1,024 characters. + string model_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/partitioning_definition.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/partitioning_definition.proto new file mode 100644 index 000000000000..1970ac7fc9ed --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/partitioning_definition.proto @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "PartitioningDefinitionProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// The partitioning information, which includes managed table, external table +// and metastore partitioned table partition information. +message PartitioningDefinition { + // Optional. 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. + repeated PartitionedColumn partitioned_column = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The partitioning column information. +message PartitionedColumn { + // Required. The name of the partition column. + optional string field = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/privacy_policy.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/privacy_policy.proto new file mode 100644 index 000000000000..ea15b2103935 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/privacy_policy.proto @@ -0,0 +1,169 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "PrivacyPolicyProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Represents privacy policy associated with "aggregation threshold" method. +message AggregationThresholdPolicy { + // Optional. The threshold for the "aggregation threshold" policy. + optional int64 threshold = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The privacy unit column(s) associated with this policy. + // For now, only one column per data source object (table, view) is allowed as + // a privacy unit column. + // Representing as a repeated field in metadata for extensibility to + // multiple columns in future. + // Duplicates and Repeated struct fields are not allowed. + // For nested fields, use dot notation ("outer.inner") + repeated string privacy_unit_columns = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents privacy policy associated with "differential privacy" method. +message DifferentialPrivacyPolicy { + // Optional. The maximum epsilon value that a query can consume. If the + // subscriber specifies epsilon as a parameter in a SELECT query, it must be + // less than or equal to this value. The epsilon parameter controls the amount + // of noise that is added to the groups — a higher epsilon means less noise. + optional double max_epsilon_per_query = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The delta value that is used per query. Delta represents the + // probability that any row will fail to be epsilon differentially private. + // Indicates the risk associated with exposing aggregate rows in the result of + // a query. + optional double delta_per_query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum groups contributed value that is used per query. + // Represents the maximum number of groups to which each protected entity can + // contribute. Changing this value does not improve or worsen privacy. The + // best value for accuracy and utility depends on the query and data. + optional int64 max_groups_contributed = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The privacy unit column associated with this policy. Differential + // privacy policies can only have one privacy unit column per data source + // object (table, view). + optional string privacy_unit_column = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The total epsilon budget for all queries against the + // privacy-protected view. Each subscriber query against this view charges the + // amount of epsilon they request in their query. If there is sufficient + // budget, then the subscriber query attempts to complete. It might still fail + // due to other reasons, in which case the charge is refunded. If there is + // insufficient budget the query is rejected. There might be multiple charge + // attempts if a single query references multiple views. In this case there + // must be sufficient budget for all charges or the query is rejected and + // charges are refunded in best effort. The budget does not have a refresh + // policy and can only be updated via ALTER VIEW or circumvented by creating a + // new view that can be queried with a fresh budget. + optional double epsilon_budget = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The total delta budget for all queries against the + // privacy-protected view. Each subscriber query against this view charges the + // amount of delta that is pre-defined by the contributor through the privacy + // policy delta_per_query field. If there is sufficient budget, then the + // subscriber query attempts to complete. It might still fail due to other + // reasons, in which case the charge is refunded. If there is insufficient + // budget the query is rejected. There might be multiple charge attempts if a + // single query references multiple views. In this case there must be + // sufficient budget for all charges or the query is rejected and charges are + // refunded in best effort. The budget does not have a refresh policy and can + // only be updated via ALTER VIEW or circumvented by creating a new view that + // can be queried with a fresh budget. + optional double delta_budget = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The epsilon budget remaining. If budget is exhausted, no more + // queries are allowed. Note that the budget for queries that are in progress + // is deducted before the query executes. If the query fails or is cancelled + // then the budget is refunded. In this case the amount of budget remaining + // can increase. + optional double epsilon_budget_remaining = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The delta budget remaining. If budget is exhausted, no more + // queries are allowed. Note that the budget for queries that are in progress + // is deducted before the query executes. If the query fails or is cancelled + // then the budget is refunded. In this case the amount of budget remaining + // can increase. + optional double delta_budget_remaining = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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. +message JoinRestrictionPolicy { + // Enum for Join Restrictions policy. + enum JoinCondition { + // A join is neither required nor restricted on any column. Default value. + JOIN_CONDITION_UNSPECIFIED = 0; + + // A join is required on at least one of the specified columns. + JOIN_ANY = 1; + + // A join is required on all specified columns. + JOIN_ALL = 2; + + // A join is not required, but if present it is only permitted on + // 'join_allowed_columns' + JOIN_NOT_REQUIRED = 3; + + // Joins are blocked for all queries. + JOIN_BLOCKED = 4; + } + + // Optional. Specifies if a join is required or not on queries for the view. + // Default is JOIN_CONDITION_UNSPECIFIED. + optional JoinCondition join_condition = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + repeated string join_allowed_columns = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents privacy policy that contains the privacy requirements specified by +// the data owner. Currently, this is only supported on views. +message PrivacyPolicy { + // Privacy policy associated with this requirement specification. Only one of + // the privacy methods is allowed per data source object. + oneof privacy_policy { + // Optional. Policy used for aggregation thresholds. + AggregationThresholdPolicy aggregation_threshold_policy = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Policy used for differential privacy. + DifferentialPrivacyPolicy differential_privacy_policy = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. 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 join_restriction_policy = 1 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/project.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/project.proto new file mode 100644 index 000000000000..f084a76ff5e4 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/project.proto @@ -0,0 +1,58 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "ProjectProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// This service provides access to BigQuery functionality related to projects. +service ProjectService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // RPC to get the service account for a project used for interactions with + // Google Cloud KMS + rpc GetServiceAccount(GetServiceAccountRequest) + returns (GetServiceAccountResponse) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/serviceAccount" + }; + } +} + +// Request object of GetServiceAccount +message GetServiceAccountRequest { + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response object of GetServiceAccount +message GetServiceAccountResponse { + // The resource type of the response. + string kind = 1; + + // The service account email address. + string email = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/property_graph_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/property_graph_reference.proto new file mode 100644 index 000000000000..197ba9ced5c2 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/property_graph_reference.proto @@ -0,0 +1,38 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "PropertyGraphReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Id path of a property graph. +message PropertyGraphReference { + // Required. The ID of the project containing this property graph. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the dataset containing this property graph. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + string property_graph_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/query_parameter.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/query_parameter.proto new file mode 100644 index 000000000000..afb06b34da28 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/query_parameter.proto @@ -0,0 +1,110 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "QueryParameterProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// The type of a struct parameter. +message QueryParameterStructType { + // Optional. The name of this field. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of this field. + QueryParameterType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Human-oriented description of the field. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The type of a query parameter. +message QueryParameterType { + // Required. The top level type of this field. + string type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 int64 timestamp_precision = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the array's elements, if this is an array. + QueryParameterType array_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The types of the fields of this struct, in order, if this is a + // struct. + repeated QueryParameterStructType struct_types = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The element type of the range, if this is a range. + QueryParameterType range_element_type = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the value of a range. +message RangeValue { + // Optional. The start value of the range. A missing value represents an + // unbounded start. + QueryParameterValue start = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end value of the range. A missing value represents an + // unbounded end. + QueryParameterValue end = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The value of a query parameter. +message QueryParameterValue { + // Optional. The value of this value, if a simple scalar type. + google.protobuf.StringValue value = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The array values, if this is an array type. + repeated QueryParameterValue array_values = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // The struct field values. + map struct_values = 3; + + // Optional. The range value, if this is a range type. + RangeValue range_value = 6 [(google.api.field_behavior) = OPTIONAL]; + + // This field should not be used. + repeated google.protobuf.Value alt_struct_values = 5; +} + +// A parameter given to a query. +message QueryParameter { + // Optional. If unset, this is a positional parameter. Otherwise, should be + // unique within a query. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of this parameter. + QueryParameterType parameter_type = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of this parameter. + QueryParameterValue parameter_value = 3 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/range_partitioning.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/range_partitioning.proto new file mode 100644 index 000000000000..4daa0a1a4696 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/range_partitioning.proto @@ -0,0 +1,47 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "RangePartitioningProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +message RangePartitioning { + // Defines the ranges for range partitioning. + message Range { + // Required. The start of range partitioning, inclusive. This field is an + // INT64 value represented as a string. + string start = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The end of range partitioning, exclusive. This field is an + // INT64 value represented as a string. + string end = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The width of each interval. This field is an INT64 value + // represented as a string. + string interval = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The name of the column to partition the table on. It must be a + // top-level, INT64 column whose mode is NULLABLE or REQUIRED. + string field = 1 [(google.api.field_behavior) = REQUIRED]; + + // Defines the ranges for range partitioning. + Range range = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/restriction_config.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/restriction_config.proto new file mode 100644 index 000000000000..18de57d2293a --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/restriction_config.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "RestrictionConfigProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +message RestrictionConfig { + // RestrictionType specifies the type of dataset/table restriction. + enum RestrictionType { + // Should never be used. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Restrict data egress. See [Data + // egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress) + // for more details. + RESTRICTED_DATA_EGRESS = 1; + } + + // Output only. Specifies the type of dataset/table restriction. + RestrictionType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine.proto new file mode 100644 index 000000000000..9a126bc6795f --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine.proto @@ -0,0 +1,616 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/error.proto"; +import "google/cloud/bigquery/v2/routine_reference.proto"; +import "google/cloud/bigquery/v2/standard_sql.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "RoutineProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// RoutineService provides management access to BigQuery routines. +service RoutineService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Gets the specified routine resource by routine ID. + rpc GetRoutine(GetRoutineRequest) returns (Routine) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + }; + } + + // Creates a new routine in the dataset. + rpc InsertRoutine(InsertRoutineRequest) returns (Routine) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines" + body: "routine" + }; + } + + // Updates information in an existing routine. The update method replaces the + // entire Routine resource. + rpc UpdateRoutine(UpdateRoutineRequest) returns (Routine) { + option (google.api.http) = { + put: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + body: "routine" + }; + } + + // Deletes the routine specified by routineId from the dataset. + rpc DeleteRoutine(DeleteRoutineRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + }; + } + + // Lists all routines in the specified dataset. Requires the READER dataset + // role. + rpc ListRoutines(ListRoutinesRequest) returns (ListRoutinesResponse) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines" + }; + } +} + +// A user-defined function or a stored procedure. +message Routine { + // The fine-grained type of the routine. + enum RoutineType { + // Default value. + ROUTINE_TYPE_UNSPECIFIED = 0; + + // Non-built-in persistent scalar function. + SCALAR_FUNCTION = 1; + + // Stored procedure. + PROCEDURE = 2; + + // Non-built-in persistent TVF. + TABLE_VALUED_FUNCTION = 3; + + // Non-built-in persistent aggregate function. + AGGREGATE_FUNCTION = 4; + } + + // The language of the routine. + enum Language { + // Default value. + LANGUAGE_UNSPECIFIED = 0; + + // SQL language. + SQL = 1; + + // JavaScript language. + JAVASCRIPT = 2; + + // Python language. + PYTHON = 3; + + // Java language. + JAVA = 4; + + // Scala language. + SCALA = 5; + } + + // Input/output argument of a function or a stored procedure. + message Argument { + // Represents the kind of a given argument. + enum ArgumentKind { + // Default value. + ARGUMENT_KIND_UNSPECIFIED = 0; + + // The argument is a variable with fully specified type, which can be a + // struct or an array, but not a table. + FIXED_TYPE = 1; + + // The argument is any type, including struct or array, but not a table. + ANY_TYPE = 2; + } + + // The input/output mode of the argument. + enum Mode { + // Default value. + MODE_UNSPECIFIED = 0; + + // The argument is input-only. + IN = 1; + + // The argument is output-only. + OUT = 2; + + // The argument is both an input and an output. + INOUT = 3; + } + + // Optional. The name of this argument. Can be absent for function return + // argument. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defaults to FIXED_TYPE. + ArgumentKind argument_kind = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the argument is input or output. + // Can be set for procedures only. + Mode mode = 3; + + // Set if argument_kind == FIXED_TYPE. + StandardSqlDataType data_type = 4; + + // Optional. Whether the argument is an aggregate function parameter. + // Must be Unset for routine types other than AGGREGATE_FUNCTION. + // For AGGREGATE_FUNCTION, if set to false, it is equivalent to adding "NOT + // AGGREGATE" clause in DDL; Otherwise, it is equivalent to omitting "NOT + // AGGREGATE" clause in DDL. + google.protobuf.BoolValue is_aggregate = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // JavaScript UDF determinism levels. + // + // If all JavaScript UDFs are DETERMINISTIC, the query result is + // potentially cacheable (see below). If any JavaScript UDF is + // NOT_DETERMINISTIC, the query result is not cacheable. + // + // Even if a JavaScript UDF is deterministic, many other factors can prevent + // usage of cached query results. Example factors include but not limited to: + // DDL/DML, non-deterministic SQL function calls, update of referenced + // tables/views/UDFs or imported JavaScript libraries. + // + // SQL UDFs cannot have determinism specified. Their determinism is + // automatically determined. + enum DeterminismLevel { + // The determinism of the UDF is unspecified. + DETERMINISM_LEVEL_UNSPECIFIED = 0; + + // The UDF is deterministic, meaning that 2 function calls with the same + // inputs always produce the same result, even across 2 query runs. + DETERMINISTIC = 1; + + // The UDF is not deterministic. + NOT_DETERMINISTIC = 2; + } + + // Security mode. + enum SecurityMode { + // The security mode of the routine is unspecified. + SECURITY_MODE_UNSPECIFIED = 0; + + // The routine is to be executed with the privileges of the user who + // defines it. + DEFINER = 1; + + // The routine is to be executed with the privileges of the user who + // invokes it. + INVOKER = 2; + } + + // Options for a remote user-defined function. + message RemoteFunctionOptions { + // Endpoint of the user-provided remote service, e.g. + // ```https://us-east1-my_gcf_project.cloudfunctions.net/remote_add``` + string endpoint = 1; + + // 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}"``` + string connection = 2; + + // 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. + map user_defined_context = 3; + + // 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. + int64 max_batching_rows = 4; + } + + // Data governance type values. Only supports `DATA_MASKING`. + enum DataGovernanceType { + // The data governance type is unspecified. + DATA_GOVERNANCE_TYPE_UNSPECIFIED = 0; + + // The data governance type is data masking. + DATA_MASKING = 1; + } + + // Output only. A hash of this resource. + string etag = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Reference describing the ID of this routine. + RoutineReference routine_reference = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of routine. + RoutineType routine_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time when this routine was created, in milliseconds since + // the epoch. + int64 creation_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this routine was last modified, in milliseconds + // since the epoch. + int64 last_modified_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Defaults to "SQL" if remote_function_options field is absent, not + // set otherwise. + Language language = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. + repeated Argument arguments = 7; + + // 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 return_type = 10; + + // Optional. Can be set only if routine_type = "TABLE_VALUED_FUNCTION". + // + // If absent, the return table type is inferred from definition_body at query + // time in each query that references this routine. If present, then the + // columns in the evaluated table result will be cast to match the column + // types specified in return table type, at query time. + StandardSqlTableType return_table_type = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If language = "JAVASCRIPT", this field stores the path of the + // imported JAVASCRIPT libraries. + repeated string imported_libraries = 8; + + // Required. The body of the routine. + // + // For functions, this is the expression in the AS clause. + // + // If `language = "SQL"`, it is the substring inside (but excluding) the + // parentheses. For example, for the function created with the following + // statement: + // + // `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` + // + // The definition_body is `concat(x, "\n", y)` (\n is not replaced with + // linebreak). + // + // If `language="JAVASCRIPT"`, it is the evaluated string in the AS clause. + // For example, for the function created with the following statement: + // + // `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` + // + // The definition_body is + // + // `return "\n";\n` + // + // Note that both \n are replaced with linebreaks. + // + // If `definition_body` references another routine, then that routine must + // be fully qualified with its project ID. + string definition_body = 9; + + // Optional. The description of the routine, if defined. + string description = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The determinism level of the JavaScript UDF, if defined. + DeterminismLevel determinism_level = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The security mode of the routine, if defined. If not defined, the + // security mode is automatically determined from the routine's configuration. + SecurityMode security_mode = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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`. + google.protobuf.BoolValue strict_mode = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Remote function specific options. + RemoteFunctionOptions remote_function_options = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Spark specific options. + SparkOptions spark_options = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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). + DataGovernanceType data_governance_type = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options for the Python UDF. + // [Preview](https://cloud.google.com/products/#product-launch-stages) + PythonOptions python_options = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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) + ExternalRuntimeOptions external_runtime_options = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The build status of the routine. This field is only applicable + // to Python UDFs. + // [Preview](https://cloud.google.com/products/#product-launch-stages) + RoutineBuildStatus build_status = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Options for a user-defined Python function. +message PythonOptions { + // Required. The name of the function defined in Python code as the entry + // point when the Python UDF is invoked. + string entry_point = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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). + repeated string packages = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Options for the runtime of the external system. +message ExternalRuntimeOptions { + // Optional. 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) + string container_memory = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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) + double container_cpu = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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}"``` + string runtime_connection = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + int64 max_batching_rows = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Language runtime version. Example: `python-3.11`. + string runtime_version = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of requests that a Cloud Run instance can handle + // concurrently. If absent or if `0`, a default concurrency is used. + int64 container_request_concurrency = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Options for a user-defined Spark routine. +message SparkOptions { + // Fully qualified name of the user-provided Spark connection object. Format: + // ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"``` + string connection = 1; + + // Runtime version. If not specified, the default runtime version is used. + string runtime_version = 2; + + // Custom container image for the runtime environment. + string container_image = 3; + + // 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). + map properties = 4; + + // 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. + string main_file_uri = 5; + + // 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). + repeated string py_file_uris = 6; + + // 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). + repeated string jar_uris = 7; + + // 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). + repeated string file_uris = 8; + + // 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). + repeated string archive_uris = 9; + + // 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. + string main_class = 10; +} + +// The status of a routine build. +message RoutineBuildStatus { + // The build state of a routine. + enum BuildState { + // Default value. + BUILD_STATE_UNSPECIFIED = 0; + + // The build is in progress. + IN_PROGRESS = 1; + + // The build has succeeded. + SUCCEEDED = 2; + + // The build has failed. + FAILED = 3; + } + + // Output only. The current build state of the routine. + BuildState build_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A result object that will be present only if the build has + // failed. + ErrorProto error_result = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the build state was updated last. + google.protobuf.Timestamp build_state_update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time taken for the image build. Populated only after the + // build succeeds or fails. + google.protobuf.Duration build_duration = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the image in bytes. Populated only after the build + // succeeds. + int64 image_size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes the format for getting information about a routine. +message GetRoutineRequest { + // Required. Project ID of the requested routine + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the requested routine + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Routine ID of the requested routine + string routine_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes the format for inserting a routine. +message InsertRoutineRequest { + // Required. Project ID of the new routine + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the new routine + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A routine resource to insert + Routine routine = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes the format for updating a routine. +message UpdateRoutineRequest { + // Required. Project ID of the routine to update + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the routine to update + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Routine ID of the routine to update + string routine_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A routine resource which will replace the specified routine + Routine routine = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes the format for deleting a routine. +message DeleteRoutineRequest { + // Required. Project ID of the routine to delete + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the routine to delete + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Routine ID of the routine to delete + string routine_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes the format for listing routines. +message ListRoutinesRequest { + // Required. Project ID of the routines to list + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the routines to list + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.UInt32Value max_results = 3; + + // Page token, returned by a previous call, to request the next page of + // results + string page_token = 4; + + // 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`. + string filter = 6; +} + +// Describes the format of a single result page when listing routines. +message ListRoutinesResponse { + // 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. + repeated Routine routines = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine_reference.proto new file mode 100644 index 000000000000..2d40b6cb92ec --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/routine_reference.proto @@ -0,0 +1,37 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "RoutineReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Id path of a routine. +message RoutineReference { + // Required. The ID of the project containing this routine. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the dataset containing this routine. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the routine. The ID must contain only + // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum + // length is 256 characters. + string routine_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy.proto new file mode 100644 index 000000000000..b56bc1ecf19d --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy.proto @@ -0,0 +1,270 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/row_access_policy_reference.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "RowAccessPolicyProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Service for interacting with row access policies. +service RowAccessPolicyService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all row access policies on the specified table. + rpc ListRowAccessPolicies(ListRowAccessPoliciesRequest) + returns (ListRowAccessPoliciesResponse) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies" + }; + } + + // Gets the specified row access policy by policy ID. + rpc GetRowAccessPolicy(GetRowAccessPolicyRequest) returns (RowAccessPolicy) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + }; + } + + // Creates a row access policy. + rpc CreateRowAccessPolicy(CreateRowAccessPolicyRequest) + returns (RowAccessPolicy) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies" + body: "row_access_policy" + }; + } + + // Updates a row access policy. + rpc UpdateRowAccessPolicy(UpdateRowAccessPolicyRequest) + returns (RowAccessPolicy) { + option (google.api.http) = { + put: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + body: "row_access_policy" + }; + } + + // Deletes a row access policy. + rpc DeleteRowAccessPolicy(DeleteRowAccessPolicyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + }; + } + + // Deletes provided row access policies. + rpc BatchDeleteRowAccessPolicies(BatchDeleteRowAccessPoliciesRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies:batchDelete" + body: "*" + }; + } +} + +// Request message for the ListRowAccessPolicies method. +message ListRowAccessPoliciesRequest { + // Required. Project ID of the row access policies to list. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of row access policies to list. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to list row access policies. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 4; + + // The maximum number of results to return in a single response page. Leverage + // the page tokens to iterate through the entire collection. + int32 page_size = 5; +} + +// Response message for the ListRowAccessPolicies method. +message ListRowAccessPoliciesResponse { + // Row access policies on the requested table. + repeated RowAccessPolicy row_access_policies = 1; + + // A token to request the next page of results. + string next_page_token = 2; +} + +// Request message for the GetRowAccessPolicy method. +message GetRowAccessPolicyRequest { + // Required. Project ID of the table to get the row access policy. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to get the row access policy. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to get the row access policy. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Policy ID of the row access policy. + string policy_id = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the CreateRowAccessPolicy method. +message CreateRowAccessPolicyRequest { + // Required. Project ID of the table to get the row access policy. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to get the row access policy. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to get the row access policy. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The row access policy to create. + RowAccessPolicy row_access_policy = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the UpdateRowAccessPolicy method. +message UpdateRowAccessPolicyRequest { + // Required. Project ID of the table to get the row access policy. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to get the row access policy. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to get the row access policy. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Policy ID of the row access policy. + string policy_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The row access policy to update. + RowAccessPolicy row_access_policy = 5 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the DeleteRowAccessPolicy method. +message DeleteRowAccessPolicyRequest { + // Required. Project ID of the table to delete the row access policy. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to delete the row access policy. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to delete the row access policy. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Policy ID of the row access policy. + string policy_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // 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. + optional bool force = 5; +} + +// Request message for the BatchDeleteRowAccessPoliciesRequest method. +message BatchDeleteRowAccessPoliciesRequest { + // Required. Project ID of the table to delete the row access policies. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to delete the row access policies. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to delete the row access policies. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Policy IDs of the row access policies. + repeated string policy_ids = 4 [(google.api.field_behavior) = REQUIRED]; + + // 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. + optional bool force = 5; +} + +// 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. +message RowAccessPolicy { + // Output only. A hash of this resource. + string etag = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Reference describing the ID of this row access policy. + RowAccessPolicyReference row_access_policy_reference = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A SQL boolean expression that represents the rows defined by this + // row access policy, similar to the boolean expression in a WHERE clause of a + // SELECT query on a table. + // References to other tables, routines, and temporary functions are not + // supported. + // + // Examples: region="EU" + // date_field = CAST('2019-9-27' as DATE) + // nullable_field is not NULL + // numeric_field BETWEEN 1.0 AND 5.0 + string filter_predicate = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time when this row access policy was created, in + // milliseconds since the epoch. + google.protobuf.Timestamp creation_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this row access policy was last modified, in + // milliseconds since the epoch. + google.protobuf.Timestamp last_modified_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. 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. + repeated string grantees = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy_reference.proto new file mode 100644 index 000000000000..a06945537e01 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/row_access_policy_reference.proto @@ -0,0 +1,41 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "RowAccessPolicyReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Id path of a row access policy. +message RowAccessPolicyReference { + // Required. The ID of the project containing this row access policy. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the dataset containing this row access policy. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the table containing this row access policy. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the row access policy. The ID must contain only + // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum + // length is 256 characters. + string policy_id = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/session_info.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/session_info.proto new file mode 100644 index 000000000000..04228010109f --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/session_info.proto @@ -0,0 +1,30 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "SessionInfoProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// [Preview] Information related to sessions. +message SessionInfo { + // Output only. The id of the session. + string session_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/standard_sql.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/standard_sql.proto new file mode 100644 index 000000000000..527087a9c5ec --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/standard_sql.proto @@ -0,0 +1,166 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "StandardSqlProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// 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"} +// } +message StandardSqlDataType { + // The kind of the datatype. + enum TypeKind { + // Invalid type. + TYPE_KIND_UNSPECIFIED = 0; + + // Encoded as a string in decimal format. + INT64 = 2; + + // Encoded as a boolean "false" or "true". + BOOL = 5; + + // Encoded as a number, or string "NaN", "Infinity" or "-Infinity". + FLOAT64 = 7; + + // Encoded as a string value. + STRING = 8; + + // Encoded as a base64 string per RFC 4648, section 4. + BYTES = 9; + + // Encoded as an RFC 3339 timestamp with mandatory "Z" time zone string: + // 1985-04-12T23:20:50.52Z + TIMESTAMP = 19; + + // Encoded as RFC 3339 full-date format string: 1985-04-12 + DATE = 10; + + // Encoded as RFC 3339 partial-time format string: 23:20:50.52 + TIME = 20; + + // Encoded as RFC 3339 full-date "T" partial-time: 1985-04-12T23:20:50.52 + DATETIME = 21; + + // Encoded as fully qualified 3 part: 0-5 15 2:30:45.6 + INTERVAL = 26; + + // Encoded as WKT + GEOGRAPHY = 22; + + // Encoded as a decimal string. + NUMERIC = 23; + + // Encoded as a decimal string. + BIGNUMERIC = 24; + + // Encoded as a string. + JSON = 25; + + // Encoded as a list with types matching Type.array_type. + ARRAY = 16; + + // Encoded as a list with fields of type Type.struct_type[i]. List is used + // because a JSON object cannot have duplicate field names. + STRUCT = 17; + + // Encoded as a pair with types matching range_element_type. Pairs must + // begin with "[", end with ")", and be separated by ", ". + RANGE = 29; + } + + // Required. The top level type of this field. + // Can be any GoogleSQL data type (e.g., "INT64", "DATE", "ARRAY"). + TypeKind type_kind = 1 [(google.api.field_behavior) = REQUIRED]; + + // For complex types, the sub type information. + oneof sub_type { + // The type of the array's elements, if type_kind = "ARRAY". + StandardSqlDataType array_element_type = 2; + + // The fields of this struct, in order, if type_kind = "STRUCT". + StandardSqlStructType struct_type = 3; + + // The type of the range's elements, if type_kind = "RANGE". + StandardSqlDataType range_element_type = 4; + } +} + +// A field or a column. +message StandardSqlField { + // Optional. The name of this field. Can be absent for struct fields. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of this parameter. Absent if not explicitly + // specified (e.g., CREATE FUNCTION statement can omit the return type; + // in this case the output parameter does not have this "type" field). + StandardSqlDataType type = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The representation of a SQL STRUCT type. +message StandardSqlStructType { + // Fields within the struct. + repeated StandardSqlField fields = 1; +} + +// A table type +message StandardSqlTableType { + // The columns in this table type + repeated StandardSqlField columns = 1; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/system_variable.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/system_variable.proto new file mode 100644 index 000000000000..f9e98ec7da6f --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/system_variable.proto @@ -0,0 +1,36 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/standard_sql.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_multiple_files = true; +option java_outer_classname = "SystemVariableProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// System variables given to a query. +message SystemVariables { + // Output only. Data type for each system variable. + map types = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Value for each system variable. + google.protobuf.Struct values = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table.proto new file mode 100644 index 000000000000..d3079bd3848d --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table.proto @@ -0,0 +1,738 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/biglake_config.proto"; +import "google/cloud/bigquery/v2/clustering.proto"; +import "google/cloud/bigquery/v2/encryption_config.proto"; +import "google/cloud/bigquery/v2/error.proto"; +import "google/cloud/bigquery/v2/external_catalog_table_options.proto"; +import "google/cloud/bigquery/v2/external_data_config.proto"; +import "google/cloud/bigquery/v2/managed_table_type.proto"; +import "google/cloud/bigquery/v2/partitioning_definition.proto"; +import "google/cloud/bigquery/v2/privacy_policy.proto"; +import "google/cloud/bigquery/v2/range_partitioning.proto"; +import "google/cloud/bigquery/v2/restriction_config.proto"; +import "google/cloud/bigquery/v2/table_constraints.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; +import "google/cloud/bigquery/v2/table_schema.proto"; +import "google/cloud/bigquery/v2/time_partitioning.proto"; +import "google/cloud/bigquery/v2/udf_resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "TableProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// TableService provides methods for managing BigQuery tables and table-like +// entities such as views and snapshots. +service TableService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // 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. + rpc GetTable(GetTableRequest) returns (Table) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + }; + } + + // Creates a new, empty table in the dataset. + rpc InsertTable(InsertTableRequest) returns (Table) { + option (google.api.http) = { + post: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables" + body: "table" + }; + } + + // 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. + rpc PatchTable(UpdateOrPatchTableRequest) returns (Table) { + option (google.api.http) = { + patch: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + body: "table" + }; + } + + // 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. + rpc UpdateTable(UpdateOrPatchTableRequest) returns (Table) { + option (google.api.http) = { + put: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + body: "table" + }; + } + + // Deletes the table specified by tableId from the dataset. + // If the table contains data, all the data will be deleted. + rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + }; + } + + // Lists all tables in the specified dataset. Requires the READER dataset + // role. + rpc ListTables(ListTablesRequest) returns (TableList) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables" + }; + } +} + +// Replication info of a table created using `AS REPLICA` DDL like: +// `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv` +message TableReplicationInfo { + // Replication status of the table created using `AS REPLICA` like: + // `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv` + enum ReplicationStatus { + // Default value. + REPLICATION_STATUS_UNSPECIFIED = 0; + + // Replication is Active with no errors. + ACTIVE = 1; + + // Source object is deleted. + SOURCE_DELETED = 2; + + // Source revoked replication permissions. + PERMISSION_DENIED = 3; + + // Source configuration doesn’t allow replication. + UNSUPPORTED_CONFIGURATION = 4; + } + + // Required. Source table reference that is replicated. + TableReference source_table = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies the interval at which the source table is polled for + // updates. + // It's Optional. If not specified, default replication interval would be + // applied. + int64 replication_interval_ms = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. If source is a materialized view, this field + // signifies the last refresh time of the source. + int64 replicated_source_last_refresh_time = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Replication status of configured replication. + ReplicationStatus replication_status = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Replication error that will permanently stopped + // table replication. + ErrorProto replication_error = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Describes the definition of a logical view. +message ViewDefinition { + // Required. A query that BigQuery executes when the view is referenced. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Describes user-defined function resources used in the query. + repeated UserDefinedFunctionResource user_defined_function_resources = 2; + + // 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. + google.protobuf.BoolValue use_legacy_sql = 3; + + // 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. + bool use_explicit_column_names = 4; + + // Optional. Specifies the privacy policy for the view. + PrivacyPolicy privacy_policy = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Foreign view representations. + repeated ForeignViewDefinition foreign_definitions = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A view can be represented in multiple ways. Each representation has its own +// dialect. This message stores the metadata required for these representations. +message ForeignViewDefinition { + // Required. The query that defines the view. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the dialect of the query. + string dialect = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Definition and configuration of a materialized view. +message MaterializedViewDefinition { + // Required. A query whose results are persisted. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The time when this materialized view was last refreshed, in + // milliseconds since the epoch. + int64 last_refresh_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Enable automatic refresh of the materialized view when the base + // table is updated. The default value is "true". + google.protobuf.BoolValue enable_refresh = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum frequency at which this materialized view will be + // refreshed. The default value is "1800000" (30 minutes). + google.protobuf.UInt64Value refresh_interval_ms = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.BoolValue allow_non_incremental_definition = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Status of a materialized view. +// The last refresh timestamp status is omitted here, but is present in the +// MaterializedViewDefinition message. +message MaterializedViewStatus { + // Output only. Refresh watermark of materialized view. The base tables' data + // were collected into the materialized view cache until this time. + google.protobuf.Timestamp refresh_watermark = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error result of the last automatic refresh. If present, + // indicates that the last automatic refresh was unsuccessful. + ErrorProto last_refresh_status = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about base table and snapshot time of the snapshot. +message SnapshotDefinition { + // Required. Reference describing the ID of the table that was snapshot. + TableReference base_table_reference = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the base table was snapshot. This value is + // reported in the JSON response using RFC3339 format. + google.protobuf.Timestamp snapshot_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Information about base table and clone time of a table clone. +message CloneDefinition { + // Required. Reference describing the ID of the table that was cloned. + TableReference base_table_reference = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The time at which the base table was cloned. This value is + // reported in the JSON response using RFC3339 format. + google.protobuf.Timestamp clone_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +message Streamingbuffer { + // Output only. A lower-bound estimate of the number of bytes currently in + // the streaming buffer. + uint64 estimated_bytes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A lower-bound estimate of the number of rows currently in the + // streaming buffer. + uint64 estimated_rows = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Contains the timestamp of the oldest entry in the streaming + // buffer, in milliseconds since the epoch, if the streaming buffer is + // available. + fixed64 oldest_entry_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message Table { + // The type of resource ID. + string kind = 1; + + // Output only. A hash of this resource. + string etag = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An opaque ID uniquely identifying the table. + string id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URL that can be used to access this resource again. + string self_link = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Reference describing the ID of this table. + TableReference table_reference = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A descriptive name for this table. + google.protobuf.StringValue friendly_name = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A user-friendly description of this table. + google.protobuf.StringValue description = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. + map labels = 8; + + // Optional. Describes the schema of this table. + TableSchema schema = 9 [(google.api.field_behavior) = OPTIONAL]; + + // If specified, configures time-based partitioning for this table. + TimePartitioning time_partitioning = 10; + + // If specified, configures range partitioning for this table. + RangePartitioning range_partitioning = 27; + + // 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 = 23; + + // Optional. If set to true, queries over this table require + // a partition filter that can be used for partition elimination to be + // specified. + google.protobuf.BoolValue require_partition_filter = 28 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 partition_definition = 51 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The size of this table in logical bytes, excluding any data in + // the streaming buffer. + google.protobuf.Int64Value num_bytes = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The physical size of this table in bytes. This includes + // storage used for time travel. + google.protobuf.Int64Value num_physical_bytes = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of logical bytes in the table that are considered + // "long-term storage". + google.protobuf.Int64Value num_long_term_bytes = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of rows of data in this table, excluding any data + // in the streaming buffer. + google.protobuf.UInt64Value num_rows = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this table was created, in milliseconds since + // the epoch. + int64 creation_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The time when this table expires, in milliseconds since the + // epoch. If not present, the table will persist indefinitely. Expired tables + // will be deleted and their storage reclaimed. The defaultTableExpirationMs + // property of the encapsulating dataset can be used to set a default + // expirationTime on newly created tables. + google.protobuf.Int64Value expiration_time = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when this table was last modified, in milliseconds + // since the epoch. + fixed64 last_modified_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes the table type. The following values are supported: + // + // * `TABLE`: A normal BigQuery table. + // * `VIEW`: A virtual table defined by a SQL query. + // * `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`. + string type = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The view definition. + ViewDefinition view = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The materialized view definition. + MaterializedViewDefinition materialized_view = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The materialized view status. + MaterializedViewStatus materialized_view_status = 42 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Describes the data format, location, and other properties of + // a table stored outside of BigQuery. By defining these properties, the data + // source can then be queried as if it were a standard BigQuery table. + ExternalDataConfiguration external_data_configuration = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the configuration of a BigQuery table for Apache + // Iceberg. + BigLakeConfiguration biglake_configuration = 45 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, overrides the default managed table type configured in + // the dataset. + ManagedTableType managed_table_type = 55 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The geographic location where the table resides. This value + // is inherited from the dataset. + string location = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Contains information regarding this table's streaming buffer, + // if one is present. This field will be absent if the table is not being + // streamed to or if there is no data in the streaming buffer. + Streamingbuffer streaming_buffer = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Custom encryption configuration (e.g., Cloud KMS keys). + EncryptionConfiguration encryption_configuration = 22; + + // Output only. Contains information about the snapshot. This value is set via + // snapshot creation. + SnapshotDefinition snapshot_definition = 29 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. 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. + google.protobuf.StringValue default_collation = 30 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + TableFieldSchema.RoundingMode default_rounding_mode = 44 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Contains information about the clone. This value is set via + // the clone operation. + CloneDefinition clone_definition = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of physical bytes used by time travel storage (deleted + // or changed data). This data is not kept in real time, and might be delayed + // by a few seconds to a few minutes. + google.protobuf.Int64Value num_time_travel_physical_bytes = 33 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total number of logical bytes in the table or materialized + // view. + google.protobuf.Int64Value num_total_logical_bytes = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of logical bytes that are less than 90 days old. + google.protobuf.Int64Value num_active_logical_bytes = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of logical bytes that are more than 90 days old. + google.protobuf.Int64Value num_long_term_logical_bytes = 36 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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. + google.protobuf.Int64Value num_current_physical_bytes = 53 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The physical size of this table in bytes. This also includes + // storage used for time travel. This data is not kept in real time, and might + // be delayed by a few seconds to a few minutes. + google.protobuf.Int64Value num_total_physical_bytes = 37 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of physical bytes less than 90 days old. This data is + // not kept in real time, and might be delayed by a few seconds to a few + // minutes. + google.protobuf.Int64Value num_active_physical_bytes = 38 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of physical bytes more than 90 days old. + // This data is not kept in real time, and might be delayed by a few seconds + // to a few minutes. + google.protobuf.Int64Value num_long_term_physical_bytes = 39 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of partitions present in the table or materialized + // view. This data is not kept in real time, and might be delayed by a few + // seconds to a few minutes. + google.protobuf.Int64Value num_partitions = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. 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. + string max_staleness = 41 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. 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. + RestrictionConfig restrictions = 46 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Tables Primary Key and Foreign Key information + TableConstraints table_constraints = 47 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [tags](https://cloud.google.com/bigquery/docs/tags) attached + // to this table. 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. + map resource_tags = 48 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Table replication info for table created `AS REPLICA` DDL like: + // `CREATE MATERIALIZED VIEW mv1 AS REPLICA OF src_mv` + TableReplicationInfo table_replication_info = 49 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. Table references of all replicas currently active on + // the table. + repeated TableReference replicas = 50 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Options defining open source compatible table. + ExternalCatalogTableOptions external_catalog_table_options = 54 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request format for getting table metadata. +message GetTableRequest { + // TableMetadataView specifies which table information is returned. + enum TableMetadataView { + // The default value. + // Default to the STORAGE_STATS view. + TABLE_METADATA_VIEW_UNSPECIFIED = 0; + + // 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. + BASIC = 1; + + // Includes all information in the BASIC view as well as storage statistics + // (numBytes, numLongTermBytes, numRows and lastModifiedTime). + STORAGE_STATS = 2; + + // Includes all table information, including storage statistics. + // It returns same information as STORAGE_STATS view, but may contain + // additional information in the future. + FULL = 3; + } + + // Required. Project ID of the requested table + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the requested table + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the requested table + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string selected_fields = 4; + + // Optional. Specifies the view that determines which table information is + // returned. By default, basic table information and storage statistics + // (STORAGE_STATS) are returned. + TableMetadataView view = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request format for inserting table metadata. +message InsertTableRequest { + // Required. Project ID of the new table + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the new table + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A tables resource to insert + Table table = 4 [(google.api.field_behavior) = REQUIRED]; +} + +message UpdateOrPatchTableRequest { + // Required. Project ID of the table to update + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to update + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to update + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A tables resource which will replace or patch the specified table + Table table = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. When true will autodetect schema, else will keep original schema. + bool autodetect_schema = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request format for deleting a table. +message DeleteTableRequest { + // Required. Project ID of the table to delete + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the table to delete + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Table ID of the table to delete + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request format for enumerating tables. +message ListTablesRequest { + // Required. Project ID of the tables to list + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset ID of the tables to list + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.UInt32Value max_results = 3; + + // Page token, returned by a previous call, to request the next page of + // results + string page_token = 4; +} + +// Information about a logical view. +message ListFormatView { + // True if view is defined in legacy SQL dialect, + // false if in GoogleSQL. + google.protobuf.BoolValue use_legacy_sql = 1; + + // Specifies the privacy policy for the view. + PrivacyPolicy privacy_policy = 2; +} + +message ListFormatTable { + // The resource type. + string kind = 1; + + // An opaque ID of the table. + string id = 2; + + // A reference uniquely identifying table. + TableReference table_reference = 3; + + // The user-friendly name for this table. + google.protobuf.StringValue friendly_name = 4; + + // The type of table. + string type = 5; + + // The time-based partitioning for this table. + TimePartitioning time_partitioning = 6; + + // The range partitioning for this table. + RangePartitioning range_partitioning = 12; + + // Clustering specification for this table, if configured. + Clustering clustering = 11; + + // The labels associated with this table. You can use these to organize + // and group your tables. + map labels = 7; + + // Additional details for a view. + ListFormatView view = 8; + + // Output only. The time when this table was created, in milliseconds since + // the epoch. + int64 creation_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + int64 expiration_time = 10; + + // Optional. If set to true, queries including this table must specify a + // partition filter. This filter is used for partition elimination. + google.protobuf.BoolValue require_partition_filter = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Partial projection of the metadata for a given table in a list response. +message TableList { + // The type of list. + string kind = 1; + + // A hash of this page of results. + string etag = 2; + + // A token to request the next page of results. + string next_page_token = 3; + + // Tables in the requested dataset. + repeated ListFormatTable tables = 4; + + // The total number of tables in the dataset. + google.protobuf.Int32Value total_items = 5; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_constraints.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_constraints.proto new file mode 100644 index 000000000000..f188d920fbf4 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_constraints.proto @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/cloud/bigquery/v2/table_reference.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "TableConstraintsProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Represents the primary key constraint on a table's columns. +message PrimaryKey { + // Required. The columns that are composed of the primary key constraint. + repeated string columns = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The pair of the foreign key column and primary key column. +message ColumnReference { + // Required. The column that composes the foreign key. + string referencing_column = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The column in the primary key that are referenced by the + // referencing_column. + string referenced_column = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a foreign key constraint on a table's columns. +message ForeignKey { + // Optional. Set only if the foreign key constraint is named. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The table that holds the primary key and is referenced by this + // foreign key. + TableReference referenced_table = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The columns that compose the foreign key. + repeated ColumnReference column_references = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The TableConstraints defines the primary key and foreign key. +message TableConstraints { + // Optional. Represents a primary key constraint on a table's columns. + // Present only if the table has a primary key. + // The primary key is not enforced. + PrimaryKey primary_key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Present only if the table has a foreign key. + // The foreign key is not enforced. + repeated ForeignKey foreign_keys = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_reference.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_reference.proto new file mode 100644 index 000000000000..04f2034e58f4 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_reference.proto @@ -0,0 +1,40 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "TableReferenceProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +message TableReference { + // Required. The ID of the project containing this table. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the dataset containing this table. + string dataset_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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`. + string table_id = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_schema.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_schema.proto new file mode 100644 index 000000000000..1f4d6f25358d --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/table_schema.proto @@ -0,0 +1,342 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "TableSchemaProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// Schema of a table +message TableSchema { + // Describes the fields in a table. + repeated TableFieldSchema fields = 1; + + // Optional. Specifies metadata of the foreign data type definition in field + // schema + // ([TableFieldSchema.foreign_type_definition][google.cloud.bigquery.v2.TableFieldSchema.foreign_type_definition]). + ForeignTypeInfo foreign_type_info = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata about the foreign data type definition such as the system +// in which the type is defined. +message ForeignTypeInfo { + // External systems, such as query engines or table formats, that have their + // own data types. + enum TypeSystem { + // TypeSystem not specified. + TYPE_SYSTEM_UNSPECIFIED = 0; + + // Represents Hive data types. + HIVE = 1; + } + + // Required. Specifies the system which defines the foreign data type. + TypeSystem type_system = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// 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). +message DataPolicyOption { + // Data policy resource name in the form of + // projects/project_id/locations/location_id/dataPolicies/data_policy_id. + optional string name = 1; +} + +// A list of data policy options. 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). +message DataPolicyList { + // Contains a list of data policy options. At most 9 data policies are + // allowed per field. + repeated DataPolicyOption data_policies = 1; +} + +// A field in TableSchema +message TableFieldSchema { + message PolicyTagList { + // 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. + repeated string names = 1; + } + + message DataGovernanceTagsInfo { + // Optional. The data governance tags added to this field are used for + // field-level access control. Only one data governance tag is currently + // supported on a field. Tag keys are globally unique. Tag key is expected + // to be in the namespaced format, for example "123456789012/pii" 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 + // "sensitive". See [Tag + // definitions](https://cloud.google.com/iam/docs/tags-access-control#definitions) + // for more details. For example: + // "123456789012/pii": "sensitive", + // "myProject/cost_center": "sales" + map data_governance_tags = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Rounding mode options that can be used when storing NUMERIC + // or BIGNUMERIC values. + enum RoundingMode { + // Unspecified will default to using ROUND_HALF_AWAY_FROM_ZERO. + ROUNDING_MODE_UNSPECIFIED = 0; + + // 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_AWAY_FROM_ZERO = 1; + + // 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 + ROUND_HALF_EVEN = 2; + } + + // Represents the type of a field element. + message FieldElementType { + // Required. The type of a field element. For more information, see + // [TableFieldSchema.type][google.cloud.bigquery.v2.TableFieldSchema.type]. + string type = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Definition of the expression used to generate the field. + message GeneratedExpressionInfo { + // Optional. The generation expression (e.g. AI.EMBED(...)) used to + // generated the field. + optional string generation_expression = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the column generation is done asynchronously. + optional bool asynchronous = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the generated column is stored in the table. + optional bool stored = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Definition of how values are generated for the field. + // Only valid for top-level schema fields (not nested fields). + message GeneratedColumn { + // Dictates when system generated values are used to populate the field. + enum GeneratedMode { + // Unspecified GeneratedMode will default to GENERATED_ALWAYS. + GENERATED_MODE_UNSPECIFIED = 0; + + // Field can only have system generated values. Users cannot manually + // insert values into the field. + GENERATED_ALWAYS = 1; + + // Use system generated values only if the user does not explicitly + // provide a value. + GENERATED_BY_DEFAULT = 2; + } + + // Optional. Dictates when system generated values are used to populate the + // field. + optional GeneratedMode generated_mode = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Captures the metadata for the generated column. Could be either an + // identity column or a generated column. + oneof definition { + // Definition of the expression used to generate the field. + GeneratedExpressionInfo generated_expression_info = 3; + } + } + + // Required. The field name. The name must contain only letters (a-z, A-Z), + // numbers (0-9), or underscores (_), and must start with a letter or + // underscore. The maximum length is 300 characters. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The field mode. Possible values include NULLABLE, REQUIRED and + // REPEATED. The default value is NULLABLE. + string mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the nested schema fields if the type property is set + // to RECORD. + repeated TableFieldSchema fields = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The field description. The maximum length is 1,024 characters. + google.protobuf.StringValue description = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The policy tags attached to this field, used for field-level + // access control. If not set, defaults to empty policy_tags. + PolicyTagList policy_tags = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the data governance tags on this field. This field + // works with other column-level security fields as follows: + // - Precedence: If a data governance tag is attached to a column, it takes + // precedence over the policy tag attached to the column. + // However, if a data policy is attached to a column, it takes precedence + // over the data governance tag. + // + // - Patching behavior (how this field behaves during a `Table.patch` schema + // update): + // - Unset: If the `data_governance_tags_info` field is omitted + // from the update request, the existing tags on the column are preserved. + // - Empty Field: To clear data governance tags from a column, send the + // `data_governance_tags_info` field as an empty object. This will remove + // all tags from the column. + // - Updating tags: To replace existing tag, send the field with the + // new tag. + DataGovernanceTagsInfo data_governance_tags_info = 30 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data policies attached to this field, used for field-level access + // control. + repeated DataPolicyOption data_policies = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies data policies attached to this field, used for + // field-level access control. When set, this will be the source of truth for + // data policy information. + DataPolicyList data_policy_list = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum length of values of this field for STRINGS or BYTES. + // + // If max_length is not specified, no maximum length constraint is imposed + // on this field. + // + // If type = "STRING", then max_length represents the maximum UTF-8 + // length of strings in this field. + // + // If type = "BYTES", then max_length represents the maximum number of + // bytes in this field. + // + // It is invalid to set this field if type ≠ "STRING" and ≠ "BYTES". + int64 max_length = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Precision (maximum number of total digits in base 10) and scale + // (maximum number of digits in the fractional part in base 10) constraints + // for values of this field for NUMERIC or BIGNUMERIC. + // + // It is invalid to set precision or scale if type ≠ "NUMERIC" and ≠ + // "BIGNUMERIC". + // + // If precision and scale are not specified, no value range constraint is + // imposed on this field insofar as values are permitted by the type. + // + // Values of this NUMERIC or BIGNUMERIC field must be in this range when: + // + // * Precision (P) and scale (S) are specified: + // [-10P-S + 10-S, + // 10P-S - 10-S] + // * Precision (P) is specified but not scale (and thus scale is + // interpreted to be equal to zero): + // [-10P + 1, 10P - 1]. + // + // Acceptable values for precision and scale if both are specified: + // + // * If type = "NUMERIC": + // 1 ≤ precision - scale ≤ 29 and 0 ≤ scale ≤ 9. + // * If type = "BIGNUMERIC": + // 1 ≤ precision - scale ≤ 38 and 0 ≤ scale ≤ 38. + // + // Acceptable values for precision if only precision is specified but not + // scale (and thus scale is interpreted to be equal to zero): + // + // * If type = "NUMERIC": 1 ≤ precision ≤ 29. + // * If type = "BIGNUMERIC": 1 ≤ precision ≤ 38. + // + // If scale is specified but not precision, then it is invalid. + int64 precision = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See documentation for precision. + int64 scale = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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) + google.protobuf.Int64Value timestamp_precision = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the rounding mode to be used when storing values of + // NUMERIC and BIGNUMERIC type. + RoundingMode rounding_mode = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.StringValue collation = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A SQL expression to specify the [default value] + // (https://cloud.google.com/bigquery/docs/default-values) for this field. + google.protobuf.StringValue default_value_expression = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The subtype of the RANGE, if the type of this field is RANGE. If + // the type is RANGE, this field is required. Values for the field element + // type can be the following: + // + // * DATE + // * DATETIME + // * TIMESTAMP + FieldElementType range_element_type = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + string foreign_type_definition = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Definition of how values are generated for the field. + // Only valid for top-level schema fields (not nested fields). + GeneratedColumn generated_column = 28 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/time_partitioning.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/time_partitioning.proto new file mode 100644 index 000000000000..502b09c84349 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/time_partitioning.proto @@ -0,0 +1,44 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "TimePartitioningProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +message TimePartitioning { + // Required. The supported types are DAY, HOUR, MONTH, and YEAR, which will + // generate one partition per day, hour, month, and year, respectively. + string type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Number of milliseconds for which to keep the storage for a + // partition. + // A wrapper is used here because 0 is an invalid value. + google.protobuf.Int64Value expiration_ms = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + google.protobuf.StringValue field = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/udf_resource.proto b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/udf_resource.proto new file mode 100644 index 000000000000..5e1f41bdcbb5 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/google/cloud/bigquery/v2/udf_resource.proto @@ -0,0 +1,42 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb"; +option java_outer_classname = "UdfProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +// +// 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 +message UserDefinedFunctionResource { + // [Pick one] A code resource to load from a Google Cloud Storage URI + // (gs://bucket/path). + google.protobuf.StringValue resource_uri = 1; + + // [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. + google.protobuf.StringValue inline_code = 2; +} diff --git a/packages/google-cloud-bigquery-api/protos/protos.d.ts b/packages/google-cloud-bigquery-api/protos/protos.d.ts new file mode 100644 index 000000000000..eda4e5077dfa --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/protos.d.ts @@ -0,0 +1,40969 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace v2. */ + namespace v2 { + + /** Properties of a BigLakeConfiguration. */ + interface IBigLakeConfiguration { + + /** BigLakeConfiguration connectionId */ + connectionId?: (string|null); + + /** BigLakeConfiguration storageUri */ + storageUri?: (string|null); + + /** BigLakeConfiguration fileFormat */ + fileFormat?: (google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat|keyof typeof google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat|null); + + /** BigLakeConfiguration tableFormat */ + tableFormat?: (google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat|keyof typeof google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat|null); + } + + /** Represents a BigLakeConfiguration. */ + class BigLakeConfiguration implements IBigLakeConfiguration { + + /** + * Constructs a new BigLakeConfiguration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBigLakeConfiguration); + + /** BigLakeConfiguration connectionId. */ + public connectionId: string; + + /** BigLakeConfiguration storageUri. */ + public storageUri: string; + + /** BigLakeConfiguration fileFormat. */ + public fileFormat: (google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat|keyof typeof google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat); + + /** BigLakeConfiguration tableFormat. */ + public tableFormat: (google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat|keyof typeof google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat); + + /** + * Creates a new BigLakeConfiguration instance using the specified properties. + * @param [properties] Properties to set + * @returns BigLakeConfiguration instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBigLakeConfiguration): google.cloud.bigquery.v2.BigLakeConfiguration; + + /** + * Encodes the specified BigLakeConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.BigLakeConfiguration.verify|verify} messages. + * @param message BigLakeConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBigLakeConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigLakeConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigLakeConfiguration.verify|verify} messages. + * @param message BigLakeConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBigLakeConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigLakeConfiguration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigLakeConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BigLakeConfiguration; + + /** + * Decodes a BigLakeConfiguration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigLakeConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BigLakeConfiguration; + + /** + * Verifies a BigLakeConfiguration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigLakeConfiguration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigLakeConfiguration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BigLakeConfiguration; + + /** + * Creates a plain object from a BigLakeConfiguration message. Also converts values to other types if specified. + * @param message BigLakeConfiguration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BigLakeConfiguration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigLakeConfiguration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigLakeConfiguration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BigLakeConfiguration { + + /** FileFormat enum. */ + enum FileFormat { + FILE_FORMAT_UNSPECIFIED = 0, + PARQUET = 1 + } + + /** TableFormat enum. */ + enum TableFormat { + TABLE_FORMAT_UNSPECIFIED = 0, + ICEBERG = 1 + } + } + + /** Properties of a Clustering. */ + interface IClustering { + + /** Clustering fields */ + fields?: (string[]|null); + } + + /** Represents a Clustering. */ + class Clustering implements IClustering { + + /** + * Constructs a new Clustering. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IClustering); + + /** Clustering fields. */ + public fields: string[]; + + /** + * Creates a new Clustering instance using the specified properties. + * @param [properties] Properties to set + * @returns Clustering instance + */ + public static create(properties?: google.cloud.bigquery.v2.IClustering): google.cloud.bigquery.v2.Clustering; + + /** + * Encodes the specified Clustering message. Does not implicitly {@link google.cloud.bigquery.v2.Clustering.verify|verify} messages. + * @param message Clustering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IClustering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Clustering message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Clustering.verify|verify} messages. + * @param message Clustering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IClustering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Clustering message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Clustering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Clustering; + + /** + * Decodes a Clustering message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Clustering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Clustering; + + /** + * Verifies a Clustering message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Clustering message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Clustering + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Clustering; + + /** + * Creates a plain object from a Clustering message. Also converts values to other types if specified. + * @param message Clustering + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Clustering, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Clustering to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Clustering + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataFormatOptions. */ + interface IDataFormatOptions { + + /** DataFormatOptions useInt64Timestamp */ + useInt64Timestamp?: (boolean|null); + + /** DataFormatOptions timestampOutputFormat */ + timestampOutputFormat?: (google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat|keyof typeof google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat|null); + } + + /** Represents a DataFormatOptions. */ + class DataFormatOptions implements IDataFormatOptions { + + /** + * Constructs a new DataFormatOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDataFormatOptions); + + /** DataFormatOptions useInt64Timestamp. */ + public useInt64Timestamp: boolean; + + /** DataFormatOptions timestampOutputFormat. */ + public timestampOutputFormat: (google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat|keyof typeof google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat); + + /** + * Creates a new DataFormatOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DataFormatOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDataFormatOptions): google.cloud.bigquery.v2.DataFormatOptions; + + /** + * Encodes the specified DataFormatOptions message. Does not implicitly {@link google.cloud.bigquery.v2.DataFormatOptions.verify|verify} messages. + * @param message DataFormatOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDataFormatOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataFormatOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataFormatOptions.verify|verify} messages. + * @param message DataFormatOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDataFormatOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataFormatOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataFormatOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DataFormatOptions; + + /** + * Decodes a DataFormatOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataFormatOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DataFormatOptions; + + /** + * Verifies a DataFormatOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataFormatOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataFormatOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DataFormatOptions; + + /** + * Creates a plain object from a DataFormatOptions message. Also converts values to other types if specified. + * @param message DataFormatOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DataFormatOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataFormatOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataFormatOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataFormatOptions { + + /** TimestampOutputFormat enum. */ + enum TimestampOutputFormat { + TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED = 0, + FLOAT64 = 1, + INT64 = 2, + ISO8601_STRING = 3 + } + } + + /** Represents a DatasetService */ + class DatasetService extends $protobuf.rpc.Service { + + /** + * Constructs a new DatasetService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DatasetService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DatasetService; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.cloud.bigquery.v2.IGetDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.bigquery.v2.IGetDatasetRequest): Promise; + + /** + * Calls InsertDataset. + * @param request InsertDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public insertDataset(request: google.cloud.bigquery.v2.IInsertDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.InsertDatasetCallback): void; + + /** + * Calls InsertDataset. + * @param request InsertDatasetRequest message or plain object + * @returns Promise + */ + public insertDataset(request: google.cloud.bigquery.v2.IInsertDatasetRequest): Promise; + + /** + * Calls PatchDataset. + * @param request UpdateOrPatchDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public patchDataset(request: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.PatchDatasetCallback): void; + + /** + * Calls PatchDataset. + * @param request UpdateOrPatchDatasetRequest message or plain object + * @returns Promise + */ + public patchDataset(request: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateOrPatchDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateOrPatchDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDataset(request: google.cloud.bigquery.v2.IDeleteDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.bigquery.v2.IDeleteDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DatasetList + */ + public listDatasets(request: google.cloud.bigquery.v2.IListDatasetsRequest, callback: google.cloud.bigquery.v2.DatasetService.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.bigquery.v2.IListDatasetsRequest): Promise; + + /** + * Calls UndeleteDataset. + * @param request UndeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public undeleteDataset(request: google.cloud.bigquery.v2.IUndeleteDatasetRequest, callback: google.cloud.bigquery.v2.DatasetService.UndeleteDatasetCallback): void; + + /** + * Calls UndeleteDataset. + * @param request UndeleteDatasetRequest message or plain object + * @returns Promise + */ + public undeleteDataset(request: google.cloud.bigquery.v2.IUndeleteDatasetRequest): Promise; + } + + namespace DatasetService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|insertDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type InsertDatasetCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|patchDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type PatchDatasetCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|updateDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|deleteDataset}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|listDatasets}. + * @param error Error, if any + * @param [response] DatasetList + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.DatasetList) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|undeleteDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UndeleteDatasetCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Dataset) => void; + } + + /** Properties of a DatasetAccessEntry. */ + interface IDatasetAccessEntry { + + /** DatasetAccessEntry dataset */ + dataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** DatasetAccessEntry targetTypes */ + targetTypes?: (google.cloud.bigquery.v2.DatasetAccessEntry.TargetType[]|null); + } + + /** Represents a DatasetAccessEntry. */ + class DatasetAccessEntry implements IDatasetAccessEntry { + + /** + * Constructs a new DatasetAccessEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDatasetAccessEntry); + + /** DatasetAccessEntry dataset. */ + public dataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** DatasetAccessEntry targetTypes. */ + public targetTypes: google.cloud.bigquery.v2.DatasetAccessEntry.TargetType[]; + + /** + * Creates a new DatasetAccessEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetAccessEntry instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDatasetAccessEntry): google.cloud.bigquery.v2.DatasetAccessEntry; + + /** + * Encodes the specified DatasetAccessEntry message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetAccessEntry.verify|verify} messages. + * @param message DatasetAccessEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDatasetAccessEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetAccessEntry message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetAccessEntry.verify|verify} messages. + * @param message DatasetAccessEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDatasetAccessEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetAccessEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetAccessEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DatasetAccessEntry; + + /** + * Decodes a DatasetAccessEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetAccessEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DatasetAccessEntry; + + /** + * Verifies a DatasetAccessEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetAccessEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetAccessEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DatasetAccessEntry; + + /** + * Creates a plain object from a DatasetAccessEntry message. Also converts values to other types if specified. + * @param message DatasetAccessEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DatasetAccessEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetAccessEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetAccessEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DatasetAccessEntry { + + /** TargetType enum. */ + enum TargetType { + TARGET_TYPE_UNSPECIFIED = 0, + VIEWS = 1, + ROUTINES = 2 + } + } + + /** Properties of an Access. */ + interface IAccess { + + /** Access role */ + role?: (string|null); + + /** Access userByEmail */ + userByEmail?: (string|null); + + /** Access groupByEmail */ + groupByEmail?: (string|null); + + /** Access domain */ + domain?: (string|null); + + /** Access specialGroup */ + specialGroup?: (string|null); + + /** Access iamMember */ + iamMember?: (string|null); + + /** Access view */ + view?: (google.cloud.bigquery.v2.ITableReference|null); + + /** Access routine */ + routine?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** Access dataset */ + dataset?: (google.cloud.bigquery.v2.IDatasetAccessEntry|null); + + /** Access condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IAccess); + + /** Access role. */ + public role: string; + + /** Access userByEmail. */ + public userByEmail: string; + + /** Access groupByEmail. */ + public groupByEmail: string; + + /** Access domain. */ + public domain: string; + + /** Access specialGroup. */ + public specialGroup: string; + + /** Access iamMember. */ + public iamMember: string; + + /** Access view. */ + public view?: (google.cloud.bigquery.v2.ITableReference|null); + + /** Access routine. */ + public routine?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** Access dataset. */ + public dataset?: (google.cloud.bigquery.v2.IDatasetAccessEntry|null); + + /** Access condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Access instance using the specified properties. + * @param [properties] Properties to set + * @returns Access instance + */ + public static create(properties?: google.cloud.bigquery.v2.IAccess): google.cloud.bigquery.v2.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.bigquery.v2.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Access.verify|verify} messages. + * @param message Access message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Access message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Access; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Access; + + /** + * Verifies an Access message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Access + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Access; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @param message Access + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset kind */ + kind?: (string|null); + + /** Dataset etag */ + etag?: (string|null); + + /** Dataset id */ + id?: (string|null); + + /** Dataset selfLink */ + selfLink?: (string|null); + + /** Dataset datasetReference */ + datasetReference?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** Dataset friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** Dataset description */ + description?: (google.protobuf.IStringValue|null); + + /** Dataset defaultTableExpirationMs */ + defaultTableExpirationMs?: (google.protobuf.IInt64Value|null); + + /** Dataset defaultPartitionExpirationMs */ + defaultPartitionExpirationMs?: (google.protobuf.IInt64Value|null); + + /** Dataset labels */ + labels?: ({ [k: string]: string }|null); + + /** Dataset access */ + access?: (google.cloud.bigquery.v2.IAccess[]|null); + + /** Dataset creationTime */ + creationTime?: (number|Long|string|null); + + /** Dataset lastModifiedTime */ + lastModifiedTime?: (number|Long|string|null); + + /** Dataset location */ + location?: (string|null); + + /** Dataset defaultEncryptionConfiguration */ + defaultEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Dataset satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** Dataset satisfiesPzi */ + satisfiesPzi?: (google.protobuf.IBoolValue|null); + + /** Dataset type */ + type?: (string|null); + + /** Dataset catalogSource */ + catalogSource?: (string|null); + + /** Dataset linkedDatasetSource */ + linkedDatasetSource?: (google.cloud.bigquery.v2.ILinkedDatasetSource|null); + + /** Dataset linkedDatasetMetadata */ + linkedDatasetMetadata?: (google.cloud.bigquery.v2.ILinkedDatasetMetadata|null); + + /** Dataset externalDatasetReference */ + externalDatasetReference?: (google.cloud.bigquery.v2.IExternalDatasetReference|null); + + /** Dataset externalCatalogDatasetOptions */ + externalCatalogDatasetOptions?: (google.cloud.bigquery.v2.IExternalCatalogDatasetOptions|null); + + /** Dataset isCaseInsensitive */ + isCaseInsensitive?: (google.protobuf.IBoolValue|null); + + /** Dataset defaultCollation */ + defaultCollation?: (google.protobuf.IStringValue|null); + + /** Dataset defaultRoundingMode */ + defaultRoundingMode?: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null); + + /** Dataset maxTimeTravelHours */ + maxTimeTravelHours?: (google.protobuf.IInt64Value|null); + + /** Dataset tags */ + tags?: (google.cloud.bigquery.v2.IGcpTag[]|null); + + /** Dataset storageBillingModel */ + storageBillingModel?: (google.cloud.bigquery.v2.Dataset.StorageBillingModel|keyof typeof google.cloud.bigquery.v2.Dataset.StorageBillingModel|null); + + /** Dataset restrictions */ + restrictions?: (google.cloud.bigquery.v2.IRestrictionConfig|null); + + /** Dataset resourceTags */ + resourceTags?: ({ [k: string]: string }|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDataset); + + /** Dataset kind. */ + public kind: string; + + /** Dataset etag. */ + public etag: string; + + /** Dataset id. */ + public id: string; + + /** Dataset selfLink. */ + public selfLink: string; + + /** Dataset datasetReference. */ + public datasetReference?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** Dataset friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** Dataset description. */ + public description?: (google.protobuf.IStringValue|null); + + /** Dataset defaultTableExpirationMs. */ + public defaultTableExpirationMs?: (google.protobuf.IInt64Value|null); + + /** Dataset defaultPartitionExpirationMs. */ + public defaultPartitionExpirationMs?: (google.protobuf.IInt64Value|null); + + /** Dataset labels. */ + public labels: { [k: string]: string }; + + /** Dataset access. */ + public access: google.cloud.bigquery.v2.IAccess[]; + + /** Dataset creationTime. */ + public creationTime: (number|Long|string); + + /** Dataset lastModifiedTime. */ + public lastModifiedTime: (number|Long|string); + + /** Dataset location. */ + public location: string; + + /** Dataset defaultEncryptionConfiguration. */ + public defaultEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Dataset satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** Dataset satisfiesPzi. */ + public satisfiesPzi?: (google.protobuf.IBoolValue|null); + + /** Dataset type. */ + public type: string; + + /** Dataset catalogSource. */ + public catalogSource?: (string|null); + + /** Dataset linkedDatasetSource. */ + public linkedDatasetSource?: (google.cloud.bigquery.v2.ILinkedDatasetSource|null); + + /** Dataset linkedDatasetMetadata. */ + public linkedDatasetMetadata?: (google.cloud.bigquery.v2.ILinkedDatasetMetadata|null); + + /** Dataset externalDatasetReference. */ + public externalDatasetReference?: (google.cloud.bigquery.v2.IExternalDatasetReference|null); + + /** Dataset externalCatalogDatasetOptions. */ + public externalCatalogDatasetOptions?: (google.cloud.bigquery.v2.IExternalCatalogDatasetOptions|null); + + /** Dataset isCaseInsensitive. */ + public isCaseInsensitive?: (google.protobuf.IBoolValue|null); + + /** Dataset defaultCollation. */ + public defaultCollation?: (google.protobuf.IStringValue|null); + + /** Dataset defaultRoundingMode. */ + public defaultRoundingMode: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode); + + /** Dataset maxTimeTravelHours. */ + public maxTimeTravelHours?: (google.protobuf.IInt64Value|null); + + /** Dataset tags. */ + public tags: google.cloud.bigquery.v2.IGcpTag[]; + + /** Dataset storageBillingModel. */ + public storageBillingModel: (google.cloud.bigquery.v2.Dataset.StorageBillingModel|keyof typeof google.cloud.bigquery.v2.Dataset.StorageBillingModel); + + /** Dataset restrictions. */ + public restrictions?: (google.cloud.bigquery.v2.IRestrictionConfig|null); + + /** Dataset resourceTags. */ + public resourceTags: { [k: string]: string }; + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDataset): google.cloud.bigquery.v2.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.bigquery.v2.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Dataset { + + /** StorageBillingModel enum. */ + enum StorageBillingModel { + STORAGE_BILLING_MODEL_UNSPECIFIED = 0, + LOGICAL = 1, + PHYSICAL = 2 + } + } + + /** Properties of a GcpTag. */ + interface IGcpTag { + + /** GcpTag tagKey */ + tagKey?: (string|null); + + /** GcpTag tagValue */ + tagValue?: (string|null); + } + + /** Represents a GcpTag. */ + class GcpTag implements IGcpTag { + + /** + * Constructs a new GcpTag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGcpTag); + + /** GcpTag tagKey. */ + public tagKey: string; + + /** GcpTag tagValue. */ + public tagValue: string; + + /** + * Creates a new GcpTag instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpTag instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGcpTag): google.cloud.bigquery.v2.GcpTag; + + /** + * Encodes the specified GcpTag message. Does not implicitly {@link google.cloud.bigquery.v2.GcpTag.verify|verify} messages. + * @param message GcpTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGcpTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpTag message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GcpTag.verify|verify} messages. + * @param message GcpTag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGcpTag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpTag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GcpTag; + + /** + * Decodes a GcpTag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GcpTag; + + /** + * Verifies a GcpTag message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpTag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpTag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GcpTag; + + /** + * Creates a plain object from a GcpTag message. Also converts values to other types if specified. + * @param message GcpTag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GcpTag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpTag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpTag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedDatasetSource. */ + interface ILinkedDatasetSource { + + /** LinkedDatasetSource sourceDataset */ + sourceDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + } + + /** Represents a LinkedDatasetSource. */ + class LinkedDatasetSource implements ILinkedDatasetSource { + + /** + * Constructs a new LinkedDatasetSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ILinkedDatasetSource); + + /** LinkedDatasetSource sourceDataset. */ + public sourceDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** + * Creates a new LinkedDatasetSource instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedDatasetSource instance + */ + public static create(properties?: google.cloud.bigquery.v2.ILinkedDatasetSource): google.cloud.bigquery.v2.LinkedDatasetSource; + + /** + * Encodes the specified LinkedDatasetSource message. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetSource.verify|verify} messages. + * @param message LinkedDatasetSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ILinkedDatasetSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedDatasetSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetSource.verify|verify} messages. + * @param message LinkedDatasetSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ILinkedDatasetSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedDatasetSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.LinkedDatasetSource; + + /** + * Decodes a LinkedDatasetSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.LinkedDatasetSource; + + /** + * Verifies a LinkedDatasetSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LinkedDatasetSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedDatasetSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.LinkedDatasetSource; + + /** + * Creates a plain object from a LinkedDatasetSource message. Also converts values to other types if specified. + * @param message LinkedDatasetSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.LinkedDatasetSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedDatasetSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedDatasetSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedDatasetMetadata. */ + interface ILinkedDatasetMetadata { + + /** LinkedDatasetMetadata linkState */ + linkState?: (google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState|keyof typeof google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState|null); + } + + /** Represents a LinkedDatasetMetadata. */ + class LinkedDatasetMetadata implements ILinkedDatasetMetadata { + + /** + * Constructs a new LinkedDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ILinkedDatasetMetadata); + + /** LinkedDatasetMetadata linkState. */ + public linkState: (google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState|keyof typeof google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState); + + /** + * Creates a new LinkedDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedDatasetMetadata instance + */ + public static create(properties?: google.cloud.bigquery.v2.ILinkedDatasetMetadata): google.cloud.bigquery.v2.LinkedDatasetMetadata; + + /** + * Encodes the specified LinkedDatasetMetadata message. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetMetadata.verify|verify} messages. + * @param message LinkedDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ILinkedDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetMetadata.verify|verify} messages. + * @param message LinkedDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ILinkedDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.LinkedDatasetMetadata; + + /** + * Decodes a LinkedDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.LinkedDatasetMetadata; + + /** + * Verifies a LinkedDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LinkedDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.LinkedDatasetMetadata; + + /** + * Creates a plain object from a LinkedDatasetMetadata message. Also converts values to other types if specified. + * @param message LinkedDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.LinkedDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LinkedDatasetMetadata { + + /** LinkState enum. */ + enum LinkState { + LINK_STATE_UNSPECIFIED = 0, + LINKED = 1, + UNLINKED = 2 + } + } + + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { + + /** GetDatasetRequest projectId */ + projectId?: (string|null); + + /** GetDatasetRequest datasetId */ + datasetId?: (string|null); + + /** GetDatasetRequest datasetView */ + datasetView?: (google.cloud.bigquery.v2.GetDatasetRequest.DatasetView|keyof typeof google.cloud.bigquery.v2.GetDatasetRequest.DatasetView|null); + + /** GetDatasetRequest accessPolicyVersion */ + accessPolicyVersion?: (number|null); + } + + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { + + /** + * Constructs a new GetDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetDatasetRequest); + + /** GetDatasetRequest projectId. */ + public projectId: string; + + /** GetDatasetRequest datasetId. */ + public datasetId: string; + + /** GetDatasetRequest datasetView. */ + public datasetView: (google.cloud.bigquery.v2.GetDatasetRequest.DatasetView|keyof typeof google.cloud.bigquery.v2.GetDatasetRequest.DatasetView); + + /** GetDatasetRequest accessPolicyVersion. */ + public accessPolicyVersion: number; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetDatasetRequest): google.cloud.bigquery.v2.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetDatasetRequest; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetDatasetRequest; + + /** + * Verifies a GetDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetDatasetRequest; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetDatasetRequest { + + /** DatasetView enum. */ + enum DatasetView { + DATASET_VIEW_UNSPECIFIED = 0, + METADATA = 1, + ACL = 2, + FULL = 3 + } + } + + /** Properties of an InsertDatasetRequest. */ + interface IInsertDatasetRequest { + + /** InsertDatasetRequest projectId */ + projectId?: (string|null); + + /** InsertDatasetRequest dataset */ + dataset?: (google.cloud.bigquery.v2.IDataset|null); + + /** InsertDatasetRequest accessPolicyVersion */ + accessPolicyVersion?: (number|null); + } + + /** Represents an InsertDatasetRequest. */ + class InsertDatasetRequest implements IInsertDatasetRequest { + + /** + * Constructs a new InsertDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IInsertDatasetRequest); + + /** InsertDatasetRequest projectId. */ + public projectId: string; + + /** InsertDatasetRequest dataset. */ + public dataset?: (google.cloud.bigquery.v2.IDataset|null); + + /** InsertDatasetRequest accessPolicyVersion. */ + public accessPolicyVersion: number; + + /** + * Creates a new InsertDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertDatasetRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IInsertDatasetRequest): google.cloud.bigquery.v2.InsertDatasetRequest; + + /** + * Encodes the specified InsertDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertDatasetRequest.verify|verify} messages. + * @param message InsertDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IInsertDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertDatasetRequest.verify|verify} messages. + * @param message InsertDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IInsertDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.InsertDatasetRequest; + + /** + * Decodes an InsertDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.InsertDatasetRequest; + + /** + * Verifies an InsertDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.InsertDatasetRequest; + + /** + * Creates a plain object from an InsertDatasetRequest message. Also converts values to other types if specified. + * @param message InsertDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.InsertDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOrPatchDatasetRequest. */ + interface IUpdateOrPatchDatasetRequest { + + /** UpdateOrPatchDatasetRequest projectId */ + projectId?: (string|null); + + /** UpdateOrPatchDatasetRequest datasetId */ + datasetId?: (string|null); + + /** UpdateOrPatchDatasetRequest dataset */ + dataset?: (google.cloud.bigquery.v2.IDataset|null); + + /** UpdateOrPatchDatasetRequest updateMode */ + updateMode?: (google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode|keyof typeof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode|null); + + /** UpdateOrPatchDatasetRequest accessPolicyVersion */ + accessPolicyVersion?: (number|null); + } + + /** Represents an UpdateOrPatchDatasetRequest. */ + class UpdateOrPatchDatasetRequest implements IUpdateOrPatchDatasetRequest { + + /** + * Constructs a new UpdateOrPatchDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest); + + /** UpdateOrPatchDatasetRequest projectId. */ + public projectId: string; + + /** UpdateOrPatchDatasetRequest datasetId. */ + public datasetId: string; + + /** UpdateOrPatchDatasetRequest dataset. */ + public dataset?: (google.cloud.bigquery.v2.IDataset|null); + + /** UpdateOrPatchDatasetRequest updateMode. */ + public updateMode: (google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode|keyof typeof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode); + + /** UpdateOrPatchDatasetRequest accessPolicyVersion. */ + public accessPolicyVersion: number; + + /** + * Creates a new UpdateOrPatchDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrPatchDatasetRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest): google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest; + + /** + * Encodes the specified UpdateOrPatchDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.verify|verify} messages. + * @param message UpdateOrPatchDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrPatchDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.verify|verify} messages. + * @param message UpdateOrPatchDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrPatchDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrPatchDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest; + + /** + * Decodes an UpdateOrPatchDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrPatchDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest; + + /** + * Verifies an UpdateOrPatchDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrPatchDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrPatchDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest; + + /** + * Creates a plain object from an UpdateOrPatchDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateOrPatchDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrPatchDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrPatchDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpdateOrPatchDatasetRequest { + + /** UpdateMode enum. */ + enum UpdateMode { + UPDATE_MODE_UNSPECIFIED = 0, + UPDATE_METADATA = 1, + UPDATE_ACL = 2, + UPDATE_FULL = 3 + } + } + + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { + + /** DeleteDatasetRequest projectId */ + projectId?: (string|null); + + /** DeleteDatasetRequest datasetId */ + datasetId?: (string|null); + + /** DeleteDatasetRequest deleteContents */ + deleteContents?: (boolean|null); + } + + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { + + /** + * Constructs a new DeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteDatasetRequest); + + /** DeleteDatasetRequest projectId. */ + public projectId: string; + + /** DeleteDatasetRequest datasetId. */ + public datasetId: string; + + /** DeleteDatasetRequest deleteContents. */ + public deleteContents: boolean; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatasetRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteDatasetRequest): google.cloud.bigquery.v2.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteDatasetRequest; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteDatasetRequest; + + /** + * Verifies a DeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteDatasetRequest; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { + + /** ListDatasetsRequest projectId */ + projectId?: (string|null); + + /** ListDatasetsRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); + + /** ListDatasetsRequest all */ + all?: (boolean|null); + + /** ListDatasetsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { + + /** + * Constructs a new ListDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListDatasetsRequest); + + /** ListDatasetsRequest projectId. */ + public projectId: string; + + /** ListDatasetsRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; + + /** ListDatasetsRequest all. */ + public all: boolean; + + /** ListDatasetsRequest filter. */ + public filter: string; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListDatasetsRequest): google.cloud.bigquery.v2.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListDatasetsRequest; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListDatasetsRequest; + + /** + * Verifies a ListDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListDatasetsRequest; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFormatDataset. */ + interface IListFormatDataset { + + /** ListFormatDataset kind */ + kind?: (string|null); + + /** ListFormatDataset id */ + id?: (string|null); + + /** ListFormatDataset datasetReference */ + datasetReference?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** ListFormatDataset labels */ + labels?: ({ [k: string]: string }|null); + + /** ListFormatDataset friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** ListFormatDataset location */ + location?: (string|null); + + /** ListFormatDataset type */ + type?: (string|null); + + /** ListFormatDataset catalogSource */ + catalogSource?: (string|null); + + /** ListFormatDataset externalDatasetReference */ + externalDatasetReference?: (google.cloud.bigquery.v2.IExternalDatasetReference|null); + } + + /** Represents a ListFormatDataset. */ + class ListFormatDataset implements IListFormatDataset { + + /** + * Constructs a new ListFormatDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListFormatDataset); + + /** ListFormatDataset kind. */ + public kind: string; + + /** ListFormatDataset id. */ + public id: string; + + /** ListFormatDataset datasetReference. */ + public datasetReference?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** ListFormatDataset labels. */ + public labels: { [k: string]: string }; + + /** ListFormatDataset friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** ListFormatDataset location. */ + public location: string; + + /** ListFormatDataset type. */ + public type: string; + + /** ListFormatDataset catalogSource. */ + public catalogSource?: (string|null); + + /** ListFormatDataset externalDatasetReference. */ + public externalDatasetReference?: (google.cloud.bigquery.v2.IExternalDatasetReference|null); + + /** + * Creates a new ListFormatDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFormatDataset instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListFormatDataset): google.cloud.bigquery.v2.ListFormatDataset; + + /** + * Encodes the specified ListFormatDataset message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatDataset.verify|verify} messages. + * @param message ListFormatDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListFormatDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFormatDataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatDataset.verify|verify} messages. + * @param message ListFormatDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListFormatDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFormatDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFormatDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListFormatDataset; + + /** + * Decodes a ListFormatDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFormatDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListFormatDataset; + + /** + * Verifies a ListFormatDataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFormatDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFormatDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListFormatDataset; + + /** + * Creates a plain object from a ListFormatDataset message. Also converts values to other types if specified. + * @param message ListFormatDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListFormatDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFormatDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFormatDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatasetList. */ + interface IDatasetList { + + /** DatasetList kind */ + kind?: (string|null); + + /** DatasetList etag */ + etag?: (string|null); + + /** DatasetList nextPageToken */ + nextPageToken?: (string|null); + + /** DatasetList datasets */ + datasets?: (google.cloud.bigquery.v2.IListFormatDataset[]|null); + + /** DatasetList unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a DatasetList. */ + class DatasetList implements IDatasetList { + + /** + * Constructs a new DatasetList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDatasetList); + + /** DatasetList kind. */ + public kind: string; + + /** DatasetList etag. */ + public etag: string; + + /** DatasetList nextPageToken. */ + public nextPageToken: string; + + /** DatasetList datasets. */ + public datasets: google.cloud.bigquery.v2.IListFormatDataset[]; + + /** DatasetList unreachable. */ + public unreachable: string[]; + + /** + * Creates a new DatasetList instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetList instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDatasetList): google.cloud.bigquery.v2.DatasetList; + + /** + * Encodes the specified DatasetList message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetList.verify|verify} messages. + * @param message DatasetList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDatasetList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetList.verify|verify} messages. + * @param message DatasetList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDatasetList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DatasetList; + + /** + * Decodes a DatasetList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DatasetList; + + /** + * Verifies a DatasetList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DatasetList; + + /** + * Creates a plain object from a DatasetList message. Also converts values to other types if specified. + * @param message DatasetList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DatasetList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteDatasetRequest. */ + interface IUndeleteDatasetRequest { + + /** UndeleteDatasetRequest projectId */ + projectId?: (string|null); + + /** UndeleteDatasetRequest datasetId */ + datasetId?: (string|null); + + /** UndeleteDatasetRequest deletionTime */ + deletionTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UndeleteDatasetRequest. */ + class UndeleteDatasetRequest implements IUndeleteDatasetRequest { + + /** + * Constructs a new UndeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUndeleteDatasetRequest); + + /** UndeleteDatasetRequest projectId. */ + public projectId: string; + + /** UndeleteDatasetRequest datasetId. */ + public datasetId: string; + + /** UndeleteDatasetRequest deletionTime. */ + public deletionTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UndeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteDatasetRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUndeleteDatasetRequest): google.cloud.bigquery.v2.UndeleteDatasetRequest; + + /** + * Encodes the specified UndeleteDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UndeleteDatasetRequest.verify|verify} messages. + * @param message UndeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUndeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UndeleteDatasetRequest.verify|verify} messages. + * @param message UndeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUndeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UndeleteDatasetRequest; + + /** + * Decodes an UndeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UndeleteDatasetRequest; + + /** + * Verifies an UndeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UndeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UndeleteDatasetRequest; + + /** + * Creates a plain object from an UndeleteDatasetRequest message. Also converts values to other types if specified. + * @param message UndeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UndeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatasetReference. */ + interface IDatasetReference { + + /** DatasetReference datasetId */ + datasetId?: (string|null); + + /** DatasetReference projectId */ + projectId?: (string|null); + } + + /** Represents a DatasetReference. */ + class DatasetReference implements IDatasetReference { + + /** + * Constructs a new DatasetReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDatasetReference); + + /** DatasetReference datasetId. */ + public datasetId: string; + + /** DatasetReference projectId. */ + public projectId: string; + + /** + * Creates a new DatasetReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDatasetReference): google.cloud.bigquery.v2.DatasetReference; + + /** + * Encodes the specified DatasetReference message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetReference.verify|verify} messages. + * @param message DatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetReference.verify|verify} messages. + * @param message DatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DatasetReference; + + /** + * Decodes a DatasetReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DatasetReference; + + /** + * Verifies a DatasetReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DatasetReference; + + /** + * Creates a plain object from a DatasetReference message. Also converts values to other types if specified. + * @param message DatasetReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DatasetReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfiguration. */ + interface IEncryptionConfiguration { + + /** EncryptionConfiguration kmsKeyName */ + kmsKeyName?: (google.protobuf.IStringValue|null); + } + + /** Represents an EncryptionConfiguration. */ + class EncryptionConfiguration implements IEncryptionConfiguration { + + /** + * Constructs a new EncryptionConfiguration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IEncryptionConfiguration); + + /** EncryptionConfiguration kmsKeyName. */ + public kmsKeyName?: (google.protobuf.IStringValue|null); + + /** + * Creates a new EncryptionConfiguration instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfiguration instance + */ + public static create(properties?: google.cloud.bigquery.v2.IEncryptionConfiguration): google.cloud.bigquery.v2.EncryptionConfiguration; + + /** + * Encodes the specified EncryptionConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.EncryptionConfiguration.verify|verify} messages. + * @param message EncryptionConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IEncryptionConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.EncryptionConfiguration.verify|verify} messages. + * @param message EncryptionConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IEncryptionConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfiguration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.EncryptionConfiguration; + + /** + * Decodes an EncryptionConfiguration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.EncryptionConfiguration; + + /** + * Verifies an EncryptionConfiguration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfiguration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfiguration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.EncryptionConfiguration; + + /** + * Creates a plain object from an EncryptionConfiguration message. Also converts values to other types if specified. + * @param message EncryptionConfiguration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.EncryptionConfiguration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfiguration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfiguration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalCatalogDatasetOptions. */ + interface IExternalCatalogDatasetOptions { + + /** ExternalCatalogDatasetOptions parameters */ + parameters?: ({ [k: string]: string }|null); + + /** ExternalCatalogDatasetOptions defaultStorageLocationUri */ + defaultStorageLocationUri?: (string|null); + } + + /** Represents an ExternalCatalogDatasetOptions. */ + class ExternalCatalogDatasetOptions implements IExternalCatalogDatasetOptions { + + /** + * Constructs a new ExternalCatalogDatasetOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalCatalogDatasetOptions); + + /** ExternalCatalogDatasetOptions parameters. */ + public parameters: { [k: string]: string }; + + /** ExternalCatalogDatasetOptions defaultStorageLocationUri. */ + public defaultStorageLocationUri: string; + + /** + * Creates a new ExternalCatalogDatasetOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalCatalogDatasetOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalCatalogDatasetOptions): google.cloud.bigquery.v2.ExternalCatalogDatasetOptions; + + /** + * Encodes the specified ExternalCatalogDatasetOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.verify|verify} messages. + * @param message ExternalCatalogDatasetOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalCatalogDatasetOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalCatalogDatasetOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.verify|verify} messages. + * @param message ExternalCatalogDatasetOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalCatalogDatasetOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalCatalogDatasetOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalCatalogDatasetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalCatalogDatasetOptions; + + /** + * Decodes an ExternalCatalogDatasetOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalCatalogDatasetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalCatalogDatasetOptions; + + /** + * Verifies an ExternalCatalogDatasetOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalCatalogDatasetOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalCatalogDatasetOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalCatalogDatasetOptions; + + /** + * Creates a plain object from an ExternalCatalogDatasetOptions message. Also converts values to other types if specified. + * @param message ExternalCatalogDatasetOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalCatalogDatasetOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalCatalogDatasetOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalCatalogDatasetOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalDatasetReference. */ + interface IExternalDatasetReference { + + /** ExternalDatasetReference externalSource */ + externalSource?: (string|null); + + /** ExternalDatasetReference connection */ + connection?: (string|null); + } + + /** Represents an ExternalDatasetReference. */ + class ExternalDatasetReference implements IExternalDatasetReference { + + /** + * Constructs a new ExternalDatasetReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalDatasetReference); + + /** ExternalDatasetReference externalSource. */ + public externalSource: string; + + /** ExternalDatasetReference connection. */ + public connection: string; + + /** + * Creates a new ExternalDatasetReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalDatasetReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalDatasetReference): google.cloud.bigquery.v2.ExternalDatasetReference; + + /** + * Encodes the specified ExternalDatasetReference message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDatasetReference.verify|verify} messages. + * @param message ExternalDatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalDatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDatasetReference.verify|verify} messages. + * @param message ExternalDatasetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalDatasetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalDatasetReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalDatasetReference; + + /** + * Decodes an ExternalDatasetReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalDatasetReference; + + /** + * Verifies an ExternalDatasetReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalDatasetReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalDatasetReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalDatasetReference; + + /** + * Creates a plain object from an ExternalDatasetReference message. Also converts values to other types if specified. + * @param message ExternalDatasetReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalDatasetReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalDatasetReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalDatasetReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestrictionConfig. */ + interface IRestrictionConfig { + + /** RestrictionConfig type */ + type?: (google.cloud.bigquery.v2.RestrictionConfig.RestrictionType|keyof typeof google.cloud.bigquery.v2.RestrictionConfig.RestrictionType|null); + } + + /** Represents a RestrictionConfig. */ + class RestrictionConfig implements IRestrictionConfig { + + /** + * Constructs a new RestrictionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRestrictionConfig); + + /** RestrictionConfig type. */ + public type: (google.cloud.bigquery.v2.RestrictionConfig.RestrictionType|keyof typeof google.cloud.bigquery.v2.RestrictionConfig.RestrictionType); + + /** + * Creates a new RestrictionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictionConfig instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRestrictionConfig): google.cloud.bigquery.v2.RestrictionConfig; + + /** + * Encodes the specified RestrictionConfig message. Does not implicitly {@link google.cloud.bigquery.v2.RestrictionConfig.verify|verify} messages. + * @param message RestrictionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRestrictionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictionConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RestrictionConfig.verify|verify} messages. + * @param message RestrictionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRestrictionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RestrictionConfig; + + /** + * Decodes a RestrictionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RestrictionConfig; + + /** + * Verifies a RestrictionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RestrictionConfig; + + /** + * Creates a plain object from a RestrictionConfig message. Also converts values to other types if specified. + * @param message RestrictionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RestrictionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestrictionConfig { + + /** RestrictionType enum. */ + enum RestrictionType { + RESTRICTION_TYPE_UNSPECIFIED = 0, + RESTRICTED_DATA_EGRESS = 1 + } + } + + /** Properties of a RoutineReference. */ + interface IRoutineReference { + + /** RoutineReference projectId */ + projectId?: (string|null); + + /** RoutineReference datasetId */ + datasetId?: (string|null); + + /** RoutineReference routineId */ + routineId?: (string|null); + } + + /** Represents a RoutineReference. */ + class RoutineReference implements IRoutineReference { + + /** + * Constructs a new RoutineReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRoutineReference); + + /** RoutineReference projectId. */ + public projectId: string; + + /** RoutineReference datasetId. */ + public datasetId: string; + + /** RoutineReference routineId. */ + public routineId: string; + + /** + * Creates a new RoutineReference instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutineReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRoutineReference): google.cloud.bigquery.v2.RoutineReference; + + /** + * Encodes the specified RoutineReference message. Does not implicitly {@link google.cloud.bigquery.v2.RoutineReference.verify|verify} messages. + * @param message RoutineReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRoutineReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutineReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RoutineReference.verify|verify} messages. + * @param message RoutineReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRoutineReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutineReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutineReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RoutineReference; + + /** + * Decodes a RoutineReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutineReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RoutineReference; + + /** + * Verifies a RoutineReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutineReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutineReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RoutineReference; + + /** + * Creates a plain object from a RoutineReference message. Also converts values to other types if specified. + * @param message RoutineReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RoutineReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutineReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutineReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableReference. */ + interface ITableReference { + + /** TableReference projectId */ + projectId?: (string|null); + + /** TableReference datasetId */ + datasetId?: (string|null); + + /** TableReference tableId */ + tableId?: (string|null); + } + + /** Represents a TableReference. */ + class TableReference implements ITableReference { + + /** + * Constructs a new TableReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableReference); + + /** TableReference projectId. */ + public projectId: string; + + /** TableReference datasetId. */ + public datasetId: string; + + /** TableReference tableId. */ + public tableId: string; + + /** + * Creates a new TableReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableReference): google.cloud.bigquery.v2.TableReference; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.v2.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableReference; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableReference; + + /** + * Verifies a TableReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableReference; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @param message TableReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableSchema. */ + interface ITableSchema { + + /** TableSchema fields */ + fields?: (google.cloud.bigquery.v2.ITableFieldSchema[]|null); + + /** TableSchema foreignTypeInfo */ + foreignTypeInfo?: (google.cloud.bigquery.v2.IForeignTypeInfo|null); + } + + /** Represents a TableSchema. */ + class TableSchema implements ITableSchema { + + /** + * Constructs a new TableSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableSchema); + + /** TableSchema fields. */ + public fields: google.cloud.bigquery.v2.ITableFieldSchema[]; + + /** TableSchema foreignTypeInfo. */ + public foreignTypeInfo?: (google.cloud.bigquery.v2.IForeignTypeInfo|null); + + /** + * Creates a new TableSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableSchema instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableSchema): google.cloud.bigquery.v2.TableSchema; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.bigquery.v2.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableSchema; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableSchema; + + /** + * Verifies a TableSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableSchema; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @param message TableSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForeignTypeInfo. */ + interface IForeignTypeInfo { + + /** ForeignTypeInfo typeSystem */ + typeSystem?: (google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem|keyof typeof google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem|null); + } + + /** Represents a ForeignTypeInfo. */ + class ForeignTypeInfo implements IForeignTypeInfo { + + /** + * Constructs a new ForeignTypeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IForeignTypeInfo); + + /** ForeignTypeInfo typeSystem. */ + public typeSystem: (google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem|keyof typeof google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem); + + /** + * Creates a new ForeignTypeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ForeignTypeInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.IForeignTypeInfo): google.cloud.bigquery.v2.ForeignTypeInfo; + + /** + * Encodes the specified ForeignTypeInfo message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignTypeInfo.verify|verify} messages. + * @param message ForeignTypeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IForeignTypeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForeignTypeInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignTypeInfo.verify|verify} messages. + * @param message ForeignTypeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IForeignTypeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForeignTypeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForeignTypeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ForeignTypeInfo; + + /** + * Decodes a ForeignTypeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForeignTypeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ForeignTypeInfo; + + /** + * Verifies a ForeignTypeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForeignTypeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForeignTypeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ForeignTypeInfo; + + /** + * Creates a plain object from a ForeignTypeInfo message. Also converts values to other types if specified. + * @param message ForeignTypeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ForeignTypeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForeignTypeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForeignTypeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ForeignTypeInfo { + + /** TypeSystem enum. */ + enum TypeSystem { + TYPE_SYSTEM_UNSPECIFIED = 0, + HIVE = 1 + } + } + + /** Properties of a DataPolicyOption. */ + interface IDataPolicyOption { + + /** DataPolicyOption name */ + name?: (string|null); + } + + /** Represents a DataPolicyOption. */ + class DataPolicyOption implements IDataPolicyOption { + + /** + * Constructs a new DataPolicyOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDataPolicyOption); + + /** DataPolicyOption name. */ + public name?: (string|null); + + /** + * Creates a new DataPolicyOption instance using the specified properties. + * @param [properties] Properties to set + * @returns DataPolicyOption instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDataPolicyOption): google.cloud.bigquery.v2.DataPolicyOption; + + /** + * Encodes the specified DataPolicyOption message. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyOption.verify|verify} messages. + * @param message DataPolicyOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDataPolicyOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataPolicyOption message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyOption.verify|verify} messages. + * @param message DataPolicyOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDataPolicyOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataPolicyOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataPolicyOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DataPolicyOption; + + /** + * Decodes a DataPolicyOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataPolicyOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DataPolicyOption; + + /** + * Verifies a DataPolicyOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataPolicyOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataPolicyOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DataPolicyOption; + + /** + * Creates a plain object from a DataPolicyOption message. Also converts values to other types if specified. + * @param message DataPolicyOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DataPolicyOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataPolicyOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataPolicyOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataPolicyList. */ + interface IDataPolicyList { + + /** DataPolicyList dataPolicies */ + dataPolicies?: (google.cloud.bigquery.v2.IDataPolicyOption[]|null); + } + + /** Represents a DataPolicyList. */ + class DataPolicyList implements IDataPolicyList { + + /** + * Constructs a new DataPolicyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDataPolicyList); + + /** DataPolicyList dataPolicies. */ + public dataPolicies: google.cloud.bigquery.v2.IDataPolicyOption[]; + + /** + * Creates a new DataPolicyList instance using the specified properties. + * @param [properties] Properties to set + * @returns DataPolicyList instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDataPolicyList): google.cloud.bigquery.v2.DataPolicyList; + + /** + * Encodes the specified DataPolicyList message. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyList.verify|verify} messages. + * @param message DataPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDataPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataPolicyList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyList.verify|verify} messages. + * @param message DataPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDataPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataPolicyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DataPolicyList; + + /** + * Decodes a DataPolicyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DataPolicyList; + + /** + * Verifies a DataPolicyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataPolicyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataPolicyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DataPolicyList; + + /** + * Creates a plain object from a DataPolicyList message. Also converts values to other types if specified. + * @param message DataPolicyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DataPolicyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataPolicyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataPolicyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableFieldSchema. */ + interface ITableFieldSchema { + + /** TableFieldSchema name */ + name?: (string|null); + + /** TableFieldSchema type */ + type?: (string|null); + + /** TableFieldSchema mode */ + mode?: (string|null); + + /** TableFieldSchema fields */ + fields?: (google.cloud.bigquery.v2.ITableFieldSchema[]|null); + + /** TableFieldSchema description */ + description?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema policyTags */ + policyTags?: (google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList|null); + + /** TableFieldSchema dataGovernanceTagsInfo */ + dataGovernanceTagsInfo?: (google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo|null); + + /** TableFieldSchema dataPolicies */ + dataPolicies?: (google.cloud.bigquery.v2.IDataPolicyOption[]|null); + + /** TableFieldSchema dataPolicyList */ + dataPolicyList?: (google.cloud.bigquery.v2.IDataPolicyList|null); + + /** TableFieldSchema maxLength */ + maxLength?: (number|Long|string|null); + + /** TableFieldSchema precision */ + precision?: (number|Long|string|null); + + /** TableFieldSchema scale */ + scale?: (number|Long|string|null); + + /** TableFieldSchema timestampPrecision */ + timestampPrecision?: (google.protobuf.IInt64Value|null); + + /** TableFieldSchema roundingMode */ + roundingMode?: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null); + + /** TableFieldSchema collation */ + collation?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema defaultValueExpression */ + defaultValueExpression?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema rangeElementType */ + rangeElementType?: (google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType|null); + + /** TableFieldSchema foreignTypeDefinition */ + foreignTypeDefinition?: (string|null); + + /** TableFieldSchema generatedColumn */ + generatedColumn?: (google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn|null); + } + + /** Represents a TableFieldSchema. */ + class TableFieldSchema implements ITableFieldSchema { + + /** + * Constructs a new TableFieldSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableFieldSchema); + + /** TableFieldSchema name. */ + public name: string; + + /** TableFieldSchema type. */ + public type: string; + + /** TableFieldSchema mode. */ + public mode: string; + + /** TableFieldSchema fields. */ + public fields: google.cloud.bigquery.v2.ITableFieldSchema[]; + + /** TableFieldSchema description. */ + public description?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema policyTags. */ + public policyTags?: (google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList|null); + + /** TableFieldSchema dataGovernanceTagsInfo. */ + public dataGovernanceTagsInfo?: (google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo|null); + + /** TableFieldSchema dataPolicies. */ + public dataPolicies: google.cloud.bigquery.v2.IDataPolicyOption[]; + + /** TableFieldSchema dataPolicyList. */ + public dataPolicyList?: (google.cloud.bigquery.v2.IDataPolicyList|null); + + /** TableFieldSchema maxLength. */ + public maxLength: (number|Long|string); + + /** TableFieldSchema precision. */ + public precision: (number|Long|string); + + /** TableFieldSchema scale. */ + public scale: (number|Long|string); + + /** TableFieldSchema timestampPrecision. */ + public timestampPrecision?: (google.protobuf.IInt64Value|null); + + /** TableFieldSchema roundingMode. */ + public roundingMode: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode); + + /** TableFieldSchema collation. */ + public collation?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema defaultValueExpression. */ + public defaultValueExpression?: (google.protobuf.IStringValue|null); + + /** TableFieldSchema rangeElementType. */ + public rangeElementType?: (google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType|null); + + /** TableFieldSchema foreignTypeDefinition. */ + public foreignTypeDefinition: string; + + /** TableFieldSchema generatedColumn. */ + public generatedColumn?: (google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn|null); + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableFieldSchema instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableFieldSchema): google.cloud.bigquery.v2.TableFieldSchema; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema; + + /** + * Verifies a TableFieldSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableFieldSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @param message TableFieldSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableFieldSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableFieldSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TableFieldSchema { + + /** Properties of a PolicyTagList. */ + interface IPolicyTagList { + + /** PolicyTagList names */ + names?: (string[]|null); + } + + /** Represents a PolicyTagList. */ + class PolicyTagList implements IPolicyTagList { + + /** + * Constructs a new PolicyTagList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList); + + /** PolicyTagList names. */ + public names: string[]; + + /** + * Creates a new PolicyTagList instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyTagList instance + */ + public static create(properties?: google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList): google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList; + + /** + * Encodes the specified PolicyTagList message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.verify|verify} messages. + * @param message PolicyTagList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyTagList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.verify|verify} messages. + * @param message PolicyTagList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyTagList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyTagList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList; + + /** + * Decodes a PolicyTagList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyTagList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList; + + /** + * Verifies a PolicyTagList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyTagList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyTagList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList; + + /** + * Creates a plain object from a PolicyTagList message. Also converts values to other types if specified. + * @param message PolicyTagList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyTagList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyTagList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataGovernanceTagsInfo. */ + interface IDataGovernanceTagsInfo { + + /** DataGovernanceTagsInfo dataGovernanceTags */ + dataGovernanceTags?: ({ [k: string]: string }|null); + } + + /** Represents a DataGovernanceTagsInfo. */ + class DataGovernanceTagsInfo implements IDataGovernanceTagsInfo { + + /** + * Constructs a new DataGovernanceTagsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo); + + /** DataGovernanceTagsInfo dataGovernanceTags. */ + public dataGovernanceTags: { [k: string]: string }; + + /** + * Creates a new DataGovernanceTagsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DataGovernanceTagsInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo): google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo; + + /** + * Encodes the specified DataGovernanceTagsInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.verify|verify} messages. + * @param message DataGovernanceTagsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataGovernanceTagsInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.verify|verify} messages. + * @param message DataGovernanceTagsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataGovernanceTagsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataGovernanceTagsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo; + + /** + * Decodes a DataGovernanceTagsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataGovernanceTagsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo; + + /** + * Verifies a DataGovernanceTagsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataGovernanceTagsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataGovernanceTagsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo; + + /** + * Creates a plain object from a DataGovernanceTagsInfo message. Also converts values to other types if specified. + * @param message DataGovernanceTagsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataGovernanceTagsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataGovernanceTagsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RoundingMode enum. */ + enum RoundingMode { + ROUNDING_MODE_UNSPECIFIED = 0, + ROUND_HALF_AWAY_FROM_ZERO = 1, + ROUND_HALF_EVEN = 2 + } + + /** Properties of a FieldElementType. */ + interface IFieldElementType { + + /** FieldElementType type */ + type?: (string|null); + } + + /** Represents a FieldElementType. */ + class FieldElementType implements IFieldElementType { + + /** + * Constructs a new FieldElementType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType); + + /** FieldElementType type. */ + public type: string; + + /** + * Creates a new FieldElementType instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldElementType instance + */ + public static create(properties?: google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType): google.cloud.bigquery.v2.TableFieldSchema.FieldElementType; + + /** + * Encodes the specified FieldElementType message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.verify|verify} messages. + * @param message FieldElementType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldElementType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.verify|verify} messages. + * @param message FieldElementType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldElementType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldElementType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema.FieldElementType; + + /** + * Decodes a FieldElementType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldElementType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema.FieldElementType; + + /** + * Verifies a FieldElementType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldElementType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldElementType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema.FieldElementType; + + /** + * Creates a plain object from a FieldElementType message. Also converts values to other types if specified. + * @param message FieldElementType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema.FieldElementType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldElementType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldElementType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeneratedExpressionInfo. */ + interface IGeneratedExpressionInfo { + + /** GeneratedExpressionInfo generationExpression */ + generationExpression?: (string|null); + + /** GeneratedExpressionInfo asynchronous */ + asynchronous?: (boolean|null); + + /** GeneratedExpressionInfo stored */ + stored?: (boolean|null); + } + + /** Represents a GeneratedExpressionInfo. */ + class GeneratedExpressionInfo implements IGeneratedExpressionInfo { + + /** + * Constructs a new GeneratedExpressionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo); + + /** GeneratedExpressionInfo generationExpression. */ + public generationExpression?: (string|null); + + /** GeneratedExpressionInfo asynchronous. */ + public asynchronous?: (boolean|null); + + /** GeneratedExpressionInfo stored. */ + public stored?: (boolean|null); + + /** + * Creates a new GeneratedExpressionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedExpressionInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo): google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo; + + /** + * Encodes the specified GeneratedExpressionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.verify|verify} messages. + * @param message GeneratedExpressionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedExpressionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.verify|verify} messages. + * @param message GeneratedExpressionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedExpressionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedExpressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo; + + /** + * Decodes a GeneratedExpressionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedExpressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo; + + /** + * Verifies a GeneratedExpressionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedExpressionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedExpressionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo; + + /** + * Creates a plain object from a GeneratedExpressionInfo message. Also converts values to other types if specified. + * @param message GeneratedExpressionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedExpressionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedExpressionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GeneratedColumn. */ + interface IGeneratedColumn { + + /** GeneratedColumn generatedMode */ + generatedMode?: (google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|null); + + /** GeneratedColumn generatedExpressionInfo */ + generatedExpressionInfo?: (google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo|null); + } + + /** Represents a GeneratedColumn. */ + class GeneratedColumn implements IGeneratedColumn { + + /** + * Constructs a new GeneratedColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn); + + /** GeneratedColumn generatedMode. */ + public generatedMode?: (google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|null); + + /** GeneratedColumn generatedExpressionInfo. */ + public generatedExpressionInfo?: (google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo|null); + + /** GeneratedColumn definition. */ + public definition?: "generatedExpressionInfo"; + + /** + * Creates a new GeneratedColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedColumn instance + */ + public static create(properties?: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn): google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn; + + /** + * Encodes the specified GeneratedColumn message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.verify|verify} messages. + * @param message GeneratedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.verify|verify} messages. + * @param message GeneratedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn; + + /** + * Decodes a GeneratedColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn; + + /** + * Verifies a GeneratedColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn; + + /** + * Creates a plain object from a GeneratedColumn message. Also converts values to other types if specified. + * @param message GeneratedColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedColumn { + + /** GeneratedMode enum. */ + enum GeneratedMode { + GENERATED_MODE_UNSPECIFIED = 0, + GENERATED_ALWAYS = 1, + GENERATED_BY_DEFAULT = 2 + } + } + } + + /** DecimalTargetType enum. */ + enum DecimalTargetType { + DECIMAL_TARGET_TYPE_UNSPECIFIED = 0, + NUMERIC = 1, + BIGNUMERIC = 2, + STRING = 3 + } + + /** Properties of an ErrorProto. */ + interface IErrorProto { + + /** ErrorProto reason */ + reason?: (string|null); + + /** ErrorProto location */ + location?: (string|null); + + /** ErrorProto debugInfo */ + debugInfo?: (string|null); + + /** ErrorProto message */ + message?: (string|null); + } + + /** Represents an ErrorProto. */ + class ErrorProto implements IErrorProto { + + /** + * Constructs a new ErrorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IErrorProto); + + /** ErrorProto reason. */ + public reason: string; + + /** ErrorProto location. */ + public location: string; + + /** ErrorProto debugInfo. */ + public debugInfo: string; + + /** ErrorProto message. */ + public message: string; + + /** + * Creates a new ErrorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorProto instance + */ + public static create(properties?: google.cloud.bigquery.v2.IErrorProto): google.cloud.bigquery.v2.ErrorProto; + + /** + * Encodes the specified ErrorProto message. Does not implicitly {@link google.cloud.bigquery.v2.ErrorProto.verify|verify} messages. + * @param message ErrorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IErrorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorProto message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ErrorProto.verify|verify} messages. + * @param message ErrorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IErrorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ErrorProto; + + /** + * Decodes an ErrorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ErrorProto; + + /** + * Verifies an ErrorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorProto + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ErrorProto; + + /** + * Creates a plain object from an ErrorProto message. Also converts values to other types if specified. + * @param message ErrorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ErrorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalCatalogTableOptions. */ + interface IExternalCatalogTableOptions { + + /** ExternalCatalogTableOptions parameters */ + parameters?: ({ [k: string]: string }|null); + + /** ExternalCatalogTableOptions storageDescriptor */ + storageDescriptor?: (google.cloud.bigquery.v2.IStorageDescriptor|null); + + /** ExternalCatalogTableOptions connectionId */ + connectionId?: (string|null); + } + + /** Represents an ExternalCatalogTableOptions. */ + class ExternalCatalogTableOptions implements IExternalCatalogTableOptions { + + /** + * Constructs a new ExternalCatalogTableOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalCatalogTableOptions); + + /** ExternalCatalogTableOptions parameters. */ + public parameters: { [k: string]: string }; + + /** ExternalCatalogTableOptions storageDescriptor. */ + public storageDescriptor?: (google.cloud.bigquery.v2.IStorageDescriptor|null); + + /** ExternalCatalogTableOptions connectionId. */ + public connectionId: string; + + /** + * Creates a new ExternalCatalogTableOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalCatalogTableOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalCatalogTableOptions): google.cloud.bigquery.v2.ExternalCatalogTableOptions; + + /** + * Encodes the specified ExternalCatalogTableOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogTableOptions.verify|verify} messages. + * @param message ExternalCatalogTableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalCatalogTableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalCatalogTableOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogTableOptions.verify|verify} messages. + * @param message ExternalCatalogTableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalCatalogTableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalCatalogTableOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalCatalogTableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalCatalogTableOptions; + + /** + * Decodes an ExternalCatalogTableOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalCatalogTableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalCatalogTableOptions; + + /** + * Verifies an ExternalCatalogTableOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalCatalogTableOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalCatalogTableOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalCatalogTableOptions; + + /** + * Creates a plain object from an ExternalCatalogTableOptions message. Also converts values to other types if specified. + * @param message ExternalCatalogTableOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalCatalogTableOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalCatalogTableOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalCatalogTableOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StorageDescriptor. */ + interface IStorageDescriptor { + + /** StorageDescriptor locationUri */ + locationUri?: (string|null); + + /** StorageDescriptor inputFormat */ + inputFormat?: (string|null); + + /** StorageDescriptor outputFormat */ + outputFormat?: (string|null); + + /** StorageDescriptor serdeInfo */ + serdeInfo?: (google.cloud.bigquery.v2.ISerDeInfo|null); + } + + /** Represents a StorageDescriptor. */ + class StorageDescriptor implements IStorageDescriptor { + + /** + * Constructs a new StorageDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStorageDescriptor); + + /** StorageDescriptor locationUri. */ + public locationUri: string; + + /** StorageDescriptor inputFormat. */ + public inputFormat: string; + + /** StorageDescriptor outputFormat. */ + public outputFormat: string; + + /** StorageDescriptor serdeInfo. */ + public serdeInfo?: (google.cloud.bigquery.v2.ISerDeInfo|null); + + /** + * Creates a new StorageDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageDescriptor instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStorageDescriptor): google.cloud.bigquery.v2.StorageDescriptor; + + /** + * Encodes the specified StorageDescriptor message. Does not implicitly {@link google.cloud.bigquery.v2.StorageDescriptor.verify|verify} messages. + * @param message StorageDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStorageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageDescriptor message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StorageDescriptor.verify|verify} messages. + * @param message StorageDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStorageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StorageDescriptor; + + /** + * Decodes a StorageDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StorageDescriptor; + + /** + * Verifies a StorageDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StorageDescriptor; + + /** + * Creates a plain object from a StorageDescriptor message. Also converts values to other types if specified. + * @param message StorageDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StorageDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SerDeInfo. */ + interface ISerDeInfo { + + /** SerDeInfo name */ + name?: (string|null); + + /** SerDeInfo serializationLibrary */ + serializationLibrary?: (string|null); + + /** SerDeInfo parameters */ + parameters?: ({ [k: string]: string }|null); + } + + /** Represents a SerDeInfo. */ + class SerDeInfo implements ISerDeInfo { + + /** + * Constructs a new SerDeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISerDeInfo); + + /** SerDeInfo name. */ + public name: string; + + /** SerDeInfo serializationLibrary. */ + public serializationLibrary: string; + + /** SerDeInfo parameters. */ + public parameters: { [k: string]: string }; + + /** + * Creates a new SerDeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SerDeInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISerDeInfo): google.cloud.bigquery.v2.SerDeInfo; + + /** + * Encodes the specified SerDeInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SerDeInfo.verify|verify} messages. + * @param message SerDeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISerDeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerDeInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SerDeInfo.verify|verify} messages. + * @param message SerDeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISerDeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerDeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerDeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SerDeInfo; + + /** + * Decodes a SerDeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerDeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SerDeInfo; + + /** + * Verifies a SerDeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerDeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerDeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SerDeInfo; + + /** + * Creates a plain object from a SerDeInfo message. Also converts values to other types if specified. + * @param message SerDeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SerDeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerDeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SerDeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AvroOptions. */ + interface IAvroOptions { + + /** AvroOptions useAvroLogicalTypes */ + useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + } + + /** Represents an AvroOptions. */ + class AvroOptions implements IAvroOptions { + + /** + * Constructs a new AvroOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IAvroOptions); + + /** AvroOptions useAvroLogicalTypes. */ + public useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new AvroOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IAvroOptions): google.cloud.bigquery.v2.AvroOptions; + + /** + * Encodes the specified AvroOptions message. Does not implicitly {@link google.cloud.bigquery.v2.AvroOptions.verify|verify} messages. + * @param message AvroOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IAvroOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.AvroOptions.verify|verify} messages. + * @param message AvroOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IAvroOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.AvroOptions; + + /** + * Decodes an AvroOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.AvroOptions; + + /** + * Verifies an AvroOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvroOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.AvroOptions; + + /** + * Creates a plain object from an AvroOptions message. Also converts values to other types if specified. + * @param message AvroOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.AvroOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ParquetOptions. */ + interface IParquetOptions { + + /** ParquetOptions enumAsString */ + enumAsString?: (google.protobuf.IBoolValue|null); + + /** ParquetOptions enableListInference */ + enableListInference?: (google.protobuf.IBoolValue|null); + + /** ParquetOptions mapTargetType */ + mapTargetType?: (google.cloud.bigquery.v2.MapTargetType|keyof typeof google.cloud.bigquery.v2.MapTargetType|null); + } + + /** Represents a ParquetOptions. */ + class ParquetOptions implements IParquetOptions { + + /** + * Constructs a new ParquetOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IParquetOptions); + + /** ParquetOptions enumAsString. */ + public enumAsString?: (google.protobuf.IBoolValue|null); + + /** ParquetOptions enableListInference. */ + public enableListInference?: (google.protobuf.IBoolValue|null); + + /** ParquetOptions mapTargetType. */ + public mapTargetType: (google.cloud.bigquery.v2.MapTargetType|keyof typeof google.cloud.bigquery.v2.MapTargetType); + + /** + * Creates a new ParquetOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ParquetOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IParquetOptions): google.cloud.bigquery.v2.ParquetOptions; + + /** + * Encodes the specified ParquetOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ParquetOptions.verify|verify} messages. + * @param message ParquetOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IParquetOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParquetOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ParquetOptions.verify|verify} messages. + * @param message ParquetOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IParquetOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParquetOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParquetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ParquetOptions; + + /** + * Decodes a ParquetOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParquetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ParquetOptions; + + /** + * Verifies a ParquetOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ParquetOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParquetOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ParquetOptions; + + /** + * Creates a plain object from a ParquetOptions message. Also converts values to other types if specified. + * @param message ParquetOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ParquetOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParquetOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParquetOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CsvOptions. */ + interface ICsvOptions { + + /** CsvOptions fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** CsvOptions skipLeadingRows */ + skipLeadingRows?: (google.protobuf.IInt64Value|null); + + /** CsvOptions quote */ + quote?: (google.protobuf.IStringValue|null); + + /** CsvOptions allowQuotedNewlines */ + allowQuotedNewlines?: (google.protobuf.IBoolValue|null); + + /** CsvOptions allowJaggedRows */ + allowJaggedRows?: (google.protobuf.IBoolValue|null); + + /** CsvOptions encoding */ + encoding?: (string|null); + + /** CsvOptions preserveAsciiControlCharacters */ + preserveAsciiControlCharacters?: (google.protobuf.IBoolValue|null); + + /** CsvOptions nullMarker */ + nullMarker?: (google.protobuf.IStringValue|null); + + /** CsvOptions nullMarkers */ + nullMarkers?: (string[]|null); + + /** CsvOptions sourceColumnMatch */ + sourceColumnMatch?: (string|null); + } + + /** Represents a CsvOptions. */ + class CsvOptions implements ICsvOptions { + + /** + * Constructs a new CsvOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ICsvOptions); + + /** CsvOptions fieldDelimiter. */ + public fieldDelimiter: string; + + /** CsvOptions skipLeadingRows. */ + public skipLeadingRows?: (google.protobuf.IInt64Value|null); + + /** CsvOptions quote. */ + public quote?: (google.protobuf.IStringValue|null); + + /** CsvOptions allowQuotedNewlines. */ + public allowQuotedNewlines?: (google.protobuf.IBoolValue|null); + + /** CsvOptions allowJaggedRows. */ + public allowJaggedRows?: (google.protobuf.IBoolValue|null); + + /** CsvOptions encoding. */ + public encoding: string; + + /** CsvOptions preserveAsciiControlCharacters. */ + public preserveAsciiControlCharacters?: (google.protobuf.IBoolValue|null); + + /** CsvOptions nullMarker. */ + public nullMarker?: (google.protobuf.IStringValue|null); + + /** CsvOptions nullMarkers. */ + public nullMarkers: string[]; + + /** CsvOptions sourceColumnMatch. */ + public sourceColumnMatch: string; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CsvOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.ICsvOptions): google.cloud.bigquery.v2.CsvOptions; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.bigquery.v2.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CsvOptions.verify|verify} messages. + * @param message CsvOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ICsvOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.CsvOptions; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.CsvOptions; + + /** + * Verifies a CsvOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CsvOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.CsvOptions; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @param message CsvOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.CsvOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CsvOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CsvOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JsonOptions. */ + interface IJsonOptions { + + /** JsonOptions encoding */ + encoding?: (string|null); + } + + /** Represents a JsonOptions. */ + class JsonOptions implements IJsonOptions { + + /** + * Constructs a new JsonOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJsonOptions); + + /** JsonOptions encoding. */ + public encoding: string; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns JsonOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJsonOptions): google.cloud.bigquery.v2.JsonOptions; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.bigquery.v2.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JsonOptions.verify|verify} messages. + * @param message JsonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJsonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JsonOptions; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JsonOptions; + + /** + * Verifies a JsonOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JsonOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JsonOptions; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @param message JsonOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JsonOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JsonOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JsonOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigtableProtoConfig. */ + interface IBigtableProtoConfig { + + /** BigtableProtoConfig schemaBundleId */ + schemaBundleId?: (string|null); + + /** BigtableProtoConfig protoMessageName */ + protoMessageName?: (string|null); + } + + /** Represents a BigtableProtoConfig. */ + class BigtableProtoConfig implements IBigtableProtoConfig { + + /** + * Constructs a new BigtableProtoConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBigtableProtoConfig); + + /** BigtableProtoConfig schemaBundleId. */ + public schemaBundleId: string; + + /** BigtableProtoConfig protoMessageName. */ + public protoMessageName: string; + + /** + * Creates a new BigtableProtoConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableProtoConfig instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBigtableProtoConfig): google.cloud.bigquery.v2.BigtableProtoConfig; + + /** + * Encodes the specified BigtableProtoConfig message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableProtoConfig.verify|verify} messages. + * @param message BigtableProtoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBigtableProtoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableProtoConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableProtoConfig.verify|verify} messages. + * @param message BigtableProtoConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBigtableProtoConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableProtoConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableProtoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BigtableProtoConfig; + + /** + * Decodes a BigtableProtoConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableProtoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BigtableProtoConfig; + + /** + * Verifies a BigtableProtoConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableProtoConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableProtoConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BigtableProtoConfig; + + /** + * Creates a plain object from a BigtableProtoConfig message. Also converts values to other types if specified. + * @param message BigtableProtoConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BigtableProtoConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableProtoConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableProtoConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigtableColumn. */ + interface IBigtableColumn { + + /** BigtableColumn qualifierEncoded */ + qualifierEncoded?: (google.protobuf.IBytesValue|null); + + /** BigtableColumn qualifierString */ + qualifierString?: (google.protobuf.IStringValue|null); + + /** BigtableColumn fieldName */ + fieldName?: (string|null); + + /** BigtableColumn type */ + type?: (string|null); + + /** BigtableColumn encoding */ + encoding?: (string|null); + + /** BigtableColumn onlyReadLatest */ + onlyReadLatest?: (google.protobuf.IBoolValue|null); + + /** BigtableColumn protoConfig */ + protoConfig?: (google.cloud.bigquery.v2.IBigtableProtoConfig|null); + } + + /** Represents a BigtableColumn. */ + class BigtableColumn implements IBigtableColumn { + + /** + * Constructs a new BigtableColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBigtableColumn); + + /** BigtableColumn qualifierEncoded. */ + public qualifierEncoded?: (google.protobuf.IBytesValue|null); + + /** BigtableColumn qualifierString. */ + public qualifierString?: (google.protobuf.IStringValue|null); + + /** BigtableColumn fieldName. */ + public fieldName: string; + + /** BigtableColumn type. */ + public type: string; + + /** BigtableColumn encoding. */ + public encoding: string; + + /** BigtableColumn onlyReadLatest. */ + public onlyReadLatest?: (google.protobuf.IBoolValue|null); + + /** BigtableColumn protoConfig. */ + public protoConfig?: (google.cloud.bigquery.v2.IBigtableProtoConfig|null); + + /** + * Creates a new BigtableColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableColumn instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBigtableColumn): google.cloud.bigquery.v2.BigtableColumn; + + /** + * Encodes the specified BigtableColumn message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumn.verify|verify} messages. + * @param message BigtableColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBigtableColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumn.verify|verify} messages. + * @param message BigtableColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBigtableColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BigtableColumn; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BigtableColumn; + + /** + * Verifies a BigtableColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BigtableColumn; + + /** + * Creates a plain object from a BigtableColumn message. Also converts values to other types if specified. + * @param message BigtableColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BigtableColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigtableColumnFamily. */ + interface IBigtableColumnFamily { + + /** BigtableColumnFamily familyId */ + familyId?: (string|null); + + /** BigtableColumnFamily type */ + type?: (string|null); + + /** BigtableColumnFamily encoding */ + encoding?: (string|null); + + /** BigtableColumnFamily columns */ + columns?: (google.cloud.bigquery.v2.IBigtableColumn[]|null); + + /** BigtableColumnFamily onlyReadLatest */ + onlyReadLatest?: (google.protobuf.IBoolValue|null); + + /** BigtableColumnFamily protoConfig */ + protoConfig?: (google.cloud.bigquery.v2.IBigtableProtoConfig|null); + } + + /** Represents a BigtableColumnFamily. */ + class BigtableColumnFamily implements IBigtableColumnFamily { + + /** + * Constructs a new BigtableColumnFamily. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBigtableColumnFamily); + + /** BigtableColumnFamily familyId. */ + public familyId: string; + + /** BigtableColumnFamily type. */ + public type: string; + + /** BigtableColumnFamily encoding. */ + public encoding: string; + + /** BigtableColumnFamily columns. */ + public columns: google.cloud.bigquery.v2.IBigtableColumn[]; + + /** BigtableColumnFamily onlyReadLatest. */ + public onlyReadLatest?: (google.protobuf.IBoolValue|null); + + /** BigtableColumnFamily protoConfig. */ + public protoConfig?: (google.cloud.bigquery.v2.IBigtableProtoConfig|null); + + /** + * Creates a new BigtableColumnFamily instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableColumnFamily instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBigtableColumnFamily): google.cloud.bigquery.v2.BigtableColumnFamily; + + /** + * Encodes the specified BigtableColumnFamily message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumnFamily.verify|verify} messages. + * @param message BigtableColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBigtableColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableColumnFamily message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumnFamily.verify|verify} messages. + * @param message BigtableColumnFamily message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBigtableColumnFamily, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BigtableColumnFamily; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BigtableColumnFamily; + + /** + * Verifies a BigtableColumnFamily message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableColumnFamily message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableColumnFamily + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BigtableColumnFamily; + + /** + * Creates a plain object from a BigtableColumnFamily message. Also converts values to other types if specified. + * @param message BigtableColumnFamily + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BigtableColumnFamily, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableColumnFamily to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableColumnFamily + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigtableOptions. */ + interface IBigtableOptions { + + /** BigtableOptions columnFamilies */ + columnFamilies?: (google.cloud.bigquery.v2.IBigtableColumnFamily[]|null); + + /** BigtableOptions ignoreUnspecifiedColumnFamilies */ + ignoreUnspecifiedColumnFamilies?: (google.protobuf.IBoolValue|null); + + /** BigtableOptions readRowkeyAsString */ + readRowkeyAsString?: (google.protobuf.IBoolValue|null); + + /** BigtableOptions outputColumnFamiliesAsJson */ + outputColumnFamiliesAsJson?: (google.protobuf.IBoolValue|null); + } + + /** Represents a BigtableOptions. */ + class BigtableOptions implements IBigtableOptions { + + /** + * Constructs a new BigtableOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBigtableOptions); + + /** BigtableOptions columnFamilies. */ + public columnFamilies: google.cloud.bigquery.v2.IBigtableColumnFamily[]; + + /** BigtableOptions ignoreUnspecifiedColumnFamilies. */ + public ignoreUnspecifiedColumnFamilies?: (google.protobuf.IBoolValue|null); + + /** BigtableOptions readRowkeyAsString. */ + public readRowkeyAsString?: (google.protobuf.IBoolValue|null); + + /** BigtableOptions outputColumnFamiliesAsJson. */ + public outputColumnFamiliesAsJson?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new BigtableOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BigtableOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBigtableOptions): google.cloud.bigquery.v2.BigtableOptions; + + /** + * Encodes the specified BigtableOptions message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableOptions.verify|verify} messages. + * @param message BigtableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBigtableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigtableOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableOptions.verify|verify} messages. + * @param message BigtableOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBigtableOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigtableOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigtableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BigtableOptions; + + /** + * Decodes a BigtableOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigtableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BigtableOptions; + + /** + * Verifies a BigtableOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigtableOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigtableOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BigtableOptions; + + /** + * Creates a plain object from a BigtableOptions message. Also converts values to other types if specified. + * @param message BigtableOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BigtableOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigtableOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigtableOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoogleSheetsOptions. */ + interface IGoogleSheetsOptions { + + /** GoogleSheetsOptions skipLeadingRows */ + skipLeadingRows?: (google.protobuf.IInt64Value|null); + + /** GoogleSheetsOptions range */ + range?: (string|null); + } + + /** Represents a GoogleSheetsOptions. */ + class GoogleSheetsOptions implements IGoogleSheetsOptions { + + /** + * Constructs a new GoogleSheetsOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGoogleSheetsOptions); + + /** GoogleSheetsOptions skipLeadingRows. */ + public skipLeadingRows?: (google.protobuf.IInt64Value|null); + + /** GoogleSheetsOptions range. */ + public range: string; + + /** + * Creates a new GoogleSheetsOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSheetsOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGoogleSheetsOptions): google.cloud.bigquery.v2.GoogleSheetsOptions; + + /** + * Encodes the specified GoogleSheetsOptions message. Does not implicitly {@link google.cloud.bigquery.v2.GoogleSheetsOptions.verify|verify} messages. + * @param message GoogleSheetsOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGoogleSheetsOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSheetsOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GoogleSheetsOptions.verify|verify} messages. + * @param message GoogleSheetsOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGoogleSheetsOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSheetsOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSheetsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GoogleSheetsOptions; + + /** + * Decodes a GoogleSheetsOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSheetsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GoogleSheetsOptions; + + /** + * Verifies a GoogleSheetsOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSheetsOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSheetsOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GoogleSheetsOptions; + + /** + * Creates a plain object from a GoogleSheetsOptions message. Also converts values to other types if specified. + * @param message GoogleSheetsOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GoogleSheetsOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSheetsOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSheetsOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalDataConfiguration. */ + interface IExternalDataConfiguration { + + /** ExternalDataConfiguration sourceUris */ + sourceUris?: (string[]|null); + + /** ExternalDataConfiguration fileSetSpecType */ + fileSetSpecType?: (google.cloud.bigquery.v2.FileSetSpecType|keyof typeof google.cloud.bigquery.v2.FileSetSpecType|null); + + /** ExternalDataConfiguration schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** ExternalDataConfiguration sourceFormat */ + sourceFormat?: (string|null); + + /** ExternalDataConfiguration maxBadRecords */ + maxBadRecords?: (google.protobuf.IInt32Value|null); + + /** ExternalDataConfiguration autodetect */ + autodetect?: (google.protobuf.IBoolValue|null); + + /** ExternalDataConfiguration ignoreUnknownValues */ + ignoreUnknownValues?: (google.protobuf.IBoolValue|null); + + /** ExternalDataConfiguration compression */ + compression?: (string|null); + + /** ExternalDataConfiguration csvOptions */ + csvOptions?: (google.cloud.bigquery.v2.ICsvOptions|null); + + /** ExternalDataConfiguration jsonOptions */ + jsonOptions?: (google.cloud.bigquery.v2.IJsonOptions|null); + + /** ExternalDataConfiguration bigtableOptions */ + bigtableOptions?: (google.cloud.bigquery.v2.IBigtableOptions|null); + + /** ExternalDataConfiguration googleSheetsOptions */ + googleSheetsOptions?: (google.cloud.bigquery.v2.IGoogleSheetsOptions|null); + + /** ExternalDataConfiguration hivePartitioningOptions */ + hivePartitioningOptions?: (google.cloud.bigquery.v2.IHivePartitioningOptions|null); + + /** ExternalDataConfiguration connectionId */ + connectionId?: (string|null); + + /** ExternalDataConfiguration decimalTargetTypes */ + decimalTargetTypes?: (google.cloud.bigquery.v2.DecimalTargetType[]|null); + + /** ExternalDataConfiguration avroOptions */ + avroOptions?: (google.cloud.bigquery.v2.IAvroOptions|null); + + /** ExternalDataConfiguration jsonExtension */ + jsonExtension?: (google.cloud.bigquery.v2.JsonExtension|keyof typeof google.cloud.bigquery.v2.JsonExtension|null); + + /** ExternalDataConfiguration parquetOptions */ + parquetOptions?: (google.cloud.bigquery.v2.IParquetOptions|null); + + /** ExternalDataConfiguration objectMetadata */ + objectMetadata?: (google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|keyof typeof google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|null); + + /** ExternalDataConfiguration referenceFileSchemaUri */ + referenceFileSchemaUri?: (google.protobuf.IStringValue|null); + + /** ExternalDataConfiguration metadataCacheMode */ + metadataCacheMode?: (google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode|keyof typeof google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode|null); + + /** ExternalDataConfiguration timeZone */ + timeZone?: (string|null); + + /** ExternalDataConfiguration dateFormat */ + dateFormat?: (string|null); + + /** ExternalDataConfiguration datetimeFormat */ + datetimeFormat?: (string|null); + + /** ExternalDataConfiguration timeFormat */ + timeFormat?: (string|null); + + /** ExternalDataConfiguration timestampFormat */ + timestampFormat?: (string|null); + + /** ExternalDataConfiguration timestampTargetPrecision */ + timestampTargetPrecision?: (number[]|null); + } + + /** Represents an ExternalDataConfiguration. */ + class ExternalDataConfiguration implements IExternalDataConfiguration { + + /** + * Constructs a new ExternalDataConfiguration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalDataConfiguration); + + /** ExternalDataConfiguration sourceUris. */ + public sourceUris: string[]; + + /** ExternalDataConfiguration fileSetSpecType. */ + public fileSetSpecType: (google.cloud.bigquery.v2.FileSetSpecType|keyof typeof google.cloud.bigquery.v2.FileSetSpecType); + + /** ExternalDataConfiguration schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** ExternalDataConfiguration sourceFormat. */ + public sourceFormat: string; + + /** ExternalDataConfiguration maxBadRecords. */ + public maxBadRecords?: (google.protobuf.IInt32Value|null); + + /** ExternalDataConfiguration autodetect. */ + public autodetect?: (google.protobuf.IBoolValue|null); + + /** ExternalDataConfiguration ignoreUnknownValues. */ + public ignoreUnknownValues?: (google.protobuf.IBoolValue|null); + + /** ExternalDataConfiguration compression. */ + public compression: string; + + /** ExternalDataConfiguration csvOptions. */ + public csvOptions?: (google.cloud.bigquery.v2.ICsvOptions|null); + + /** ExternalDataConfiguration jsonOptions. */ + public jsonOptions?: (google.cloud.bigquery.v2.IJsonOptions|null); + + /** ExternalDataConfiguration bigtableOptions. */ + public bigtableOptions?: (google.cloud.bigquery.v2.IBigtableOptions|null); + + /** ExternalDataConfiguration googleSheetsOptions. */ + public googleSheetsOptions?: (google.cloud.bigquery.v2.IGoogleSheetsOptions|null); + + /** ExternalDataConfiguration hivePartitioningOptions. */ + public hivePartitioningOptions?: (google.cloud.bigquery.v2.IHivePartitioningOptions|null); + + /** ExternalDataConfiguration connectionId. */ + public connectionId: string; + + /** ExternalDataConfiguration decimalTargetTypes. */ + public decimalTargetTypes: google.cloud.bigquery.v2.DecimalTargetType[]; + + /** ExternalDataConfiguration avroOptions. */ + public avroOptions?: (google.cloud.bigquery.v2.IAvroOptions|null); + + /** ExternalDataConfiguration jsonExtension. */ + public jsonExtension: (google.cloud.bigquery.v2.JsonExtension|keyof typeof google.cloud.bigquery.v2.JsonExtension); + + /** ExternalDataConfiguration parquetOptions. */ + public parquetOptions?: (google.cloud.bigquery.v2.IParquetOptions|null); + + /** ExternalDataConfiguration objectMetadata. */ + public objectMetadata?: (google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|keyof typeof google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|null); + + /** ExternalDataConfiguration referenceFileSchemaUri. */ + public referenceFileSchemaUri?: (google.protobuf.IStringValue|null); + + /** ExternalDataConfiguration metadataCacheMode. */ + public metadataCacheMode: (google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode|keyof typeof google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode); + + /** ExternalDataConfiguration timeZone. */ + public timeZone?: (string|null); + + /** ExternalDataConfiguration dateFormat. */ + public dateFormat?: (string|null); + + /** ExternalDataConfiguration datetimeFormat. */ + public datetimeFormat?: (string|null); + + /** ExternalDataConfiguration timeFormat. */ + public timeFormat?: (string|null); + + /** ExternalDataConfiguration timestampFormat. */ + public timestampFormat?: (string|null); + + /** ExternalDataConfiguration timestampTargetPrecision. */ + public timestampTargetPrecision: number[]; + + /** + * Creates a new ExternalDataConfiguration instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalDataConfiguration instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalDataConfiguration): google.cloud.bigquery.v2.ExternalDataConfiguration; + + /** + * Encodes the specified ExternalDataConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDataConfiguration.verify|verify} messages. + * @param message ExternalDataConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalDataConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalDataConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDataConfiguration.verify|verify} messages. + * @param message ExternalDataConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalDataConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalDataConfiguration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalDataConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalDataConfiguration; + + /** + * Decodes an ExternalDataConfiguration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalDataConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalDataConfiguration; + + /** + * Verifies an ExternalDataConfiguration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalDataConfiguration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalDataConfiguration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalDataConfiguration; + + /** + * Creates a plain object from an ExternalDataConfiguration message. Also converts values to other types if specified. + * @param message ExternalDataConfiguration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalDataConfiguration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalDataConfiguration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalDataConfiguration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExternalDataConfiguration { + + /** ObjectMetadata enum. */ + enum ObjectMetadata { + OBJECT_METADATA_UNSPECIFIED = 0, + DIRECTORY = 1, + SIMPLE = 2 + } + + /** MetadataCacheMode enum. */ + enum MetadataCacheMode { + METADATA_CACHE_MODE_UNSPECIFIED = 0, + AUTOMATIC = 1, + MANUAL = 2 + } + } + + /** FileSetSpecType enum. */ + enum FileSetSpecType { + FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH = 0, + FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST = 1 + } + + /** Properties of a HivePartitioningOptions. */ + interface IHivePartitioningOptions { + + /** HivePartitioningOptions mode */ + mode?: (string|null); + + /** HivePartitioningOptions sourceUriPrefix */ + sourceUriPrefix?: (string|null); + + /** HivePartitioningOptions requirePartitionFilter */ + requirePartitionFilter?: (google.protobuf.IBoolValue|null); + + /** HivePartitioningOptions fields */ + fields?: (string[]|null); + } + + /** Represents a HivePartitioningOptions. */ + class HivePartitioningOptions implements IHivePartitioningOptions { + + /** + * Constructs a new HivePartitioningOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IHivePartitioningOptions); + + /** HivePartitioningOptions mode. */ + public mode: string; + + /** HivePartitioningOptions sourceUriPrefix. */ + public sourceUriPrefix: string; + + /** HivePartitioningOptions requirePartitionFilter. */ + public requirePartitionFilter?: (google.protobuf.IBoolValue|null); + + /** HivePartitioningOptions fields. */ + public fields: string[]; + + /** + * Creates a new HivePartitioningOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns HivePartitioningOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IHivePartitioningOptions): google.cloud.bigquery.v2.HivePartitioningOptions; + + /** + * Encodes the specified HivePartitioningOptions message. Does not implicitly {@link google.cloud.bigquery.v2.HivePartitioningOptions.verify|verify} messages. + * @param message HivePartitioningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IHivePartitioningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HivePartitioningOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.HivePartitioningOptions.verify|verify} messages. + * @param message HivePartitioningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IHivePartitioningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HivePartitioningOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HivePartitioningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.HivePartitioningOptions; + + /** + * Decodes a HivePartitioningOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HivePartitioningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.HivePartitioningOptions; + + /** + * Verifies a HivePartitioningOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HivePartitioningOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HivePartitioningOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.HivePartitioningOptions; + + /** + * Creates a plain object from a HivePartitioningOptions message. Also converts values to other types if specified. + * @param message HivePartitioningOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.HivePartitioningOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HivePartitioningOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HivePartitioningOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JsonExtension enum. */ + enum JsonExtension { + JSON_EXTENSION_UNSPECIFIED = 0, + GEOJSON = 1 + } + + /** MapTargetType enum. */ + enum MapTargetType { + MAP_TARGET_TYPE_UNSPECIFIED = 0, + ARRAY_OF_STRUCT = 1 + } + + /** Properties of a GenAiFunctionErrorStats. */ + interface IGenAiFunctionErrorStats { + + /** GenAiFunctionErrorStats errors */ + errors?: (string[]|null); + + /** GenAiFunctionErrorStats numFailedRows */ + numFailedRows?: (number|Long|string|null); + } + + /** Represents a GenAiFunctionErrorStats. */ + class GenAiFunctionErrorStats implements IGenAiFunctionErrorStats { + + /** + * Constructs a new GenAiFunctionErrorStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiFunctionErrorStats); + + /** GenAiFunctionErrorStats errors. */ + public errors: string[]; + + /** GenAiFunctionErrorStats numFailedRows. */ + public numFailedRows: (number|Long|string); + + /** + * Creates a new GenAiFunctionErrorStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiFunctionErrorStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiFunctionErrorStats): google.cloud.bigquery.v2.GenAiFunctionErrorStats; + + /** + * Encodes the specified GenAiFunctionErrorStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionErrorStats.verify|verify} messages. + * @param message GenAiFunctionErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiFunctionErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiFunctionErrorStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionErrorStats.verify|verify} messages. + * @param message GenAiFunctionErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiFunctionErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiFunctionErrorStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiFunctionErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiFunctionErrorStats; + + /** + * Decodes a GenAiFunctionErrorStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiFunctionErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiFunctionErrorStats; + + /** + * Verifies a GenAiFunctionErrorStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiFunctionErrorStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiFunctionErrorStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiFunctionErrorStats; + + /** + * Creates a plain object from a GenAiFunctionErrorStats message. Also converts values to other types if specified. + * @param message GenAiFunctionErrorStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiFunctionErrorStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiFunctionErrorStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiFunctionErrorStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiFunctionCostOptimizationStats. */ + interface IGenAiFunctionCostOptimizationStats { + + /** GenAiFunctionCostOptimizationStats numCostOptimizedRows */ + numCostOptimizedRows?: (number|Long|string|null); + + /** GenAiFunctionCostOptimizationStats message */ + message?: (string|null); + } + + /** Represents a GenAiFunctionCostOptimizationStats. */ + class GenAiFunctionCostOptimizationStats implements IGenAiFunctionCostOptimizationStats { + + /** + * Constructs a new GenAiFunctionCostOptimizationStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats); + + /** GenAiFunctionCostOptimizationStats numCostOptimizedRows. */ + public numCostOptimizedRows?: (number|Long|string|null); + + /** GenAiFunctionCostOptimizationStats message. */ + public message?: (string|null); + + /** + * Creates a new GenAiFunctionCostOptimizationStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiFunctionCostOptimizationStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats): google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats; + + /** + * Encodes the specified GenAiFunctionCostOptimizationStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.verify|verify} messages. + * @param message GenAiFunctionCostOptimizationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiFunctionCostOptimizationStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.verify|verify} messages. + * @param message GenAiFunctionCostOptimizationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiFunctionCostOptimizationStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiFunctionCostOptimizationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats; + + /** + * Decodes a GenAiFunctionCostOptimizationStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiFunctionCostOptimizationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats; + + /** + * Verifies a GenAiFunctionCostOptimizationStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiFunctionCostOptimizationStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiFunctionCostOptimizationStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats; + + /** + * Creates a plain object from a GenAiFunctionCostOptimizationStats message. Also converts values to other types if specified. + * @param message GenAiFunctionCostOptimizationStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiFunctionCostOptimizationStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiFunctionCostOptimizationStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiFunctionCacheStats. */ + interface IGenAiFunctionCacheStats { + + /** GenAiFunctionCacheStats numCacheHitRows */ + numCacheHitRows?: (number|Long|string|null); + } + + /** Represents a GenAiFunctionCacheStats. */ + class GenAiFunctionCacheStats implements IGenAiFunctionCacheStats { + + /** + * Constructs a new GenAiFunctionCacheStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiFunctionCacheStats); + + /** GenAiFunctionCacheStats numCacheHitRows. */ + public numCacheHitRows?: (number|Long|string|null); + + /** + * Creates a new GenAiFunctionCacheStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiFunctionCacheStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiFunctionCacheStats): google.cloud.bigquery.v2.GenAiFunctionCacheStats; + + /** + * Encodes the specified GenAiFunctionCacheStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCacheStats.verify|verify} messages. + * @param message GenAiFunctionCacheStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiFunctionCacheStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiFunctionCacheStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCacheStats.verify|verify} messages. + * @param message GenAiFunctionCacheStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiFunctionCacheStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiFunctionCacheStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiFunctionCacheStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiFunctionCacheStats; + + /** + * Decodes a GenAiFunctionCacheStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiFunctionCacheStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiFunctionCacheStats; + + /** + * Verifies a GenAiFunctionCacheStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiFunctionCacheStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiFunctionCacheStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiFunctionCacheStats; + + /** + * Creates a plain object from a GenAiFunctionCacheStats message. Also converts values to other types if specified. + * @param message GenAiFunctionCacheStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiFunctionCacheStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiFunctionCacheStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiFunctionCacheStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiFunctionStats. */ + interface IGenAiFunctionStats { + + /** GenAiFunctionStats functionName */ + functionName?: (string|null); + + /** GenAiFunctionStats prompt */ + prompt?: (string|null); + + /** GenAiFunctionStats numProcessedRows */ + numProcessedRows?: (number|Long|string|null); + + /** GenAiFunctionStats errorStats */ + errorStats?: (google.cloud.bigquery.v2.IGenAiFunctionErrorStats|null); + + /** GenAiFunctionStats costOptimizationStats */ + costOptimizationStats?: (google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats|null); + + /** GenAiFunctionStats cacheStats */ + cacheStats?: (google.cloud.bigquery.v2.IGenAiFunctionCacheStats|null); + } + + /** Represents a GenAiFunctionStats. */ + class GenAiFunctionStats implements IGenAiFunctionStats { + + /** + * Constructs a new GenAiFunctionStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiFunctionStats); + + /** GenAiFunctionStats functionName. */ + public functionName?: (string|null); + + /** GenAiFunctionStats prompt. */ + public prompt?: (string|null); + + /** GenAiFunctionStats numProcessedRows. */ + public numProcessedRows?: (number|Long|string|null); + + /** GenAiFunctionStats errorStats. */ + public errorStats?: (google.cloud.bigquery.v2.IGenAiFunctionErrorStats|null); + + /** GenAiFunctionStats costOptimizationStats. */ + public costOptimizationStats?: (google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats|null); + + /** GenAiFunctionStats cacheStats. */ + public cacheStats?: (google.cloud.bigquery.v2.IGenAiFunctionCacheStats|null); + + /** + * Creates a new GenAiFunctionStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiFunctionStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiFunctionStats): google.cloud.bigquery.v2.GenAiFunctionStats; + + /** + * Encodes the specified GenAiFunctionStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionStats.verify|verify} messages. + * @param message GenAiFunctionStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiFunctionStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiFunctionStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionStats.verify|verify} messages. + * @param message GenAiFunctionStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiFunctionStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiFunctionStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiFunctionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiFunctionStats; + + /** + * Decodes a GenAiFunctionStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiFunctionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiFunctionStats; + + /** + * Verifies a GenAiFunctionStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiFunctionStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiFunctionStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiFunctionStats; + + /** + * Creates a plain object from a GenAiFunctionStats message. Also converts values to other types if specified. + * @param message GenAiFunctionStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiFunctionStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiFunctionStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiFunctionStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiErrorStats. */ + interface IGenAiErrorStats { + + /** GenAiErrorStats errors */ + errors?: (string[]|null); + } + + /** Represents a GenAiErrorStats. */ + class GenAiErrorStats implements IGenAiErrorStats { + + /** + * Constructs a new GenAiErrorStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiErrorStats); + + /** GenAiErrorStats errors. */ + public errors: string[]; + + /** + * Creates a new GenAiErrorStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiErrorStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiErrorStats): google.cloud.bigquery.v2.GenAiErrorStats; + + /** + * Encodes the specified GenAiErrorStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiErrorStats.verify|verify} messages. + * @param message GenAiErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiErrorStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiErrorStats.verify|verify} messages. + * @param message GenAiErrorStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiErrorStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiErrorStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiErrorStats; + + /** + * Decodes a GenAiErrorStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiErrorStats; + + /** + * Verifies a GenAiErrorStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiErrorStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiErrorStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiErrorStats; + + /** + * Creates a plain object from a GenAiErrorStats message. Also converts values to other types if specified. + * @param message GenAiErrorStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiErrorStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiErrorStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiErrorStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiStats. */ + interface IGenAiStats { + + /** GenAiStats errorStats */ + errorStats?: (google.cloud.bigquery.v2.IGenAiErrorStats|null); + + /** GenAiStats functionStats */ + functionStats?: (google.cloud.bigquery.v2.IGenAiFunctionStats[]|null); + } + + /** Represents a GenAiStats. */ + class GenAiStats implements IGenAiStats { + + /** + * Constructs a new GenAiStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGenAiStats); + + /** GenAiStats errorStats. */ + public errorStats?: (google.cloud.bigquery.v2.IGenAiErrorStats|null); + + /** GenAiStats functionStats. */ + public functionStats: google.cloud.bigquery.v2.IGenAiFunctionStats[]; + + /** + * Creates a new GenAiStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGenAiStats): google.cloud.bigquery.v2.GenAiStats; + + /** + * Encodes the specified GenAiStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiStats.verify|verify} messages. + * @param message GenAiStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGenAiStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiStats.verify|verify} messages. + * @param message GenAiStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGenAiStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GenAiStats; + + /** + * Decodes a GenAiStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GenAiStats; + + /** + * Verifies a GenAiStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GenAiStats; + + /** + * Creates a plain object from a GenAiStats message. Also converts values to other types if specified. + * @param message GenAiStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GenAiStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a JobService */ + class JobService extends $protobuf.rpc.Service { + + /** + * Constructs a new JobService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new JobService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): JobService; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobCancelResponse + */ + public cancelJob(request: google.cloud.bigquery.v2.ICancelJobRequest, callback: google.cloud.bigquery.v2.JobService.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.bigquery.v2.ICancelJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.bigquery.v2.IGetJobRequest, callback: google.cloud.bigquery.v2.JobService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.bigquery.v2.IGetJobRequest): Promise; + + /** + * Calls InsertJob. + * @param request InsertJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public insertJob(request: google.cloud.bigquery.v2.IInsertJobRequest, callback: google.cloud.bigquery.v2.JobService.InsertJobCallback): void; + + /** + * Calls InsertJob. + * @param request InsertJobRequest message or plain object + * @returns Promise + */ + public insertJob(request: google.cloud.bigquery.v2.IInsertJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJob(request: google.cloud.bigquery.v2.IDeleteJobRequest, callback: google.cloud.bigquery.v2.JobService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.bigquery.v2.IDeleteJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobList + */ + public listJobs(request: google.cloud.bigquery.v2.IListJobsRequest, callback: google.cloud.bigquery.v2.JobService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.bigquery.v2.IListJobsRequest): Promise; + + /** + * Calls GetQueryResults. + * @param request GetQueryResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetQueryResultsResponse + */ + public getQueryResults(request: google.cloud.bigquery.v2.IGetQueryResultsRequest, callback: google.cloud.bigquery.v2.JobService.GetQueryResultsCallback): void; + + /** + * Calls GetQueryResults. + * @param request GetQueryResultsRequest message or plain object + * @returns Promise + */ + public getQueryResults(request: google.cloud.bigquery.v2.IGetQueryResultsRequest): Promise; + + /** + * Calls Query. + * @param request PostQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryResponse + */ + public query(request: google.cloud.bigquery.v2.IPostQueryRequest, callback: google.cloud.bigquery.v2.JobService.QueryCallback): void; + + /** + * Calls Query. + * @param request PostQueryRequest message or plain object + * @returns Promise + */ + public query(request: google.cloud.bigquery.v2.IPostQueryRequest): Promise; + } + + namespace JobService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|cancelJob}. + * @param error Error, if any + * @param [response] JobCancelResponse + */ + type CancelJobCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.JobCancelResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Job) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|insertJob}. + * @param error Error, if any + * @param [response] Job + */ + type InsertJobCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Job) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|deleteJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|listJobs}. + * @param error Error, if any + * @param [response] JobList + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.JobList) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|getQueryResults}. + * @param error Error, if any + * @param [response] GetQueryResultsResponse + */ + type GetQueryResultsCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.GetQueryResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|query}. + * @param error Error, if any + * @param [response] QueryResponse + */ + type QueryCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.QueryResponse) => void; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job kind */ + kind?: (string|null); + + /** Job etag */ + etag?: (string|null); + + /** Job id */ + id?: (string|null); + + /** Job selfLink */ + selfLink?: (string|null); + + /** Job userEmail */ + userEmail?: (string|null); + + /** Job configuration */ + configuration?: (google.cloud.bigquery.v2.IJobConfiguration|null); + + /** Job jobReference */ + jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** Job statistics */ + statistics?: (google.cloud.bigquery.v2.IJobStatistics|null); + + /** Job status */ + status?: (google.cloud.bigquery.v2.IJobStatus|null); + + /** Job principalSubject */ + principalSubject?: (string|null); + + /** Job jobCreationReason */ + jobCreationReason?: (google.cloud.bigquery.v2.IJobCreationReason|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJob); + + /** Job kind. */ + public kind: string; + + /** Job etag. */ + public etag: string; + + /** Job id. */ + public id: string; + + /** Job selfLink. */ + public selfLink: string; + + /** Job userEmail. */ + public userEmail: string; + + /** Job configuration. */ + public configuration?: (google.cloud.bigquery.v2.IJobConfiguration|null); + + /** Job jobReference. */ + public jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** Job statistics. */ + public statistics?: (google.cloud.bigquery.v2.IJobStatistics|null); + + /** Job status. */ + public status?: (google.cloud.bigquery.v2.IJobStatus|null); + + /** Job principalSubject. */ + public principalSubject: string; + + /** Job jobCreationReason. */ + public jobCreationReason?: (google.cloud.bigquery.v2.IJobCreationReason|null); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJob): google.cloud.bigquery.v2.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.bigquery.v2.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest projectId */ + projectId?: (string|null); + + /** CancelJobRequest jobId */ + jobId?: (string|null); + + /** CancelJobRequest location */ + location?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ICancelJobRequest); + + /** CancelJobRequest projectId. */ + public projectId: string; + + /** CancelJobRequest jobId. */ + public jobId: string; + + /** CancelJobRequest location. */ + public location: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.ICancelJobRequest): google.cloud.bigquery.v2.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobCancelResponse. */ + interface IJobCancelResponse { + + /** JobCancelResponse kind */ + kind?: (string|null); + + /** JobCancelResponse job */ + job?: (google.cloud.bigquery.v2.IJob|null); + } + + /** Represents a JobCancelResponse. */ + class JobCancelResponse implements IJobCancelResponse { + + /** + * Constructs a new JobCancelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobCancelResponse); + + /** JobCancelResponse kind. */ + public kind: string; + + /** JobCancelResponse job. */ + public job?: (google.cloud.bigquery.v2.IJob|null); + + /** + * Creates a new JobCancelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns JobCancelResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobCancelResponse): google.cloud.bigquery.v2.JobCancelResponse; + + /** + * Encodes the specified JobCancelResponse message. Does not implicitly {@link google.cloud.bigquery.v2.JobCancelResponse.verify|verify} messages. + * @param message JobCancelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobCancelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobCancelResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobCancelResponse.verify|verify} messages. + * @param message JobCancelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobCancelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobCancelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobCancelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobCancelResponse; + + /** + * Decodes a JobCancelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobCancelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobCancelResponse; + + /** + * Verifies a JobCancelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobCancelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobCancelResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobCancelResponse; + + /** + * Creates a plain object from a JobCancelResponse message. Also converts values to other types if specified. + * @param message JobCancelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobCancelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobCancelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobCancelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest projectId */ + projectId?: (string|null); + + /** GetJobRequest jobId */ + jobId?: (string|null); + + /** GetJobRequest location */ + location?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetJobRequest); + + /** GetJobRequest projectId. */ + public projectId: string; + + /** GetJobRequest jobId. */ + public jobId: string; + + /** GetJobRequest location. */ + public location: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetJobRequest): google.cloud.bigquery.v2.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InsertJobRequest. */ + interface IInsertJobRequest { + + /** InsertJobRequest projectId */ + projectId?: (string|null); + + /** InsertJobRequest job */ + job?: (google.cloud.bigquery.v2.IJob|null); + } + + /** Represents an InsertJobRequest. */ + class InsertJobRequest implements IInsertJobRequest { + + /** + * Constructs a new InsertJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IInsertJobRequest); + + /** InsertJobRequest projectId. */ + public projectId: string; + + /** InsertJobRequest job. */ + public job?: (google.cloud.bigquery.v2.IJob|null); + + /** + * Creates a new InsertJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertJobRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IInsertJobRequest): google.cloud.bigquery.v2.InsertJobRequest; + + /** + * Encodes the specified InsertJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertJobRequest.verify|verify} messages. + * @param message InsertJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IInsertJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertJobRequest.verify|verify} messages. + * @param message InsertJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IInsertJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.InsertJobRequest; + + /** + * Decodes an InsertJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.InsertJobRequest; + + /** + * Verifies an InsertJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.InsertJobRequest; + + /** + * Creates a plain object from an InsertJobRequest message. Also converts values to other types if specified. + * @param message InsertJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.InsertJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest projectId */ + projectId?: (string|null); + + /** DeleteJobRequest jobId */ + jobId?: (string|null); + + /** DeleteJobRequest location */ + location?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteJobRequest); + + /** DeleteJobRequest projectId. */ + public projectId: string; + + /** DeleteJobRequest jobId. */ + public jobId: string; + + /** DeleteJobRequest location. */ + public location: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteJobRequest): google.cloud.bigquery.v2.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest projectId */ + projectId?: (string|null); + + /** ListJobsRequest allUsers */ + allUsers?: (boolean|null); + + /** ListJobsRequest maxResults */ + maxResults?: (google.protobuf.IInt32Value|null); + + /** ListJobsRequest minCreationTime */ + minCreationTime?: (number|Long|string|null); + + /** ListJobsRequest maxCreationTime */ + maxCreationTime?: (google.protobuf.IUInt64Value|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest projection */ + projection?: (google.cloud.bigquery.v2.ListJobsRequest.Projection|keyof typeof google.cloud.bigquery.v2.ListJobsRequest.Projection|null); + + /** ListJobsRequest stateFilter */ + stateFilter?: (google.cloud.bigquery.v2.ListJobsRequest.StateFilter[]|null); + + /** ListJobsRequest parentJobId */ + parentJobId?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListJobsRequest); + + /** ListJobsRequest projectId. */ + public projectId: string; + + /** ListJobsRequest allUsers. */ + public allUsers: boolean; + + /** ListJobsRequest maxResults. */ + public maxResults?: (google.protobuf.IInt32Value|null); + + /** ListJobsRequest minCreationTime. */ + public minCreationTime: (number|Long|string); + + /** ListJobsRequest maxCreationTime. */ + public maxCreationTime?: (google.protobuf.IUInt64Value|null); + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest projection. */ + public projection: (google.cloud.bigquery.v2.ListJobsRequest.Projection|keyof typeof google.cloud.bigquery.v2.ListJobsRequest.Projection); + + /** ListJobsRequest stateFilter. */ + public stateFilter: google.cloud.bigquery.v2.ListJobsRequest.StateFilter[]; + + /** ListJobsRequest parentJobId. */ + public parentJobId: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListJobsRequest): google.cloud.bigquery.v2.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListJobsRequest { + + /** Projection enum. */ + enum Projection { + minimal = 0, + MINIMAL = 0, + full = 1, + FULL = 1 + } + + /** StateFilter enum. */ + enum StateFilter { + done = 0, + DONE = 0, + pending = 1, + PENDING = 1, + running = 2, + RUNNING = 2 + } + } + + /** Properties of a ListFormatJob. */ + interface IListFormatJob { + + /** ListFormatJob id */ + id?: (string|null); + + /** ListFormatJob kind */ + kind?: (string|null); + + /** ListFormatJob jobReference */ + jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** ListFormatJob state */ + state?: (string|null); + + /** ListFormatJob errorResult */ + errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** ListFormatJob statistics */ + statistics?: (google.cloud.bigquery.v2.IJobStatistics|null); + + /** ListFormatJob configuration */ + configuration?: (google.cloud.bigquery.v2.IJobConfiguration|null); + + /** ListFormatJob status */ + status?: (google.cloud.bigquery.v2.IJobStatus|null); + + /** ListFormatJob userEmail */ + userEmail?: (string|null); + + /** ListFormatJob principalSubject */ + principalSubject?: (string|null); + } + + /** Represents a ListFormatJob. */ + class ListFormatJob implements IListFormatJob { + + /** + * Constructs a new ListFormatJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListFormatJob); + + /** ListFormatJob id. */ + public id: string; + + /** ListFormatJob kind. */ + public kind: string; + + /** ListFormatJob jobReference. */ + public jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** ListFormatJob state. */ + public state: string; + + /** ListFormatJob errorResult. */ + public errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** ListFormatJob statistics. */ + public statistics?: (google.cloud.bigquery.v2.IJobStatistics|null); + + /** ListFormatJob configuration. */ + public configuration?: (google.cloud.bigquery.v2.IJobConfiguration|null); + + /** ListFormatJob status. */ + public status?: (google.cloud.bigquery.v2.IJobStatus|null); + + /** ListFormatJob userEmail. */ + public userEmail: string; + + /** ListFormatJob principalSubject. */ + public principalSubject: string; + + /** + * Creates a new ListFormatJob instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFormatJob instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListFormatJob): google.cloud.bigquery.v2.ListFormatJob; + + /** + * Encodes the specified ListFormatJob message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatJob.verify|verify} messages. + * @param message ListFormatJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListFormatJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFormatJob message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatJob.verify|verify} messages. + * @param message ListFormatJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListFormatJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFormatJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFormatJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListFormatJob; + + /** + * Decodes a ListFormatJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFormatJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListFormatJob; + + /** + * Verifies a ListFormatJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFormatJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFormatJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListFormatJob; + + /** + * Creates a plain object from a ListFormatJob message. Also converts values to other types if specified. + * @param message ListFormatJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListFormatJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFormatJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFormatJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobList. */ + interface IJobList { + + /** JobList etag */ + etag?: (string|null); + + /** JobList kind */ + kind?: (string|null); + + /** JobList nextPageToken */ + nextPageToken?: (string|null); + + /** JobList jobs */ + jobs?: (google.cloud.bigquery.v2.IListFormatJob[]|null); + + /** JobList unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a JobList. */ + class JobList implements IJobList { + + /** + * Constructs a new JobList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobList); + + /** JobList etag. */ + public etag: string; + + /** JobList kind. */ + public kind: string; + + /** JobList nextPageToken. */ + public nextPageToken: string; + + /** JobList jobs. */ + public jobs: google.cloud.bigquery.v2.IListFormatJob[]; + + /** JobList unreachable. */ + public unreachable: string[]; + + /** + * Creates a new JobList instance using the specified properties. + * @param [properties] Properties to set + * @returns JobList instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobList): google.cloud.bigquery.v2.JobList; + + /** + * Encodes the specified JobList message. Does not implicitly {@link google.cloud.bigquery.v2.JobList.verify|verify} messages. + * @param message JobList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobList.verify|verify} messages. + * @param message JobList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobList; + + /** + * Decodes a JobList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobList; + + /** + * Verifies a JobList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobList; + + /** + * Creates a plain object from a JobList message. Also converts values to other types if specified. + * @param message JobList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetQueryResultsRequest. */ + interface IGetQueryResultsRequest { + + /** GetQueryResultsRequest projectId */ + projectId?: (string|null); + + /** GetQueryResultsRequest jobId */ + jobId?: (string|null); + + /** GetQueryResultsRequest startIndex */ + startIndex?: (google.protobuf.IUInt64Value|null); + + /** GetQueryResultsRequest pageToken */ + pageToken?: (string|null); + + /** GetQueryResultsRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** GetQueryResultsRequest timeoutMs */ + timeoutMs?: (google.protobuf.IUInt32Value|null); + + /** GetQueryResultsRequest location */ + location?: (string|null); + + /** GetQueryResultsRequest formatOptions */ + formatOptions?: (google.cloud.bigquery.v2.IDataFormatOptions|null); + } + + /** Represents a GetQueryResultsRequest. */ + class GetQueryResultsRequest implements IGetQueryResultsRequest { + + /** + * Constructs a new GetQueryResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetQueryResultsRequest); + + /** GetQueryResultsRequest projectId. */ + public projectId: string; + + /** GetQueryResultsRequest jobId. */ + public jobId: string; + + /** GetQueryResultsRequest startIndex. */ + public startIndex?: (google.protobuf.IUInt64Value|null); + + /** GetQueryResultsRequest pageToken. */ + public pageToken: string; + + /** GetQueryResultsRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** GetQueryResultsRequest timeoutMs. */ + public timeoutMs?: (google.protobuf.IUInt32Value|null); + + /** GetQueryResultsRequest location. */ + public location: string; + + /** GetQueryResultsRequest formatOptions. */ + public formatOptions?: (google.cloud.bigquery.v2.IDataFormatOptions|null); + + /** + * Creates a new GetQueryResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQueryResultsRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetQueryResultsRequest): google.cloud.bigquery.v2.GetQueryResultsRequest; + + /** + * Encodes the specified GetQueryResultsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsRequest.verify|verify} messages. + * @param message GetQueryResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetQueryResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQueryResultsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsRequest.verify|verify} messages. + * @param message GetQueryResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetQueryResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQueryResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQueryResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetQueryResultsRequest; + + /** + * Decodes a GetQueryResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQueryResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetQueryResultsRequest; + + /** + * Verifies a GetQueryResultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQueryResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQueryResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetQueryResultsRequest; + + /** + * Creates a plain object from a GetQueryResultsRequest message. Also converts values to other types if specified. + * @param message GetQueryResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetQueryResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQueryResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQueryResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetQueryResultsResponse. */ + interface IGetQueryResultsResponse { + + /** GetQueryResultsResponse kind */ + kind?: (string|null); + + /** GetQueryResultsResponse etag */ + etag?: (string|null); + + /** GetQueryResultsResponse schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** GetQueryResultsResponse jobReference */ + jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** GetQueryResultsResponse totalRows */ + totalRows?: (google.protobuf.IUInt64Value|null); + + /** GetQueryResultsResponse pageToken */ + pageToken?: (string|null); + + /** GetQueryResultsResponse rows */ + rows?: (google.protobuf.IStruct[]|null); + + /** GetQueryResultsResponse totalBytesProcessed */ + totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** GetQueryResultsResponse jobComplete */ + jobComplete?: (google.protobuf.IBoolValue|null); + + /** GetQueryResultsResponse errors */ + errors?: (google.cloud.bigquery.v2.IErrorProto[]|null); + + /** GetQueryResultsResponse cacheHit */ + cacheHit?: (google.protobuf.IBoolValue|null); + + /** GetQueryResultsResponse numDmlAffectedRows */ + numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + } + + /** Represents a GetQueryResultsResponse. */ + class GetQueryResultsResponse implements IGetQueryResultsResponse { + + /** + * Constructs a new GetQueryResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetQueryResultsResponse); + + /** GetQueryResultsResponse kind. */ + public kind: string; + + /** GetQueryResultsResponse etag. */ + public etag: string; + + /** GetQueryResultsResponse schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** GetQueryResultsResponse jobReference. */ + public jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** GetQueryResultsResponse totalRows. */ + public totalRows?: (google.protobuf.IUInt64Value|null); + + /** GetQueryResultsResponse pageToken. */ + public pageToken: string; + + /** GetQueryResultsResponse rows. */ + public rows: google.protobuf.IStruct[]; + + /** GetQueryResultsResponse totalBytesProcessed. */ + public totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** GetQueryResultsResponse jobComplete. */ + public jobComplete?: (google.protobuf.IBoolValue|null); + + /** GetQueryResultsResponse errors. */ + public errors: google.cloud.bigquery.v2.IErrorProto[]; + + /** GetQueryResultsResponse cacheHit. */ + public cacheHit?: (google.protobuf.IBoolValue|null); + + /** GetQueryResultsResponse numDmlAffectedRows. */ + public numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new GetQueryResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQueryResultsResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetQueryResultsResponse): google.cloud.bigquery.v2.GetQueryResultsResponse; + + /** + * Encodes the specified GetQueryResultsResponse message. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsResponse.verify|verify} messages. + * @param message GetQueryResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetQueryResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQueryResultsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsResponse.verify|verify} messages. + * @param message GetQueryResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetQueryResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQueryResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQueryResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetQueryResultsResponse; + + /** + * Decodes a GetQueryResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQueryResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetQueryResultsResponse; + + /** + * Verifies a GetQueryResultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQueryResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQueryResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetQueryResultsResponse; + + /** + * Creates a plain object from a GetQueryResultsResponse message. Also converts values to other types if specified. + * @param message GetQueryResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetQueryResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQueryResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQueryResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PostQueryRequest. */ + interface IPostQueryRequest { + + /** PostQueryRequest projectId */ + projectId?: (string|null); + + /** PostQueryRequest queryRequest */ + queryRequest?: (google.cloud.bigquery.v2.IQueryRequest|null); + } + + /** Represents a PostQueryRequest. */ + class PostQueryRequest implements IPostQueryRequest { + + /** + * Constructs a new PostQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPostQueryRequest); + + /** PostQueryRequest projectId. */ + public projectId: string; + + /** PostQueryRequest queryRequest. */ + public queryRequest?: (google.cloud.bigquery.v2.IQueryRequest|null); + + /** + * Creates a new PostQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PostQueryRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPostQueryRequest): google.cloud.bigquery.v2.PostQueryRequest; + + /** + * Encodes the specified PostQueryRequest message. Does not implicitly {@link google.cloud.bigquery.v2.PostQueryRequest.verify|verify} messages. + * @param message PostQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPostQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostQueryRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PostQueryRequest.verify|verify} messages. + * @param message PostQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPostQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PostQueryRequest; + + /** + * Decodes a PostQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PostQueryRequest; + + /** + * Verifies a PostQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PostQueryRequest; + + /** + * Creates a plain object from a PostQueryRequest message. Also converts values to other types if specified. + * @param message PostQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PostQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryRequest. */ + interface IQueryRequest { + + /** QueryRequest kind */ + kind?: (string|null); + + /** QueryRequest query */ + query?: (string|null); + + /** QueryRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** QueryRequest defaultDataset */ + defaultDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** QueryRequest timeoutMs */ + timeoutMs?: (google.protobuf.IUInt32Value|null); + + /** QueryRequest jobTimeoutMs */ + jobTimeoutMs?: (number|Long|string|null); + + /** QueryRequest maxSlots */ + maxSlots?: (number|null); + + /** QueryRequest destinationEncryptionConfiguration */ + destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** QueryRequest dryRun */ + dryRun?: (boolean|null); + + /** QueryRequest useQueryCache */ + useQueryCache?: (google.protobuf.IBoolValue|null); + + /** QueryRequest useLegacySql */ + useLegacySql?: (google.protobuf.IBoolValue|null); + + /** QueryRequest parameterMode */ + parameterMode?: (string|null); + + /** QueryRequest queryParameters */ + queryParameters?: (google.cloud.bigquery.v2.IQueryParameter[]|null); + + /** QueryRequest location */ + location?: (string|null); + + /** QueryRequest formatOptions */ + formatOptions?: (google.cloud.bigquery.v2.IDataFormatOptions|null); + + /** QueryRequest connectionProperties */ + connectionProperties?: (google.cloud.bigquery.v2.IConnectionProperty[]|null); + + /** QueryRequest labels */ + labels?: ({ [k: string]: string }|null); + + /** QueryRequest maximumBytesBilled */ + maximumBytesBilled?: (google.protobuf.IInt64Value|null); + + /** QueryRequest requestId */ + requestId?: (string|null); + + /** QueryRequest createSession */ + createSession?: (google.protobuf.IBoolValue|null); + + /** QueryRequest jobCreationMode */ + jobCreationMode?: (google.cloud.bigquery.v2.QueryRequest.JobCreationMode|keyof typeof google.cloud.bigquery.v2.QueryRequest.JobCreationMode|null); + + /** QueryRequest reservation */ + reservation?: (string|null); + + /** QueryRequest writeIncrementalResults */ + writeIncrementalResults?: (boolean|null); + } + + /** Represents a QueryRequest. */ + class QueryRequest implements IQueryRequest { + + /** + * Constructs a new QueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryRequest); + + /** QueryRequest kind. */ + public kind: string; + + /** QueryRequest query. */ + public query: string; + + /** QueryRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** QueryRequest defaultDataset. */ + public defaultDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** QueryRequest timeoutMs. */ + public timeoutMs?: (google.protobuf.IUInt32Value|null); + + /** QueryRequest jobTimeoutMs. */ + public jobTimeoutMs?: (number|Long|string|null); + + /** QueryRequest maxSlots. */ + public maxSlots?: (number|null); + + /** QueryRequest destinationEncryptionConfiguration. */ + public destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** QueryRequest dryRun. */ + public dryRun: boolean; + + /** QueryRequest useQueryCache. */ + public useQueryCache?: (google.protobuf.IBoolValue|null); + + /** QueryRequest useLegacySql. */ + public useLegacySql?: (google.protobuf.IBoolValue|null); + + /** QueryRequest parameterMode. */ + public parameterMode: string; + + /** QueryRequest queryParameters. */ + public queryParameters: google.cloud.bigquery.v2.IQueryParameter[]; + + /** QueryRequest location. */ + public location: string; + + /** QueryRequest formatOptions. */ + public formatOptions?: (google.cloud.bigquery.v2.IDataFormatOptions|null); + + /** QueryRequest connectionProperties. */ + public connectionProperties: google.cloud.bigquery.v2.IConnectionProperty[]; + + /** QueryRequest labels. */ + public labels: { [k: string]: string }; + + /** QueryRequest maximumBytesBilled. */ + public maximumBytesBilled?: (google.protobuf.IInt64Value|null); + + /** QueryRequest requestId. */ + public requestId: string; + + /** QueryRequest createSession. */ + public createSession?: (google.protobuf.IBoolValue|null); + + /** QueryRequest jobCreationMode. */ + public jobCreationMode: (google.cloud.bigquery.v2.QueryRequest.JobCreationMode|keyof typeof google.cloud.bigquery.v2.QueryRequest.JobCreationMode); + + /** QueryRequest reservation. */ + public reservation?: (string|null); + + /** QueryRequest writeIncrementalResults. */ + public writeIncrementalResults: boolean; + + /** + * Creates a new QueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryRequest): google.cloud.bigquery.v2.QueryRequest; + + /** + * Encodes the specified QueryRequest message. Does not implicitly {@link google.cloud.bigquery.v2.QueryRequest.verify|verify} messages. + * @param message QueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryRequest.verify|verify} messages. + * @param message QueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryRequest; + + /** + * Decodes a QueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryRequest; + + /** + * Verifies a QueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryRequest; + + /** + * Creates a plain object from a QueryRequest message. Also converts values to other types if specified. + * @param message QueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryRequest { + + /** JobCreationMode enum. */ + enum JobCreationMode { + JOB_CREATION_MODE_UNSPECIFIED = 0, + JOB_CREATION_REQUIRED = 1, + JOB_CREATION_OPTIONAL = 2 + } + } + + /** Properties of a QueryResponse. */ + interface IQueryResponse { + + /** QueryResponse kind */ + kind?: (string|null); + + /** QueryResponse schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** QueryResponse jobReference */ + jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** QueryResponse jobCreationReason */ + jobCreationReason?: (google.cloud.bigquery.v2.IJobCreationReason|null); + + /** QueryResponse queryId */ + queryId?: (string|null); + + /** QueryResponse location */ + location?: (string|null); + + /** QueryResponse totalRows */ + totalRows?: (google.protobuf.IUInt64Value|null); + + /** QueryResponse pageToken */ + pageToken?: (string|null); + + /** QueryResponse rows */ + rows?: (google.protobuf.IStruct[]|null); + + /** QueryResponse totalBytesProcessed */ + totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** QueryResponse totalBytesBilled */ + totalBytesBilled?: (number|Long|string|null); + + /** QueryResponse totalSlotMs */ + totalSlotMs?: (number|Long|string|null); + + /** QueryResponse jobComplete */ + jobComplete?: (google.protobuf.IBoolValue|null); + + /** QueryResponse errors */ + errors?: (google.cloud.bigquery.v2.IErrorProto[]|null); + + /** QueryResponse cacheHit */ + cacheHit?: (google.protobuf.IBoolValue|null); + + /** QueryResponse numDmlAffectedRows */ + numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + + /** QueryResponse sessionInfo */ + sessionInfo?: (google.cloud.bigquery.v2.ISessionInfo|null); + + /** QueryResponse dmlStats */ + dmlStats?: (google.cloud.bigquery.v2.IDmlStats|null); + + /** QueryResponse creationTime */ + creationTime?: (number|Long|string|null); + + /** QueryResponse startTime */ + startTime?: (number|Long|string|null); + + /** QueryResponse endTime */ + endTime?: (number|Long|string|null); + } + + /** Represents a QueryResponse. */ + class QueryResponse implements IQueryResponse { + + /** + * Constructs a new QueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryResponse); + + /** QueryResponse kind. */ + public kind: string; + + /** QueryResponse schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** QueryResponse jobReference. */ + public jobReference?: (google.cloud.bigquery.v2.IJobReference|null); + + /** QueryResponse jobCreationReason. */ + public jobCreationReason?: (google.cloud.bigquery.v2.IJobCreationReason|null); + + /** QueryResponse queryId. */ + public queryId: string; + + /** QueryResponse location. */ + public location: string; + + /** QueryResponse totalRows. */ + public totalRows?: (google.protobuf.IUInt64Value|null); + + /** QueryResponse pageToken. */ + public pageToken: string; + + /** QueryResponse rows. */ + public rows: google.protobuf.IStruct[]; + + /** QueryResponse totalBytesProcessed. */ + public totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** QueryResponse totalBytesBilled. */ + public totalBytesBilled?: (number|Long|string|null); + + /** QueryResponse totalSlotMs. */ + public totalSlotMs?: (number|Long|string|null); + + /** QueryResponse jobComplete. */ + public jobComplete?: (google.protobuf.IBoolValue|null); + + /** QueryResponse errors. */ + public errors: google.cloud.bigquery.v2.IErrorProto[]; + + /** QueryResponse cacheHit. */ + public cacheHit?: (google.protobuf.IBoolValue|null); + + /** QueryResponse numDmlAffectedRows. */ + public numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + + /** QueryResponse sessionInfo. */ + public sessionInfo?: (google.cloud.bigquery.v2.ISessionInfo|null); + + /** QueryResponse dmlStats. */ + public dmlStats?: (google.cloud.bigquery.v2.IDmlStats|null); + + /** QueryResponse creationTime. */ + public creationTime?: (number|Long|string|null); + + /** QueryResponse startTime. */ + public startTime?: (number|Long|string|null); + + /** QueryResponse endTime. */ + public endTime?: (number|Long|string|null); + + /** + * Creates a new QueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryResponse): google.cloud.bigquery.v2.QueryResponse; + + /** + * Encodes the specified QueryResponse message. Does not implicitly {@link google.cloud.bigquery.v2.QueryResponse.verify|verify} messages. + * @param message QueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryResponse.verify|verify} messages. + * @param message QueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryResponse; + + /** + * Decodes a QueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryResponse; + + /** + * Verifies a QueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryResponse; + + /** + * Creates a plain object from a QueryResponse message. Also converts values to other types if specified. + * @param message QueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestinationTableProperties. */ + interface IDestinationTableProperties { + + /** DestinationTableProperties friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** DestinationTableProperties description */ + description?: (google.protobuf.IStringValue|null); + + /** DestinationTableProperties labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a DestinationTableProperties. */ + class DestinationTableProperties implements IDestinationTableProperties { + + /** + * Constructs a new DestinationTableProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDestinationTableProperties); + + /** DestinationTableProperties friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** DestinationTableProperties description. */ + public description?: (google.protobuf.IStringValue|null); + + /** DestinationTableProperties labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new DestinationTableProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationTableProperties instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDestinationTableProperties): google.cloud.bigquery.v2.DestinationTableProperties; + + /** + * Encodes the specified DestinationTableProperties message. Does not implicitly {@link google.cloud.bigquery.v2.DestinationTableProperties.verify|verify} messages. + * @param message DestinationTableProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDestinationTableProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationTableProperties message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DestinationTableProperties.verify|verify} messages. + * @param message DestinationTableProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDestinationTableProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationTableProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationTableProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DestinationTableProperties; + + /** + * Decodes a DestinationTableProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationTableProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DestinationTableProperties; + + /** + * Verifies a DestinationTableProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DestinationTableProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationTableProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DestinationTableProperties; + + /** + * Creates a plain object from a DestinationTableProperties message. Also converts values to other types if specified. + * @param message DestinationTableProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DestinationTableProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationTableProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationTableProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionProperty. */ + interface IConnectionProperty { + + /** ConnectionProperty key */ + key?: (string|null); + + /** ConnectionProperty value */ + value?: (string|null); + } + + /** Represents a ConnectionProperty. */ + class ConnectionProperty implements IConnectionProperty { + + /** + * Constructs a new ConnectionProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IConnectionProperty); + + /** ConnectionProperty key. */ + public key: string; + + /** ConnectionProperty value. */ + public value: string; + + /** + * Creates a new ConnectionProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionProperty instance + */ + public static create(properties?: google.cloud.bigquery.v2.IConnectionProperty): google.cloud.bigquery.v2.ConnectionProperty; + + /** + * Encodes the specified ConnectionProperty message. Does not implicitly {@link google.cloud.bigquery.v2.ConnectionProperty.verify|verify} messages. + * @param message ConnectionProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IConnectionProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionProperty message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ConnectionProperty.verify|verify} messages. + * @param message ConnectionProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IConnectionProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ConnectionProperty; + + /** + * Decodes a ConnectionProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ConnectionProperty; + + /** + * Verifies a ConnectionProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionProperty + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ConnectionProperty; + + /** + * Creates a plain object from a ConnectionProperty message. Also converts values to other types if specified. + * @param message ConnectionProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ConnectionProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionProperty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobConfigurationQuery. */ + interface IJobConfigurationQuery { + + /** JobConfigurationQuery query */ + query?: (string|null); + + /** JobConfigurationQuery destinationTable */ + destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationQuery externalTableDefinitions */ + externalTableDefinitions?: ({ [k: string]: google.cloud.bigquery.v2.IExternalDataConfiguration }|null); + + /** JobConfigurationQuery userDefinedFunctionResources */ + userDefinedFunctionResources?: (google.cloud.bigquery.v2.IUserDefinedFunctionResource[]|null); + + /** JobConfigurationQuery createDisposition */ + createDisposition?: (string|null); + + /** JobConfigurationQuery writeDisposition */ + writeDisposition?: (string|null); + + /** JobConfigurationQuery defaultDataset */ + defaultDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobConfigurationQuery priority */ + priority?: (string|null); + + /** JobConfigurationQuery allowLargeResults */ + allowLargeResults?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery useQueryCache */ + useQueryCache?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery flattenResults */ + flattenResults?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery maximumBytesBilled */ + maximumBytesBilled?: (google.protobuf.IInt64Value|null); + + /** JobConfigurationQuery useLegacySql */ + useLegacySql?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery parameterMode */ + parameterMode?: (string|null); + + /** JobConfigurationQuery queryParameters */ + queryParameters?: (google.cloud.bigquery.v2.IQueryParameter[]|null); + + /** JobConfigurationQuery systemVariables */ + systemVariables?: (google.cloud.bigquery.v2.ISystemVariables|null); + + /** JobConfigurationQuery schemaUpdateOptions */ + schemaUpdateOptions?: (string[]|null); + + /** JobConfigurationQuery timePartitioning */ + timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** JobConfigurationQuery rangePartitioning */ + rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** JobConfigurationQuery clustering */ + clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** JobConfigurationQuery destinationEncryptionConfiguration */ + destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationQuery scriptOptions */ + scriptOptions?: (google.cloud.bigquery.v2.IScriptOptions|null); + + /** JobConfigurationQuery connectionProperties */ + connectionProperties?: (google.cloud.bigquery.v2.IConnectionProperty[]|null); + + /** JobConfigurationQuery createSession */ + createSession?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery continuous */ + continuous?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery writeIncrementalResults */ + writeIncrementalResults?: (boolean|null); + } + + /** Represents a JobConfigurationQuery. */ + class JobConfigurationQuery implements IJobConfigurationQuery { + + /** + * Constructs a new JobConfigurationQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobConfigurationQuery); + + /** JobConfigurationQuery query. */ + public query: string; + + /** JobConfigurationQuery destinationTable. */ + public destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationQuery externalTableDefinitions. */ + public externalTableDefinitions: { [k: string]: google.cloud.bigquery.v2.IExternalDataConfiguration }; + + /** JobConfigurationQuery userDefinedFunctionResources. */ + public userDefinedFunctionResources: google.cloud.bigquery.v2.IUserDefinedFunctionResource[]; + + /** JobConfigurationQuery createDisposition. */ + public createDisposition: string; + + /** JobConfigurationQuery writeDisposition. */ + public writeDisposition: string; + + /** JobConfigurationQuery defaultDataset. */ + public defaultDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobConfigurationQuery priority. */ + public priority: string; + + /** JobConfigurationQuery allowLargeResults. */ + public allowLargeResults?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery useQueryCache. */ + public useQueryCache?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery flattenResults. */ + public flattenResults?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery maximumBytesBilled. */ + public maximumBytesBilled?: (google.protobuf.IInt64Value|null); + + /** JobConfigurationQuery useLegacySql. */ + public useLegacySql?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery parameterMode. */ + public parameterMode: string; + + /** JobConfigurationQuery queryParameters. */ + public queryParameters: google.cloud.bigquery.v2.IQueryParameter[]; + + /** JobConfigurationQuery systemVariables. */ + public systemVariables?: (google.cloud.bigquery.v2.ISystemVariables|null); + + /** JobConfigurationQuery schemaUpdateOptions. */ + public schemaUpdateOptions: string[]; + + /** JobConfigurationQuery timePartitioning. */ + public timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** JobConfigurationQuery rangePartitioning. */ + public rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** JobConfigurationQuery clustering. */ + public clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** JobConfigurationQuery destinationEncryptionConfiguration. */ + public destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationQuery scriptOptions. */ + public scriptOptions?: (google.cloud.bigquery.v2.IScriptOptions|null); + + /** JobConfigurationQuery connectionProperties. */ + public connectionProperties: google.cloud.bigquery.v2.IConnectionProperty[]; + + /** JobConfigurationQuery createSession. */ + public createSession?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery continuous. */ + public continuous?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationQuery writeIncrementalResults. */ + public writeIncrementalResults: boolean; + + /** + * Creates a new JobConfigurationQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfigurationQuery instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobConfigurationQuery): google.cloud.bigquery.v2.JobConfigurationQuery; + + /** + * Encodes the specified JobConfigurationQuery message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationQuery.verify|verify} messages. + * @param message JobConfigurationQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobConfigurationQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfigurationQuery message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationQuery.verify|verify} messages. + * @param message JobConfigurationQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobConfigurationQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfigurationQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfigurationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfigurationQuery; + + /** + * Decodes a JobConfigurationQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfigurationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfigurationQuery; + + /** + * Verifies a JobConfigurationQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfigurationQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfigurationQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfigurationQuery; + + /** + * Creates a plain object from a JobConfigurationQuery message. Also converts values to other types if specified. + * @param message JobConfigurationQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfigurationQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfigurationQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfigurationQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScriptOptions. */ + interface IScriptOptions { + + /** ScriptOptions statementTimeoutMs */ + statementTimeoutMs?: (google.protobuf.IInt64Value|null); + + /** ScriptOptions statementByteBudget */ + statementByteBudget?: (google.protobuf.IInt64Value|null); + + /** ScriptOptions keyResultStatement */ + keyResultStatement?: (google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind|keyof typeof google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind|null); + } + + /** Represents a ScriptOptions. */ + class ScriptOptions implements IScriptOptions { + + /** + * Constructs a new ScriptOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IScriptOptions); + + /** ScriptOptions statementTimeoutMs. */ + public statementTimeoutMs?: (google.protobuf.IInt64Value|null); + + /** ScriptOptions statementByteBudget. */ + public statementByteBudget?: (google.protobuf.IInt64Value|null); + + /** ScriptOptions keyResultStatement. */ + public keyResultStatement: (google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind|keyof typeof google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind); + + /** + * Creates a new ScriptOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ScriptOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IScriptOptions): google.cloud.bigquery.v2.ScriptOptions; + + /** + * Encodes the specified ScriptOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptOptions.verify|verify} messages. + * @param message ScriptOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IScriptOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScriptOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptOptions.verify|verify} messages. + * @param message ScriptOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IScriptOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScriptOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScriptOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ScriptOptions; + + /** + * Decodes a ScriptOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScriptOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ScriptOptions; + + /** + * Verifies a ScriptOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScriptOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScriptOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ScriptOptions; + + /** + * Creates a plain object from a ScriptOptions message. Also converts values to other types if specified. + * @param message ScriptOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ScriptOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScriptOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScriptOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScriptOptions { + + /** KeyResultStatementKind enum. */ + enum KeyResultStatementKind { + KEY_RESULT_STATEMENT_KIND_UNSPECIFIED = 0, + LAST = 1, + FIRST_SELECT = 2 + } + } + + /** Properties of a JobConfigurationLoad. */ + interface IJobConfigurationLoad { + + /** JobConfigurationLoad sourceUris */ + sourceUris?: (string[]|null); + + /** JobConfigurationLoad fileSetSpecType */ + fileSetSpecType?: (google.cloud.bigquery.v2.FileSetSpecType|keyof typeof google.cloud.bigquery.v2.FileSetSpecType|null); + + /** JobConfigurationLoad schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** JobConfigurationLoad destinationTable */ + destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationLoad destinationTableProperties */ + destinationTableProperties?: (google.cloud.bigquery.v2.IDestinationTableProperties|null); + + /** JobConfigurationLoad createDisposition */ + createDisposition?: (string|null); + + /** JobConfigurationLoad writeDisposition */ + writeDisposition?: (string|null); + + /** JobConfigurationLoad nullMarker */ + nullMarker?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** JobConfigurationLoad skipLeadingRows */ + skipLeadingRows?: (google.protobuf.IInt32Value|null); + + /** JobConfigurationLoad encoding */ + encoding?: (string|null); + + /** JobConfigurationLoad quote */ + quote?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad maxBadRecords */ + maxBadRecords?: (google.protobuf.IInt32Value|null); + + /** JobConfigurationLoad allowQuotedNewlines */ + allowQuotedNewlines?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad sourceFormat */ + sourceFormat?: (string|null); + + /** JobConfigurationLoad allowJaggedRows */ + allowJaggedRows?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad ignoreUnknownValues */ + ignoreUnknownValues?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad projectionFields */ + projectionFields?: (string[]|null); + + /** JobConfigurationLoad autodetect */ + autodetect?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad schemaUpdateOptions */ + schemaUpdateOptions?: (string[]|null); + + /** JobConfigurationLoad timePartitioning */ + timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** JobConfigurationLoad rangePartitioning */ + rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** JobConfigurationLoad clustering */ + clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** JobConfigurationLoad destinationEncryptionConfiguration */ + destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationLoad useAvroLogicalTypes */ + useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad referenceFileSchemaUri */ + referenceFileSchemaUri?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad hivePartitioningOptions */ + hivePartitioningOptions?: (google.cloud.bigquery.v2.IHivePartitioningOptions|null); + + /** JobConfigurationLoad decimalTargetTypes */ + decimalTargetTypes?: (google.cloud.bigquery.v2.DecimalTargetType[]|null); + + /** JobConfigurationLoad jsonExtension */ + jsonExtension?: (google.cloud.bigquery.v2.JsonExtension|keyof typeof google.cloud.bigquery.v2.JsonExtension|null); + + /** JobConfigurationLoad parquetOptions */ + parquetOptions?: (google.cloud.bigquery.v2.IParquetOptions|null); + + /** JobConfigurationLoad preserveAsciiControlCharacters */ + preserveAsciiControlCharacters?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad connectionProperties */ + connectionProperties?: (google.cloud.bigquery.v2.IConnectionProperty[]|null); + + /** JobConfigurationLoad createSession */ + createSession?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad columnNameCharacterMap */ + columnNameCharacterMap?: (google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap|keyof typeof google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap|null); + + /** JobConfigurationLoad copyFilesOnly */ + copyFilesOnly?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad timeZone */ + timeZone?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad nullMarkers */ + nullMarkers?: (string[]|null); + + /** JobConfigurationLoad dateFormat */ + dateFormat?: (string|null); + + /** JobConfigurationLoad datetimeFormat */ + datetimeFormat?: (string|null); + + /** JobConfigurationLoad timeFormat */ + timeFormat?: (string|null); + + /** JobConfigurationLoad timestampFormat */ + timestampFormat?: (string|null); + + /** JobConfigurationLoad sourceColumnMatch */ + sourceColumnMatch?: (google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch|keyof typeof google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch|null); + + /** JobConfigurationLoad timestampTargetPrecision */ + timestampTargetPrecision?: (number[]|null); + } + + /** Represents a JobConfigurationLoad. */ + class JobConfigurationLoad implements IJobConfigurationLoad { + + /** + * Constructs a new JobConfigurationLoad. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobConfigurationLoad); + + /** JobConfigurationLoad sourceUris. */ + public sourceUris: string[]; + + /** JobConfigurationLoad fileSetSpecType. */ + public fileSetSpecType: (google.cloud.bigquery.v2.FileSetSpecType|keyof typeof google.cloud.bigquery.v2.FileSetSpecType); + + /** JobConfigurationLoad schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** JobConfigurationLoad destinationTable. */ + public destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationLoad destinationTableProperties. */ + public destinationTableProperties?: (google.cloud.bigquery.v2.IDestinationTableProperties|null); + + /** JobConfigurationLoad createDisposition. */ + public createDisposition: string; + + /** JobConfigurationLoad writeDisposition. */ + public writeDisposition: string; + + /** JobConfigurationLoad nullMarker. */ + public nullMarker?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad fieldDelimiter. */ + public fieldDelimiter: string; + + /** JobConfigurationLoad skipLeadingRows. */ + public skipLeadingRows?: (google.protobuf.IInt32Value|null); + + /** JobConfigurationLoad encoding. */ + public encoding: string; + + /** JobConfigurationLoad quote. */ + public quote?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad maxBadRecords. */ + public maxBadRecords?: (google.protobuf.IInt32Value|null); + + /** JobConfigurationLoad allowQuotedNewlines. */ + public allowQuotedNewlines?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad sourceFormat. */ + public sourceFormat: string; + + /** JobConfigurationLoad allowJaggedRows. */ + public allowJaggedRows?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad ignoreUnknownValues. */ + public ignoreUnknownValues?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad projectionFields. */ + public projectionFields: string[]; + + /** JobConfigurationLoad autodetect. */ + public autodetect?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad schemaUpdateOptions. */ + public schemaUpdateOptions: string[]; + + /** JobConfigurationLoad timePartitioning. */ + public timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** JobConfigurationLoad rangePartitioning. */ + public rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** JobConfigurationLoad clustering. */ + public clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** JobConfigurationLoad destinationEncryptionConfiguration. */ + public destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationLoad useAvroLogicalTypes. */ + public useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad referenceFileSchemaUri. */ + public referenceFileSchemaUri?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad hivePartitioningOptions. */ + public hivePartitioningOptions?: (google.cloud.bigquery.v2.IHivePartitioningOptions|null); + + /** JobConfigurationLoad decimalTargetTypes. */ + public decimalTargetTypes: google.cloud.bigquery.v2.DecimalTargetType[]; + + /** JobConfigurationLoad jsonExtension. */ + public jsonExtension: (google.cloud.bigquery.v2.JsonExtension|keyof typeof google.cloud.bigquery.v2.JsonExtension); + + /** JobConfigurationLoad parquetOptions. */ + public parquetOptions?: (google.cloud.bigquery.v2.IParquetOptions|null); + + /** JobConfigurationLoad preserveAsciiControlCharacters. */ + public preserveAsciiControlCharacters?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad connectionProperties. */ + public connectionProperties: google.cloud.bigquery.v2.IConnectionProperty[]; + + /** JobConfigurationLoad createSession. */ + public createSession?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad columnNameCharacterMap. */ + public columnNameCharacterMap: (google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap|keyof typeof google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap); + + /** JobConfigurationLoad copyFilesOnly. */ + public copyFilesOnly?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationLoad timeZone. */ + public timeZone?: (google.protobuf.IStringValue|null); + + /** JobConfigurationLoad nullMarkers. */ + public nullMarkers: string[]; + + /** JobConfigurationLoad dateFormat. */ + public dateFormat?: (string|null); + + /** JobConfigurationLoad datetimeFormat. */ + public datetimeFormat?: (string|null); + + /** JobConfigurationLoad timeFormat. */ + public timeFormat?: (string|null); + + /** JobConfigurationLoad timestampFormat. */ + public timestampFormat?: (string|null); + + /** JobConfigurationLoad sourceColumnMatch. */ + public sourceColumnMatch: (google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch|keyof typeof google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch); + + /** JobConfigurationLoad timestampTargetPrecision. */ + public timestampTargetPrecision: number[]; + + /** + * Creates a new JobConfigurationLoad instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfigurationLoad instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobConfigurationLoad): google.cloud.bigquery.v2.JobConfigurationLoad; + + /** + * Encodes the specified JobConfigurationLoad message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationLoad.verify|verify} messages. + * @param message JobConfigurationLoad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobConfigurationLoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfigurationLoad message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationLoad.verify|verify} messages. + * @param message JobConfigurationLoad message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobConfigurationLoad, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfigurationLoad message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfigurationLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfigurationLoad; + + /** + * Decodes a JobConfigurationLoad message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfigurationLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfigurationLoad; + + /** + * Verifies a JobConfigurationLoad message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfigurationLoad message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfigurationLoad + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfigurationLoad; + + /** + * Creates a plain object from a JobConfigurationLoad message. Also converts values to other types if specified. + * @param message JobConfigurationLoad + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfigurationLoad, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfigurationLoad to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfigurationLoad + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobConfigurationLoad { + + /** ColumnNameCharacterMap enum. */ + enum ColumnNameCharacterMap { + COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED = 0, + STRICT = 1, + V1 = 2, + V2 = 3 + } + + /** SourceColumnMatch enum. */ + enum SourceColumnMatch { + SOURCE_COLUMN_MATCH_UNSPECIFIED = 0, + POSITION = 1, + NAME = 2 + } + } + + /** Properties of a JobConfigurationTableCopy. */ + interface IJobConfigurationTableCopy { + + /** JobConfigurationTableCopy sourceTable */ + sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationTableCopy sourceTables */ + sourceTables?: (google.cloud.bigquery.v2.ITableReference[]|null); + + /** JobConfigurationTableCopy destinationTable */ + destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationTableCopy createDisposition */ + createDisposition?: (string|null); + + /** JobConfigurationTableCopy writeDisposition */ + writeDisposition?: (string|null); + + /** JobConfigurationTableCopy destinationEncryptionConfiguration */ + destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationTableCopy operationType */ + operationType?: (google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType|keyof typeof google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType|null); + + /** JobConfigurationTableCopy destinationExpirationTime */ + destinationExpirationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a JobConfigurationTableCopy. */ + class JobConfigurationTableCopy implements IJobConfigurationTableCopy { + + /** + * Constructs a new JobConfigurationTableCopy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobConfigurationTableCopy); + + /** JobConfigurationTableCopy sourceTable. */ + public sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationTableCopy sourceTables. */ + public sourceTables: google.cloud.bigquery.v2.ITableReference[]; + + /** JobConfigurationTableCopy destinationTable. */ + public destinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationTableCopy createDisposition. */ + public createDisposition: string; + + /** JobConfigurationTableCopy writeDisposition. */ + public writeDisposition: string; + + /** JobConfigurationTableCopy destinationEncryptionConfiguration. */ + public destinationEncryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** JobConfigurationTableCopy operationType. */ + public operationType: (google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType|keyof typeof google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType); + + /** JobConfigurationTableCopy destinationExpirationTime. */ + public destinationExpirationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new JobConfigurationTableCopy instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfigurationTableCopy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobConfigurationTableCopy): google.cloud.bigquery.v2.JobConfigurationTableCopy; + + /** + * Encodes the specified JobConfigurationTableCopy message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationTableCopy.verify|verify} messages. + * @param message JobConfigurationTableCopy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobConfigurationTableCopy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfigurationTableCopy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationTableCopy.verify|verify} messages. + * @param message JobConfigurationTableCopy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobConfigurationTableCopy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfigurationTableCopy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfigurationTableCopy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfigurationTableCopy; + + /** + * Decodes a JobConfigurationTableCopy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfigurationTableCopy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfigurationTableCopy; + + /** + * Verifies a JobConfigurationTableCopy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfigurationTableCopy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfigurationTableCopy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfigurationTableCopy; + + /** + * Creates a plain object from a JobConfigurationTableCopy message. Also converts values to other types if specified. + * @param message JobConfigurationTableCopy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfigurationTableCopy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfigurationTableCopy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfigurationTableCopy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobConfigurationTableCopy { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + COPY = 1, + SNAPSHOT = 2, + RESTORE = 3, + CLONE = 4 + } + } + + /** Properties of a JobConfigurationExtract. */ + interface IJobConfigurationExtract { + + /** JobConfigurationExtract sourceTable */ + sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationExtract sourceModel */ + sourceModel?: (google.cloud.bigquery.v2.IModelReference|null); + + /** JobConfigurationExtract destinationUris */ + destinationUris?: (string[]|null); + + /** JobConfigurationExtract printHeader */ + printHeader?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationExtract fieldDelimiter */ + fieldDelimiter?: (string|null); + + /** JobConfigurationExtract destinationFormat */ + destinationFormat?: (string|null); + + /** JobConfigurationExtract compression */ + compression?: (string|null); + + /** JobConfigurationExtract useAvroLogicalTypes */ + useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationExtract modelExtractOptions */ + modelExtractOptions?: (google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions|null); + } + + /** Represents a JobConfigurationExtract. */ + class JobConfigurationExtract implements IJobConfigurationExtract { + + /** + * Constructs a new JobConfigurationExtract. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobConfigurationExtract); + + /** JobConfigurationExtract sourceTable. */ + public sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobConfigurationExtract sourceModel. */ + public sourceModel?: (google.cloud.bigquery.v2.IModelReference|null); + + /** JobConfigurationExtract destinationUris. */ + public destinationUris: string[]; + + /** JobConfigurationExtract printHeader. */ + public printHeader?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationExtract fieldDelimiter. */ + public fieldDelimiter: string; + + /** JobConfigurationExtract destinationFormat. */ + public destinationFormat: string; + + /** JobConfigurationExtract compression. */ + public compression: string; + + /** JobConfigurationExtract useAvroLogicalTypes. */ + public useAvroLogicalTypes?: (google.protobuf.IBoolValue|null); + + /** JobConfigurationExtract modelExtractOptions. */ + public modelExtractOptions?: (google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions|null); + + /** JobConfigurationExtract source. */ + public source?: ("sourceTable"|"sourceModel"); + + /** + * Creates a new JobConfigurationExtract instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfigurationExtract instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobConfigurationExtract): google.cloud.bigquery.v2.JobConfigurationExtract; + + /** + * Encodes the specified JobConfigurationExtract message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.verify|verify} messages. + * @param message JobConfigurationExtract message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobConfigurationExtract, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfigurationExtract message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.verify|verify} messages. + * @param message JobConfigurationExtract message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobConfigurationExtract, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfigurationExtract message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfigurationExtract + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfigurationExtract; + + /** + * Decodes a JobConfigurationExtract message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfigurationExtract + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfigurationExtract; + + /** + * Verifies a JobConfigurationExtract message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfigurationExtract message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfigurationExtract + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfigurationExtract; + + /** + * Creates a plain object from a JobConfigurationExtract message. Also converts values to other types if specified. + * @param message JobConfigurationExtract + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfigurationExtract, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfigurationExtract to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfigurationExtract + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobConfigurationExtract { + + /** Properties of a ModelExtractOptions. */ + interface IModelExtractOptions { + + /** ModelExtractOptions trialId */ + trialId?: (google.protobuf.IInt64Value|null); + } + + /** Represents a ModelExtractOptions. */ + class ModelExtractOptions implements IModelExtractOptions { + + /** + * Constructs a new ModelExtractOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions); + + /** ModelExtractOptions trialId. */ + public trialId?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new ModelExtractOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExtractOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions): google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions; + + /** + * Encodes the specified ModelExtractOptions message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.verify|verify} messages. + * @param message ModelExtractOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExtractOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.verify|verify} messages. + * @param message ModelExtractOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExtractOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExtractOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions; + + /** + * Decodes a ModelExtractOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExtractOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions; + + /** + * Verifies a ModelExtractOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelExtractOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExtractOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions; + + /** + * Creates a plain object from a ModelExtractOptions message. Also converts values to other types if specified. + * @param message ModelExtractOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExtractOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelExtractOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a JobConfiguration. */ + interface IJobConfiguration { + + /** JobConfiguration jobType */ + jobType?: (string|null); + + /** JobConfiguration query */ + query?: (google.cloud.bigquery.v2.IJobConfigurationQuery|null); + + /** JobConfiguration load */ + load?: (google.cloud.bigquery.v2.IJobConfigurationLoad|null); + + /** JobConfiguration copy */ + copy?: (google.cloud.bigquery.v2.IJobConfigurationTableCopy|null); + + /** JobConfiguration extract */ + extract?: (google.cloud.bigquery.v2.IJobConfigurationExtract|null); + + /** JobConfiguration dryRun */ + dryRun?: (google.protobuf.IBoolValue|null); + + /** JobConfiguration jobTimeoutMs */ + jobTimeoutMs?: (google.protobuf.IInt64Value|null); + + /** JobConfiguration maxSlots */ + maxSlots?: (number|null); + + /** JobConfiguration labels */ + labels?: ({ [k: string]: string }|null); + + /** JobConfiguration reservation */ + reservation?: (string|null); + } + + /** Represents a JobConfiguration. */ + class JobConfiguration implements IJobConfiguration { + + /** + * Constructs a new JobConfiguration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobConfiguration); + + /** JobConfiguration jobType. */ + public jobType: string; + + /** JobConfiguration query. */ + public query?: (google.cloud.bigquery.v2.IJobConfigurationQuery|null); + + /** JobConfiguration load. */ + public load?: (google.cloud.bigquery.v2.IJobConfigurationLoad|null); + + /** JobConfiguration copy. */ + public copy?: (google.cloud.bigquery.v2.IJobConfigurationTableCopy|null); + + /** JobConfiguration extract. */ + public extract?: (google.cloud.bigquery.v2.IJobConfigurationExtract|null); + + /** JobConfiguration dryRun. */ + public dryRun?: (google.protobuf.IBoolValue|null); + + /** JobConfiguration jobTimeoutMs. */ + public jobTimeoutMs?: (google.protobuf.IInt64Value|null); + + /** JobConfiguration maxSlots. */ + public maxSlots?: (number|null); + + /** JobConfiguration labels. */ + public labels: { [k: string]: string }; + + /** JobConfiguration reservation. */ + public reservation?: (string|null); + + /** + * Creates a new JobConfiguration instance using the specified properties. + * @param [properties] Properties to set + * @returns JobConfiguration instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobConfiguration): google.cloud.bigquery.v2.JobConfiguration; + + /** + * Encodes the specified JobConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfiguration.verify|verify} messages. + * @param message JobConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfiguration.verify|verify} messages. + * @param message JobConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobConfiguration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobConfiguration; + + /** + * Decodes a JobConfiguration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobConfiguration; + + /** + * Verifies a JobConfiguration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobConfiguration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobConfiguration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobConfiguration; + + /** + * Creates a plain object from a JobConfiguration message. Also converts values to other types if specified. + * @param message JobConfiguration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobConfiguration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobConfiguration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobConfiguration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelReference. */ + interface IModelReference { + + /** ModelReference projectId */ + projectId?: (string|null); + + /** ModelReference datasetId */ + datasetId?: (string|null); + + /** ModelReference modelId */ + modelId?: (string|null); + } + + /** Represents a ModelReference. */ + class ModelReference implements IModelReference { + + /** + * Constructs a new ModelReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IModelReference); + + /** ModelReference projectId. */ + public projectId: string; + + /** ModelReference datasetId. */ + public datasetId: string; + + /** ModelReference modelId. */ + public modelId: string; + + /** + * Creates a new ModelReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IModelReference): google.cloud.bigquery.v2.ModelReference; + + /** + * Encodes the specified ModelReference message. Does not implicitly {@link google.cloud.bigquery.v2.ModelReference.verify|verify} messages. + * @param message ModelReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IModelReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ModelReference.verify|verify} messages. + * @param message ModelReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IModelReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ModelReference; + + /** + * Decodes a ModelReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ModelReference; + + /** + * Verifies a ModelReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ModelReference; + + /** + * Creates a plain object from a ModelReference message. Also converts values to other types if specified. + * @param message ModelReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ModelReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryParameterStructType. */ + interface IQueryParameterStructType { + + /** QueryParameterStructType name */ + name?: (string|null); + + /** QueryParameterStructType type */ + type?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameterStructType description */ + description?: (string|null); + } + + /** Represents a QueryParameterStructType. */ + class QueryParameterStructType implements IQueryParameterStructType { + + /** + * Constructs a new QueryParameterStructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryParameterStructType); + + /** QueryParameterStructType name. */ + public name: string; + + /** QueryParameterStructType type. */ + public type?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameterStructType description. */ + public description: string; + + /** + * Creates a new QueryParameterStructType instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameterStructType instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryParameterStructType): google.cloud.bigquery.v2.QueryParameterStructType; + + /** + * Encodes the specified QueryParameterStructType message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterStructType.verify|verify} messages. + * @param message QueryParameterStructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryParameterStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameterStructType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterStructType.verify|verify} messages. + * @param message QueryParameterStructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryParameterStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameterStructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameterStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryParameterStructType; + + /** + * Decodes a QueryParameterStructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameterStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryParameterStructType; + + /** + * Verifies a QueryParameterStructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameterStructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameterStructType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryParameterStructType; + + /** + * Creates a plain object from a QueryParameterStructType message. Also converts values to other types if specified. + * @param message QueryParameterStructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryParameterStructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameterStructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameterStructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryParameterType. */ + interface IQueryParameterType { + + /** QueryParameterType type */ + type?: (string|null); + + /** QueryParameterType timestampPrecision */ + timestampPrecision?: (number|Long|string|null); + + /** QueryParameterType arrayType */ + arrayType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameterType structTypes */ + structTypes?: (google.cloud.bigquery.v2.IQueryParameterStructType[]|null); + + /** QueryParameterType rangeElementType */ + rangeElementType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + } + + /** Represents a QueryParameterType. */ + class QueryParameterType implements IQueryParameterType { + + /** + * Constructs a new QueryParameterType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryParameterType); + + /** QueryParameterType type. */ + public type: string; + + /** QueryParameterType timestampPrecision. */ + public timestampPrecision?: (number|Long|string|null); + + /** QueryParameterType arrayType. */ + public arrayType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameterType structTypes. */ + public structTypes: google.cloud.bigquery.v2.IQueryParameterStructType[]; + + /** QueryParameterType rangeElementType. */ + public rangeElementType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** + * Creates a new QueryParameterType instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameterType instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryParameterType): google.cloud.bigquery.v2.QueryParameterType; + + /** + * Encodes the specified QueryParameterType message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterType.verify|verify} messages. + * @param message QueryParameterType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryParameterType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameterType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterType.verify|verify} messages. + * @param message QueryParameterType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryParameterType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameterType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameterType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryParameterType; + + /** + * Decodes a QueryParameterType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameterType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryParameterType; + + /** + * Verifies a QueryParameterType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameterType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameterType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryParameterType; + + /** + * Creates a plain object from a QueryParameterType message. Also converts values to other types if specified. + * @param message QueryParameterType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryParameterType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameterType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameterType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RangeValue. */ + interface IRangeValue { + + /** RangeValue start */ + start?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + + /** RangeValue end */ + end?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + } + + /** Represents a RangeValue. */ + class RangeValue implements IRangeValue { + + /** + * Constructs a new RangeValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRangeValue); + + /** RangeValue start. */ + public start?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + + /** RangeValue end. */ + public end?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + + /** + * Creates a new RangeValue instance using the specified properties. + * @param [properties] Properties to set + * @returns RangeValue instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRangeValue): google.cloud.bigquery.v2.RangeValue; + + /** + * Encodes the specified RangeValue message. Does not implicitly {@link google.cloud.bigquery.v2.RangeValue.verify|verify} messages. + * @param message RangeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRangeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RangeValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangeValue.verify|verify} messages. + * @param message RangeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRangeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RangeValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RangeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RangeValue; + + /** + * Decodes a RangeValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RangeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RangeValue; + + /** + * Verifies a RangeValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RangeValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RangeValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RangeValue; + + /** + * Creates a plain object from a RangeValue message. Also converts values to other types if specified. + * @param message RangeValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RangeValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RangeValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RangeValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryParameterValue. */ + interface IQueryParameterValue { + + /** QueryParameterValue value */ + value?: (google.protobuf.IStringValue|null); + + /** QueryParameterValue arrayValues */ + arrayValues?: (google.cloud.bigquery.v2.IQueryParameterValue[]|null); + + /** QueryParameterValue structValues */ + structValues?: ({ [k: string]: google.cloud.bigquery.v2.IQueryParameterValue }|null); + + /** QueryParameterValue rangeValue */ + rangeValue?: (google.cloud.bigquery.v2.IRangeValue|null); + + /** QueryParameterValue altStructValues */ + altStructValues?: (google.protobuf.IValue[]|null); + } + + /** Represents a QueryParameterValue. */ + class QueryParameterValue implements IQueryParameterValue { + + /** + * Constructs a new QueryParameterValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryParameterValue); + + /** QueryParameterValue value. */ + public value?: (google.protobuf.IStringValue|null); + + /** QueryParameterValue arrayValues. */ + public arrayValues: google.cloud.bigquery.v2.IQueryParameterValue[]; + + /** QueryParameterValue structValues. */ + public structValues: { [k: string]: google.cloud.bigquery.v2.IQueryParameterValue }; + + /** QueryParameterValue rangeValue. */ + public rangeValue?: (google.cloud.bigquery.v2.IRangeValue|null); + + /** QueryParameterValue altStructValues. */ + public altStructValues: google.protobuf.IValue[]; + + /** + * Creates a new QueryParameterValue instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameterValue instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryParameterValue): google.cloud.bigquery.v2.QueryParameterValue; + + /** + * Encodes the specified QueryParameterValue message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterValue.verify|verify} messages. + * @param message QueryParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameterValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterValue.verify|verify} messages. + * @param message QueryParameterValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryParameterValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameterValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryParameterValue; + + /** + * Decodes a QueryParameterValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryParameterValue; + + /** + * Verifies a QueryParameterValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameterValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameterValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryParameterValue; + + /** + * Creates a plain object from a QueryParameterValue message. Also converts values to other types if specified. + * @param message QueryParameterValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryParameterValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameterValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameterValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryParameter. */ + interface IQueryParameter { + + /** QueryParameter name */ + name?: (string|null); + + /** QueryParameter parameterType */ + parameterType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameter parameterValue */ + parameterValue?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + } + + /** Represents a QueryParameter. */ + class QueryParameter implements IQueryParameter { + + /** + * Constructs a new QueryParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryParameter); + + /** QueryParameter name. */ + public name: string; + + /** QueryParameter parameterType. */ + public parameterType?: (google.cloud.bigquery.v2.IQueryParameterType|null); + + /** QueryParameter parameterValue. */ + public parameterValue?: (google.cloud.bigquery.v2.IQueryParameterValue|null); + + /** + * Creates a new QueryParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameter instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryParameter): google.cloud.bigquery.v2.QueryParameter; + + /** + * Encodes the specified QueryParameter message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameter.verify|verify} messages. + * @param message QueryParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameter.verify|verify} messages. + * @param message QueryParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryParameter; + + /** + * Decodes a QueryParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryParameter; + + /** + * Verifies a QueryParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryParameter; + + /** + * Creates a plain object from a QueryParameter message. Also converts values to other types if specified. + * @param message QueryParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RangePartitioning. */ + interface IRangePartitioning { + + /** RangePartitioning field */ + field?: (string|null); + + /** RangePartitioning range */ + range?: (google.cloud.bigquery.v2.RangePartitioning.IRange|null); + } + + /** Represents a RangePartitioning. */ + class RangePartitioning implements IRangePartitioning { + + /** + * Constructs a new RangePartitioning. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRangePartitioning); + + /** RangePartitioning field. */ + public field: string; + + /** RangePartitioning range. */ + public range?: (google.cloud.bigquery.v2.RangePartitioning.IRange|null); + + /** + * Creates a new RangePartitioning instance using the specified properties. + * @param [properties] Properties to set + * @returns RangePartitioning instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRangePartitioning): google.cloud.bigquery.v2.RangePartitioning; + + /** + * Encodes the specified RangePartitioning message. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.verify|verify} messages. + * @param message RangePartitioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRangePartitioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RangePartitioning message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.verify|verify} messages. + * @param message RangePartitioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRangePartitioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RangePartitioning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RangePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RangePartitioning; + + /** + * Decodes a RangePartitioning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RangePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RangePartitioning; + + /** + * Verifies a RangePartitioning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RangePartitioning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RangePartitioning + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RangePartitioning; + + /** + * Creates a plain object from a RangePartitioning message. Also converts values to other types if specified. + * @param message RangePartitioning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RangePartitioning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RangePartitioning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RangePartitioning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RangePartitioning { + + /** Properties of a Range. */ + interface IRange { + + /** Range start */ + start?: (string|null); + + /** Range end */ + end?: (string|null); + + /** Range interval */ + interval?: (string|null); + } + + /** Represents a Range. */ + class Range implements IRange { + + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.RangePartitioning.IRange); + + /** Range start. */ + public start: string; + + /** Range end. */ + public end: string; + + /** Range interval. */ + public interval: string; + + /** + * Creates a new Range instance using the specified properties. + * @param [properties] Properties to set + * @returns Range instance + */ + public static create(properties?: google.cloud.bigquery.v2.RangePartitioning.IRange): google.cloud.bigquery.v2.RangePartitioning.Range; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.RangePartitioning.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.Range.verify|verify} messages. + * @param message Range message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.RangePartitioning.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Range message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RangePartitioning.Range; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RangePartitioning.Range; + + /** + * Verifies a Range message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Range + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RangePartitioning.Range; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @param message Range + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RangePartitioning.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SystemVariables. */ + interface ISystemVariables { + + /** SystemVariables types */ + types?: ({ [k: string]: google.cloud.bigquery.v2.IStandardSqlDataType }|null); + + /** SystemVariables values */ + values?: (google.protobuf.IStruct|null); + } + + /** Represents a SystemVariables. */ + class SystemVariables implements ISystemVariables { + + /** + * Constructs a new SystemVariables. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISystemVariables); + + /** SystemVariables types. */ + public types: { [k: string]: google.cloud.bigquery.v2.IStandardSqlDataType }; + + /** SystemVariables values. */ + public values?: (google.protobuf.IStruct|null); + + /** + * Creates a new SystemVariables instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemVariables instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISystemVariables): google.cloud.bigquery.v2.SystemVariables; + + /** + * Encodes the specified SystemVariables message. Does not implicitly {@link google.cloud.bigquery.v2.SystemVariables.verify|verify} messages. + * @param message SystemVariables message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISystemVariables, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SystemVariables message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SystemVariables.verify|verify} messages. + * @param message SystemVariables message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISystemVariables, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemVariables message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SystemVariables + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SystemVariables; + + /** + * Decodes a SystemVariables message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SystemVariables + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SystemVariables; + + /** + * Verifies a SystemVariables message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SystemVariables message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SystemVariables + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SystemVariables; + + /** + * Creates a plain object from a SystemVariables message. Also converts values to other types if specified. + * @param message SystemVariables + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SystemVariables, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SystemVariables to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SystemVariables + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSqlDataType. */ + interface IStandardSqlDataType { + + /** StandardSqlDataType typeKind */ + typeKind?: (google.cloud.bigquery.v2.StandardSqlDataType.TypeKind|keyof typeof google.cloud.bigquery.v2.StandardSqlDataType.TypeKind|null); + + /** StandardSqlDataType arrayElementType */ + arrayElementType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** StandardSqlDataType structType */ + structType?: (google.cloud.bigquery.v2.IStandardSqlStructType|null); + + /** StandardSqlDataType rangeElementType */ + rangeElementType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + } + + /** Represents a StandardSqlDataType. */ + class StandardSqlDataType implements IStandardSqlDataType { + + /** + * Constructs a new StandardSqlDataType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStandardSqlDataType); + + /** StandardSqlDataType typeKind. */ + public typeKind: (google.cloud.bigquery.v2.StandardSqlDataType.TypeKind|keyof typeof google.cloud.bigquery.v2.StandardSqlDataType.TypeKind); + + /** StandardSqlDataType arrayElementType. */ + public arrayElementType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** StandardSqlDataType structType. */ + public structType?: (google.cloud.bigquery.v2.IStandardSqlStructType|null); + + /** StandardSqlDataType rangeElementType. */ + public rangeElementType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** StandardSqlDataType subType. */ + public subType?: ("arrayElementType"|"structType"|"rangeElementType"); + + /** + * Creates a new StandardSqlDataType instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSqlDataType instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStandardSqlDataType): google.cloud.bigquery.v2.StandardSqlDataType; + + /** + * Encodes the specified StandardSqlDataType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlDataType.verify|verify} messages. + * @param message StandardSqlDataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStandardSqlDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSqlDataType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlDataType.verify|verify} messages. + * @param message StandardSqlDataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStandardSqlDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSqlDataType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSqlDataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StandardSqlDataType; + + /** + * Decodes a StandardSqlDataType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSqlDataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StandardSqlDataType; + + /** + * Verifies a StandardSqlDataType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSqlDataType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSqlDataType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StandardSqlDataType; + + /** + * Creates a plain object from a StandardSqlDataType message. Also converts values to other types if specified. + * @param message StandardSqlDataType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StandardSqlDataType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSqlDataType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSqlDataType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StandardSqlDataType { + + /** TypeKind enum. */ + enum TypeKind { + TYPE_KIND_UNSPECIFIED = 0, + INT64 = 2, + BOOL = 5, + FLOAT64 = 7, + STRING = 8, + BYTES = 9, + TIMESTAMP = 19, + DATE = 10, + TIME = 20, + DATETIME = 21, + INTERVAL = 26, + GEOGRAPHY = 22, + NUMERIC = 23, + BIGNUMERIC = 24, + JSON = 25, + ARRAY = 16, + STRUCT = 17, + RANGE = 29 + } + } + + /** Properties of a StandardSqlField. */ + interface IStandardSqlField { + + /** StandardSqlField name */ + name?: (string|null); + + /** StandardSqlField type */ + type?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + } + + /** Represents a StandardSqlField. */ + class StandardSqlField implements IStandardSqlField { + + /** + * Constructs a new StandardSqlField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStandardSqlField); + + /** StandardSqlField name. */ + public name: string; + + /** StandardSqlField type. */ + public type?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** + * Creates a new StandardSqlField instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSqlField instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStandardSqlField): google.cloud.bigquery.v2.StandardSqlField; + + /** + * Encodes the specified StandardSqlField message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlField.verify|verify} messages. + * @param message StandardSqlField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStandardSqlField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSqlField message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlField.verify|verify} messages. + * @param message StandardSqlField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStandardSqlField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSqlField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSqlField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StandardSqlField; + + /** + * Decodes a StandardSqlField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSqlField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StandardSqlField; + + /** + * Verifies a StandardSqlField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSqlField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSqlField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StandardSqlField; + + /** + * Creates a plain object from a StandardSqlField message. Also converts values to other types if specified. + * @param message StandardSqlField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StandardSqlField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSqlField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSqlField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSqlStructType. */ + interface IStandardSqlStructType { + + /** StandardSqlStructType fields */ + fields?: (google.cloud.bigquery.v2.IStandardSqlField[]|null); + } + + /** Represents a StandardSqlStructType. */ + class StandardSqlStructType implements IStandardSqlStructType { + + /** + * Constructs a new StandardSqlStructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStandardSqlStructType); + + /** StandardSqlStructType fields. */ + public fields: google.cloud.bigquery.v2.IStandardSqlField[]; + + /** + * Creates a new StandardSqlStructType instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSqlStructType instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStandardSqlStructType): google.cloud.bigquery.v2.StandardSqlStructType; + + /** + * Encodes the specified StandardSqlStructType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlStructType.verify|verify} messages. + * @param message StandardSqlStructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStandardSqlStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSqlStructType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlStructType.verify|verify} messages. + * @param message StandardSqlStructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStandardSqlStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSqlStructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSqlStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StandardSqlStructType; + + /** + * Decodes a StandardSqlStructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSqlStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StandardSqlStructType; + + /** + * Verifies a StandardSqlStructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSqlStructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSqlStructType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StandardSqlStructType; + + /** + * Creates a plain object from a StandardSqlStructType message. Also converts values to other types if specified. + * @param message StandardSqlStructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StandardSqlStructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSqlStructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSqlStructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSqlTableType. */ + interface IStandardSqlTableType { + + /** StandardSqlTableType columns */ + columns?: (google.cloud.bigquery.v2.IStandardSqlField[]|null); + } + + /** Represents a StandardSqlTableType. */ + class StandardSqlTableType implements IStandardSqlTableType { + + /** + * Constructs a new StandardSqlTableType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStandardSqlTableType); + + /** StandardSqlTableType columns. */ + public columns: google.cloud.bigquery.v2.IStandardSqlField[]; + + /** + * Creates a new StandardSqlTableType instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSqlTableType instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStandardSqlTableType): google.cloud.bigquery.v2.StandardSqlTableType; + + /** + * Encodes the specified StandardSqlTableType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlTableType.verify|verify} messages. + * @param message StandardSqlTableType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStandardSqlTableType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSqlTableType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlTableType.verify|verify} messages. + * @param message StandardSqlTableType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStandardSqlTableType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSqlTableType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSqlTableType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StandardSqlTableType; + + /** + * Decodes a StandardSqlTableType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSqlTableType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StandardSqlTableType; + + /** + * Verifies a StandardSqlTableType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSqlTableType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSqlTableType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StandardSqlTableType; + + /** + * Creates a plain object from a StandardSqlTableType message. Also converts values to other types if specified. + * @param message StandardSqlTableType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StandardSqlTableType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSqlTableType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSqlTableType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimePartitioning. */ + interface ITimePartitioning { + + /** TimePartitioning type */ + type?: (string|null); + + /** TimePartitioning expirationMs */ + expirationMs?: (google.protobuf.IInt64Value|null); + + /** TimePartitioning field */ + field?: (google.protobuf.IStringValue|null); + } + + /** Represents a TimePartitioning. */ + class TimePartitioning implements ITimePartitioning { + + /** + * Constructs a new TimePartitioning. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITimePartitioning); + + /** TimePartitioning type. */ + public type: string; + + /** TimePartitioning expirationMs. */ + public expirationMs?: (google.protobuf.IInt64Value|null); + + /** TimePartitioning field. */ + public field?: (google.protobuf.IStringValue|null); + + /** + * Creates a new TimePartitioning instance using the specified properties. + * @param [properties] Properties to set + * @returns TimePartitioning instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITimePartitioning): google.cloud.bigquery.v2.TimePartitioning; + + /** + * Encodes the specified TimePartitioning message. Does not implicitly {@link google.cloud.bigquery.v2.TimePartitioning.verify|verify} messages. + * @param message TimePartitioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITimePartitioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimePartitioning message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TimePartitioning.verify|verify} messages. + * @param message TimePartitioning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITimePartitioning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimePartitioning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TimePartitioning; + + /** + * Decodes a TimePartitioning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TimePartitioning; + + /** + * Verifies a TimePartitioning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimePartitioning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimePartitioning + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TimePartitioning; + + /** + * Creates a plain object from a TimePartitioning message. Also converts values to other types if specified. + * @param message TimePartitioning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TimePartitioning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimePartitioning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimePartitioning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserDefinedFunctionResource. */ + interface IUserDefinedFunctionResource { + + /** UserDefinedFunctionResource resourceUri */ + resourceUri?: (google.protobuf.IStringValue|null); + + /** UserDefinedFunctionResource inlineCode */ + inlineCode?: (google.protobuf.IStringValue|null); + } + + /** Represents a UserDefinedFunctionResource. */ + class UserDefinedFunctionResource implements IUserDefinedFunctionResource { + + /** + * Constructs a new UserDefinedFunctionResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUserDefinedFunctionResource); + + /** UserDefinedFunctionResource resourceUri. */ + public resourceUri?: (google.protobuf.IStringValue|null); + + /** UserDefinedFunctionResource inlineCode. */ + public inlineCode?: (google.protobuf.IStringValue|null); + + /** + * Creates a new UserDefinedFunctionResource instance using the specified properties. + * @param [properties] Properties to set + * @returns UserDefinedFunctionResource instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUserDefinedFunctionResource): google.cloud.bigquery.v2.UserDefinedFunctionResource; + + /** + * Encodes the specified UserDefinedFunctionResource message. Does not implicitly {@link google.cloud.bigquery.v2.UserDefinedFunctionResource.verify|verify} messages. + * @param message UserDefinedFunctionResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUserDefinedFunctionResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserDefinedFunctionResource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UserDefinedFunctionResource.verify|verify} messages. + * @param message UserDefinedFunctionResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUserDefinedFunctionResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserDefinedFunctionResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserDefinedFunctionResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UserDefinedFunctionResource; + + /** + * Decodes a UserDefinedFunctionResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserDefinedFunctionResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UserDefinedFunctionResource; + + /** + * Verifies a UserDefinedFunctionResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserDefinedFunctionResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserDefinedFunctionResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UserDefinedFunctionResource; + + /** + * Creates a plain object from a UserDefinedFunctionResource message. Also converts values to other types if specified. + * @param message UserDefinedFunctionResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UserDefinedFunctionResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserDefinedFunctionResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserDefinedFunctionResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobCreationReason. */ + interface IJobCreationReason { + + /** JobCreationReason code */ + code?: (google.cloud.bigquery.v2.JobCreationReason.Code|keyof typeof google.cloud.bigquery.v2.JobCreationReason.Code|null); + } + + /** Represents a JobCreationReason. */ + class JobCreationReason implements IJobCreationReason { + + /** + * Constructs a new JobCreationReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobCreationReason); + + /** JobCreationReason code. */ + public code: (google.cloud.bigquery.v2.JobCreationReason.Code|keyof typeof google.cloud.bigquery.v2.JobCreationReason.Code); + + /** + * Creates a new JobCreationReason instance using the specified properties. + * @param [properties] Properties to set + * @returns JobCreationReason instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobCreationReason): google.cloud.bigquery.v2.JobCreationReason; + + /** + * Encodes the specified JobCreationReason message. Does not implicitly {@link google.cloud.bigquery.v2.JobCreationReason.verify|verify} messages. + * @param message JobCreationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobCreationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobCreationReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobCreationReason.verify|verify} messages. + * @param message JobCreationReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobCreationReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobCreationReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobCreationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobCreationReason; + + /** + * Decodes a JobCreationReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobCreationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobCreationReason; + + /** + * Verifies a JobCreationReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobCreationReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobCreationReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobCreationReason; + + /** + * Creates a plain object from a JobCreationReason message. Also converts values to other types if specified. + * @param message JobCreationReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobCreationReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobCreationReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobCreationReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobCreationReason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + REQUESTED = 1, + LONG_RUNNING = 2, + LARGE_RESULTS = 3, + OTHER = 4 + } + } + + /** Properties of a JobReference. */ + interface IJobReference { + + /** JobReference projectId */ + projectId?: (string|null); + + /** JobReference jobId */ + jobId?: (string|null); + + /** JobReference location */ + location?: (google.protobuf.IStringValue|null); + } + + /** Represents a JobReference. */ + class JobReference implements IJobReference { + + /** + * Constructs a new JobReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobReference); + + /** JobReference projectId. */ + public projectId: string; + + /** JobReference jobId. */ + public jobId: string; + + /** JobReference location. */ + public location?: (google.protobuf.IStringValue|null); + + /** + * Creates a new JobReference instance using the specified properties. + * @param [properties] Properties to set + * @returns JobReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobReference): google.cloud.bigquery.v2.JobReference; + + /** + * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.bigquery.v2.JobReference.verify|verify} messages. + * @param message JobReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobReference.verify|verify} messages. + * @param message JobReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobReference; + + /** + * Decodes a JobReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobReference; + + /** + * Verifies a JobReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobReference; + + /** + * Creates a plain object from a JobReference message. Also converts values to other types if specified. + * @param message JobReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplainQueryStep. */ + interface IExplainQueryStep { + + /** ExplainQueryStep kind */ + kind?: (string|null); + + /** ExplainQueryStep substeps */ + substeps?: (string[]|null); + } + + /** Represents an ExplainQueryStep. */ + class ExplainQueryStep implements IExplainQueryStep { + + /** + * Constructs a new ExplainQueryStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExplainQueryStep); + + /** ExplainQueryStep kind. */ + public kind: string; + + /** ExplainQueryStep substeps. */ + public substeps: string[]; + + /** + * Creates a new ExplainQueryStep instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainQueryStep instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExplainQueryStep): google.cloud.bigquery.v2.ExplainQueryStep; + + /** + * Encodes the specified ExplainQueryStep message. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStep.verify|verify} messages. + * @param message ExplainQueryStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExplainQueryStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainQueryStep message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStep.verify|verify} messages. + * @param message ExplainQueryStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExplainQueryStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainQueryStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainQueryStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExplainQueryStep; + + /** + * Decodes an ExplainQueryStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainQueryStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExplainQueryStep; + + /** + * Verifies an ExplainQueryStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExplainQueryStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainQueryStep + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExplainQueryStep; + + /** + * Creates a plain object from an ExplainQueryStep message. Also converts values to other types if specified. + * @param message ExplainQueryStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExplainQueryStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainQueryStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainQueryStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplainQueryStage. */ + interface IExplainQueryStage { + + /** ExplainQueryStage name */ + name?: (string|null); + + /** ExplainQueryStage id */ + id?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage startMs */ + startMs?: (number|Long|string|null); + + /** ExplainQueryStage endMs */ + endMs?: (number|Long|string|null); + + /** ExplainQueryStage inputStages */ + inputStages?: ((number|Long|string)[]|null); + + /** ExplainQueryStage waitRatioAvg */ + waitRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage waitMsAvg */ + waitMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage waitRatioMax */ + waitRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage waitMsMax */ + waitMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage readRatioAvg */ + readRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage readMsAvg */ + readMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage readRatioMax */ + readRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage readMsMax */ + readMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeRatioAvg */ + computeRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage computeMsAvg */ + computeMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeRatioMax */ + computeRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage computeMsMax */ + computeMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage writeRatioAvg */ + writeRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage writeMsAvg */ + writeMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage writeRatioMax */ + writeRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage writeMsMax */ + writeMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage shuffleOutputBytes */ + shuffleOutputBytes?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage shuffleOutputBytesSpilled */ + shuffleOutputBytesSpilled?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage recordsRead */ + recordsRead?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage recordsWritten */ + recordsWritten?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage parallelInputs */ + parallelInputs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage completedParallelInputs */ + completedParallelInputs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage status */ + status?: (string|null); + + /** ExplainQueryStage steps */ + steps?: (google.cloud.bigquery.v2.IExplainQueryStep[]|null); + + /** ExplainQueryStage slotMs */ + slotMs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeMode */ + computeMode?: (google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode|keyof typeof google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode|null); + } + + /** Represents an ExplainQueryStage. */ + class ExplainQueryStage implements IExplainQueryStage { + + /** + * Constructs a new ExplainQueryStage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExplainQueryStage); + + /** ExplainQueryStage name. */ + public name: string; + + /** ExplainQueryStage id. */ + public id?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage startMs. */ + public startMs: (number|Long|string); + + /** ExplainQueryStage endMs. */ + public endMs: (number|Long|string); + + /** ExplainQueryStage inputStages. */ + public inputStages: (number|Long|string)[]; + + /** ExplainQueryStage waitRatioAvg. */ + public waitRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage waitMsAvg. */ + public waitMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage waitRatioMax. */ + public waitRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage waitMsMax. */ + public waitMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage readRatioAvg. */ + public readRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage readMsAvg. */ + public readMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage readRatioMax. */ + public readRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage readMsMax. */ + public readMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeRatioAvg. */ + public computeRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage computeMsAvg. */ + public computeMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeRatioMax. */ + public computeRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage computeMsMax. */ + public computeMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage writeRatioAvg. */ + public writeRatioAvg?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage writeMsAvg. */ + public writeMsAvg?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage writeRatioMax. */ + public writeRatioMax?: (google.protobuf.IDoubleValue|null); + + /** ExplainQueryStage writeMsMax. */ + public writeMsMax?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage shuffleOutputBytes. */ + public shuffleOutputBytes?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage shuffleOutputBytesSpilled. */ + public shuffleOutputBytesSpilled?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage recordsRead. */ + public recordsRead?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage recordsWritten. */ + public recordsWritten?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage parallelInputs. */ + public parallelInputs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage completedParallelInputs. */ + public completedParallelInputs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage status. */ + public status: string; + + /** ExplainQueryStage steps. */ + public steps: google.cloud.bigquery.v2.IExplainQueryStep[]; + + /** ExplainQueryStage slotMs. */ + public slotMs?: (google.protobuf.IInt64Value|null); + + /** ExplainQueryStage computeMode. */ + public computeMode: (google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode|keyof typeof google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode); + + /** + * Creates a new ExplainQueryStage instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainQueryStage instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExplainQueryStage): google.cloud.bigquery.v2.ExplainQueryStage; + + /** + * Encodes the specified ExplainQueryStage message. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStage.verify|verify} messages. + * @param message ExplainQueryStage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExplainQueryStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainQueryStage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStage.verify|verify} messages. + * @param message ExplainQueryStage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExplainQueryStage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainQueryStage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainQueryStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExplainQueryStage; + + /** + * Decodes an ExplainQueryStage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainQueryStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExplainQueryStage; + + /** + * Verifies an ExplainQueryStage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExplainQueryStage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainQueryStage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExplainQueryStage; + + /** + * Creates a plain object from an ExplainQueryStage message. Also converts values to other types if specified. + * @param message ExplainQueryStage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExplainQueryStage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainQueryStage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainQueryStage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExplainQueryStage { + + /** ComputeMode enum. */ + enum ComputeMode { + COMPUTE_MODE_UNSPECIFIED = 0, + BIGQUERY = 1, + BI_ENGINE = 2 + } + } + + /** Properties of a QueryTimelineSample. */ + interface IQueryTimelineSample { + + /** QueryTimelineSample elapsedMs */ + elapsedMs?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample totalSlotMs */ + totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample pendingUnits */ + pendingUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample completedUnits */ + completedUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample activeUnits */ + activeUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample shuffleRamUsageRatio */ + shuffleRamUsageRatio?: (google.protobuf.IDoubleValue|null); + + /** QueryTimelineSample estimatedRunnableUnits */ + estimatedRunnableUnits?: (google.protobuf.IInt64Value|null); + } + + /** Represents a QueryTimelineSample. */ + class QueryTimelineSample implements IQueryTimelineSample { + + /** + * Constructs a new QueryTimelineSample. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryTimelineSample); + + /** QueryTimelineSample elapsedMs. */ + public elapsedMs?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample totalSlotMs. */ + public totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample pendingUnits. */ + public pendingUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample completedUnits. */ + public completedUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample activeUnits. */ + public activeUnits?: (google.protobuf.IInt64Value|null); + + /** QueryTimelineSample shuffleRamUsageRatio. */ + public shuffleRamUsageRatio?: (google.protobuf.IDoubleValue|null); + + /** QueryTimelineSample estimatedRunnableUnits. */ + public estimatedRunnableUnits?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new QueryTimelineSample instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryTimelineSample instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryTimelineSample): google.cloud.bigquery.v2.QueryTimelineSample; + + /** + * Encodes the specified QueryTimelineSample message. Does not implicitly {@link google.cloud.bigquery.v2.QueryTimelineSample.verify|verify} messages. + * @param message QueryTimelineSample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryTimelineSample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryTimelineSample message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryTimelineSample.verify|verify} messages. + * @param message QueryTimelineSample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryTimelineSample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryTimelineSample message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryTimelineSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryTimelineSample; + + /** + * Decodes a QueryTimelineSample message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryTimelineSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryTimelineSample; + + /** + * Verifies a QueryTimelineSample message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryTimelineSample message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryTimelineSample + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryTimelineSample; + + /** + * Creates a plain object from a QueryTimelineSample message. Also converts values to other types if specified. + * @param message QueryTimelineSample + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryTimelineSample, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryTimelineSample to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryTimelineSample + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalServiceCost. */ + interface IExternalServiceCost { + + /** ExternalServiceCost externalService */ + externalService?: (string|null); + + /** ExternalServiceCost bytesProcessed */ + bytesProcessed?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost bytesBilled */ + bytesBilled?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost slotMs */ + slotMs?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost reservedSlotCount */ + reservedSlotCount?: (number|Long|string|null); + + /** ExternalServiceCost billingMethod */ + billingMethod?: (string|null); + } + + /** Represents an ExternalServiceCost. */ + class ExternalServiceCost implements IExternalServiceCost { + + /** + * Constructs a new ExternalServiceCost. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalServiceCost); + + /** ExternalServiceCost externalService. */ + public externalService: string; + + /** ExternalServiceCost bytesProcessed. */ + public bytesProcessed?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost bytesBilled. */ + public bytesBilled?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost slotMs. */ + public slotMs?: (google.protobuf.IInt64Value|null); + + /** ExternalServiceCost reservedSlotCount. */ + public reservedSlotCount: (number|Long|string); + + /** ExternalServiceCost billingMethod. */ + public billingMethod: string; + + /** + * Creates a new ExternalServiceCost instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalServiceCost instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalServiceCost): google.cloud.bigquery.v2.ExternalServiceCost; + + /** + * Encodes the specified ExternalServiceCost message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalServiceCost.verify|verify} messages. + * @param message ExternalServiceCost message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalServiceCost, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalServiceCost message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalServiceCost.verify|verify} messages. + * @param message ExternalServiceCost message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalServiceCost, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalServiceCost message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalServiceCost + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalServiceCost; + + /** + * Decodes an ExternalServiceCost message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalServiceCost + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalServiceCost; + + /** + * Verifies an ExternalServiceCost message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalServiceCost message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalServiceCost + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalServiceCost; + + /** + * Creates a plain object from an ExternalServiceCost message. Also converts values to other types if specified. + * @param message ExternalServiceCost + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalServiceCost, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalServiceCost to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalServiceCost + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataStatistics. */ + interface IExportDataStatistics { + + /** ExportDataStatistics fileCount */ + fileCount?: (google.protobuf.IInt64Value|null); + + /** ExportDataStatistics rowCount */ + rowCount?: (google.protobuf.IInt64Value|null); + } + + /** Represents an ExportDataStatistics. */ + class ExportDataStatistics implements IExportDataStatistics { + + /** + * Constructs a new ExportDataStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExportDataStatistics); + + /** ExportDataStatistics fileCount. */ + public fileCount?: (google.protobuf.IInt64Value|null); + + /** ExportDataStatistics rowCount. */ + public rowCount?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new ExportDataStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExportDataStatistics): google.cloud.bigquery.v2.ExportDataStatistics; + + /** + * Encodes the specified ExportDataStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.ExportDataStatistics.verify|verify} messages. + * @param message ExportDataStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExportDataStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExportDataStatistics.verify|verify} messages. + * @param message ExportDataStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExportDataStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExportDataStatistics; + + /** + * Decodes an ExportDataStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExportDataStatistics; + + /** + * Verifies an ExportDataStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportDataStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExportDataStatistics; + + /** + * Creates a plain object from an ExportDataStatistics message. Also converts values to other types if specified. + * @param message ExportDataStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExportDataStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BiEngineReason. */ + interface IBiEngineReason { + + /** BiEngineReason code */ + code?: (google.cloud.bigquery.v2.BiEngineReason.Code|keyof typeof google.cloud.bigquery.v2.BiEngineReason.Code|null); + + /** BiEngineReason message */ + message?: (string|null); + } + + /** Represents a BiEngineReason. */ + class BiEngineReason implements IBiEngineReason { + + /** + * Constructs a new BiEngineReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBiEngineReason); + + /** BiEngineReason code. */ + public code: (google.cloud.bigquery.v2.BiEngineReason.Code|keyof typeof google.cloud.bigquery.v2.BiEngineReason.Code); + + /** BiEngineReason message. */ + public message: string; + + /** + * Creates a new BiEngineReason instance using the specified properties. + * @param [properties] Properties to set + * @returns BiEngineReason instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBiEngineReason): google.cloud.bigquery.v2.BiEngineReason; + + /** + * Encodes the specified BiEngineReason message. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineReason.verify|verify} messages. + * @param message BiEngineReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBiEngineReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BiEngineReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineReason.verify|verify} messages. + * @param message BiEngineReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBiEngineReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BiEngineReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BiEngineReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BiEngineReason; + + /** + * Decodes a BiEngineReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BiEngineReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BiEngineReason; + + /** + * Verifies a BiEngineReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BiEngineReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BiEngineReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BiEngineReason; + + /** + * Creates a plain object from a BiEngineReason message. Also converts values to other types if specified. + * @param message BiEngineReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BiEngineReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BiEngineReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BiEngineReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BiEngineReason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + INSUFFICIENT_RESERVATION = 2, + UNSUPPORTED_SQL_TEXT = 4, + INPUT_TOO_LARGE = 5, + OTHER_REASON = 6, + TABLE_EXCLUDED = 7 + } + } + + /** Properties of a BiEngineStatistics. */ + interface IBiEngineStatistics { + + /** BiEngineStatistics biEngineMode */ + biEngineMode?: (google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode|keyof typeof google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode|null); + + /** BiEngineStatistics accelerationMode */ + accelerationMode?: (google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode|keyof typeof google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode|null); + + /** BiEngineStatistics biEngineReasons */ + biEngineReasons?: (google.cloud.bigquery.v2.IBiEngineReason[]|null); + } + + /** Represents a BiEngineStatistics. */ + class BiEngineStatistics implements IBiEngineStatistics { + + /** + * Constructs a new BiEngineStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBiEngineStatistics); + + /** BiEngineStatistics biEngineMode. */ + public biEngineMode: (google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode|keyof typeof google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode); + + /** BiEngineStatistics accelerationMode. */ + public accelerationMode: (google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode|keyof typeof google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode); + + /** BiEngineStatistics biEngineReasons. */ + public biEngineReasons: google.cloud.bigquery.v2.IBiEngineReason[]; + + /** + * Creates a new BiEngineStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns BiEngineStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBiEngineStatistics): google.cloud.bigquery.v2.BiEngineStatistics; + + /** + * Encodes the specified BiEngineStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineStatistics.verify|verify} messages. + * @param message BiEngineStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBiEngineStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BiEngineStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineStatistics.verify|verify} messages. + * @param message BiEngineStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBiEngineStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BiEngineStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BiEngineStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BiEngineStatistics; + + /** + * Decodes a BiEngineStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BiEngineStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BiEngineStatistics; + + /** + * Verifies a BiEngineStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BiEngineStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BiEngineStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BiEngineStatistics; + + /** + * Creates a plain object from a BiEngineStatistics message. Also converts values to other types if specified. + * @param message BiEngineStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BiEngineStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BiEngineStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BiEngineStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BiEngineStatistics { + + /** BiEngineMode enum. */ + enum BiEngineMode { + ACCELERATION_MODE_UNSPECIFIED = 0, + DISABLED = 1, + PARTIAL = 2, + FULL = 3 + } + + /** BiEngineAccelerationMode enum. */ + enum BiEngineAccelerationMode { + BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED = 0, + BI_ENGINE_DISABLED = 1, + PARTIAL_INPUT = 2, + FULL_INPUT = 3, + FULL_QUERY = 4 + } + } + + /** Properties of an IndexUnusedReason. */ + interface IIndexUnusedReason { + + /** IndexUnusedReason code */ + code?: (google.cloud.bigquery.v2.IndexUnusedReason.Code|keyof typeof google.cloud.bigquery.v2.IndexUnusedReason.Code|null); + + /** IndexUnusedReason message */ + message?: (string|null); + + /** IndexUnusedReason baseTable */ + baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** IndexUnusedReason indexName */ + indexName?: (string|null); + } + + /** Represents an IndexUnusedReason. */ + class IndexUnusedReason implements IIndexUnusedReason { + + /** + * Constructs a new IndexUnusedReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IIndexUnusedReason); + + /** IndexUnusedReason code. */ + public code?: (google.cloud.bigquery.v2.IndexUnusedReason.Code|keyof typeof google.cloud.bigquery.v2.IndexUnusedReason.Code|null); + + /** IndexUnusedReason message. */ + public message?: (string|null); + + /** IndexUnusedReason baseTable. */ + public baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** IndexUnusedReason indexName. */ + public indexName?: (string|null); + + /** + * Creates a new IndexUnusedReason instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexUnusedReason instance + */ + public static create(properties?: google.cloud.bigquery.v2.IIndexUnusedReason): google.cloud.bigquery.v2.IndexUnusedReason; + + /** + * Encodes the specified IndexUnusedReason message. Does not implicitly {@link google.cloud.bigquery.v2.IndexUnusedReason.verify|verify} messages. + * @param message IndexUnusedReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IIndexUnusedReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexUnusedReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IndexUnusedReason.verify|verify} messages. + * @param message IndexUnusedReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IIndexUnusedReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexUnusedReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.IndexUnusedReason; + + /** + * Decodes an IndexUnusedReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.IndexUnusedReason; + + /** + * Verifies an IndexUnusedReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IndexUnusedReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexUnusedReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.IndexUnusedReason; + + /** + * Creates a plain object from an IndexUnusedReason message. Also converts values to other types if specified. + * @param message IndexUnusedReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.IndexUnusedReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexUnusedReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexUnusedReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IndexUnusedReason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + INDEX_CONFIG_NOT_AVAILABLE = 1, + PENDING_INDEX_CREATION = 2, + BASE_TABLE_TRUNCATED = 3, + INDEX_CONFIG_MODIFIED = 4, + TIME_TRAVEL_QUERY = 5, + NO_PRUNING_POWER = 6, + UNINDEXED_SEARCH_FIELDS = 7, + UNSUPPORTED_SEARCH_PATTERN = 8, + OPTIMIZED_WITH_MATERIALIZED_VIEW = 9, + SECURED_BY_DATA_MASKING = 11, + MISMATCHED_TEXT_ANALYZER = 12, + BASE_TABLE_TOO_SMALL = 13, + BASE_TABLE_TOO_LARGE = 14, + ESTIMATED_PERFORMANCE_GAIN_TOO_LOW = 15, + COLUMN_METADATA_INDEX_NOT_USED = 21, + NOT_SUPPORTED_IN_STANDARD_EDITION = 17, + INDEX_SUPPRESSED_BY_FUNCTION_OPTION = 18, + QUERY_CACHE_HIT = 19, + STALE_INDEX = 20, + INTERNAL_ERROR = 10, + OTHER_REASON = 16 + } + } + + /** Properties of an IndexPruningStats. */ + interface IIndexPruningStats { + + /** IndexPruningStats baseTable */ + baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** IndexPruningStats indexId */ + indexId?: (string|null); + + /** IndexPruningStats preIndexPruningParallelInputCount */ + preIndexPruningParallelInputCount?: (number|Long|string|null); + + /** IndexPruningStats postIndexPruningParallelInputCount */ + postIndexPruningParallelInputCount?: (number|Long|string|null); + } + + /** Represents an IndexPruningStats. */ + class IndexPruningStats implements IIndexPruningStats { + + /** + * Constructs a new IndexPruningStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IIndexPruningStats); + + /** IndexPruningStats baseTable. */ + public baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** IndexPruningStats indexId. */ + public indexId?: (string|null); + + /** IndexPruningStats preIndexPruningParallelInputCount. */ + public preIndexPruningParallelInputCount?: (number|Long|string|null); + + /** IndexPruningStats postIndexPruningParallelInputCount. */ + public postIndexPruningParallelInputCount?: (number|Long|string|null); + + /** + * Creates a new IndexPruningStats instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexPruningStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IIndexPruningStats): google.cloud.bigquery.v2.IndexPruningStats; + + /** + * Encodes the specified IndexPruningStats message. Does not implicitly {@link google.cloud.bigquery.v2.IndexPruningStats.verify|verify} messages. + * @param message IndexPruningStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IIndexPruningStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexPruningStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IndexPruningStats.verify|verify} messages. + * @param message IndexPruningStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IIndexPruningStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexPruningStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexPruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.IndexPruningStats; + + /** + * Decodes an IndexPruningStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexPruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.IndexPruningStats; + + /** + * Verifies an IndexPruningStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IndexPruningStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexPruningStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.IndexPruningStats; + + /** + * Creates a plain object from an IndexPruningStats message. Also converts values to other types if specified. + * @param message IndexPruningStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.IndexPruningStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexPruningStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexPruningStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StoredColumnsUsage. */ + interface IStoredColumnsUsage { + + /** StoredColumnsUsage isQueryAccelerated */ + isQueryAccelerated?: (boolean|null); + + /** StoredColumnsUsage baseTable */ + baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** StoredColumnsUsage storedColumnsUnusedReasons */ + storedColumnsUnusedReasons?: (google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason[]|null); + } + + /** Represents a StoredColumnsUsage. */ + class StoredColumnsUsage implements IStoredColumnsUsage { + + /** + * Constructs a new StoredColumnsUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStoredColumnsUsage); + + /** StoredColumnsUsage isQueryAccelerated. */ + public isQueryAccelerated?: (boolean|null); + + /** StoredColumnsUsage baseTable. */ + public baseTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** StoredColumnsUsage storedColumnsUnusedReasons. */ + public storedColumnsUnusedReasons: google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason[]; + + /** + * Creates a new StoredColumnsUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredColumnsUsage instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStoredColumnsUsage): google.cloud.bigquery.v2.StoredColumnsUsage; + + /** + * Encodes the specified StoredColumnsUsage message. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.verify|verify} messages. + * @param message StoredColumnsUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStoredColumnsUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredColumnsUsage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.verify|verify} messages. + * @param message StoredColumnsUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStoredColumnsUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredColumnsUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredColumnsUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StoredColumnsUsage; + + /** + * Decodes a StoredColumnsUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredColumnsUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StoredColumnsUsage; + + /** + * Verifies a StoredColumnsUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StoredColumnsUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredColumnsUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StoredColumnsUsage; + + /** + * Creates a plain object from a StoredColumnsUsage message. Also converts values to other types if specified. + * @param message StoredColumnsUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StoredColumnsUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredColumnsUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StoredColumnsUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StoredColumnsUsage { + + /** Properties of a StoredColumnsUnusedReason. */ + interface IStoredColumnsUnusedReason { + + /** StoredColumnsUnusedReason code */ + code?: (google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|keyof typeof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|null); + + /** StoredColumnsUnusedReason message */ + message?: (string|null); + + /** StoredColumnsUnusedReason uncoveredColumns */ + uncoveredColumns?: (string[]|null); + } + + /** Represents a StoredColumnsUnusedReason. */ + class StoredColumnsUnusedReason implements IStoredColumnsUnusedReason { + + /** + * Constructs a new StoredColumnsUnusedReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason); + + /** StoredColumnsUnusedReason code. */ + public code?: (google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|keyof typeof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|null); + + /** StoredColumnsUnusedReason message. */ + public message?: (string|null); + + /** StoredColumnsUnusedReason uncoveredColumns. */ + public uncoveredColumns: string[]; + + /** + * Creates a new StoredColumnsUnusedReason instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredColumnsUnusedReason instance + */ + public static create(properties?: google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason): google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason; + + /** + * Encodes the specified StoredColumnsUnusedReason message. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.verify|verify} messages. + * @param message StoredColumnsUnusedReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredColumnsUnusedReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.verify|verify} messages. + * @param message StoredColumnsUnusedReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredColumnsUnusedReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredColumnsUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason; + + /** + * Decodes a StoredColumnsUnusedReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredColumnsUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason; + + /** + * Verifies a StoredColumnsUnusedReason message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StoredColumnsUnusedReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredColumnsUnusedReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason; + + /** + * Creates a plain object from a StoredColumnsUnusedReason message. Also converts values to other types if specified. + * @param message StoredColumnsUnusedReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredColumnsUnusedReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StoredColumnsUnusedReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StoredColumnsUnusedReason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + STORED_COLUMNS_COVER_INSUFFICIENT = 1, + BASE_TABLE_HAS_RLS = 2, + BASE_TABLE_HAS_CLS = 3, + UNSUPPORTED_PREFILTER = 4, + INTERNAL_ERROR = 5, + OTHER_REASON = 6 + } + } + } + + /** Properties of a SearchStatistics. */ + interface ISearchStatistics { + + /** SearchStatistics indexUsageMode */ + indexUsageMode?: (google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode|keyof typeof google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode|null); + + /** SearchStatistics indexUnusedReasons */ + indexUnusedReasons?: (google.cloud.bigquery.v2.IIndexUnusedReason[]|null); + + /** SearchStatistics indexPruningStats */ + indexPruningStats?: (google.cloud.bigquery.v2.IIndexPruningStats[]|null); + } + + /** Represents a SearchStatistics. */ + class SearchStatistics implements ISearchStatistics { + + /** + * Constructs a new SearchStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISearchStatistics); + + /** SearchStatistics indexUsageMode. */ + public indexUsageMode: (google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode|keyof typeof google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode); + + /** SearchStatistics indexUnusedReasons. */ + public indexUnusedReasons: google.cloud.bigquery.v2.IIndexUnusedReason[]; + + /** SearchStatistics indexPruningStats. */ + public indexPruningStats: google.cloud.bigquery.v2.IIndexPruningStats[]; + + /** + * Creates a new SearchStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISearchStatistics): google.cloud.bigquery.v2.SearchStatistics; + + /** + * Encodes the specified SearchStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.SearchStatistics.verify|verify} messages. + * @param message SearchStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISearchStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SearchStatistics.verify|verify} messages. + * @param message SearchStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISearchStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SearchStatistics; + + /** + * Decodes a SearchStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SearchStatistics; + + /** + * Verifies a SearchStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SearchStatistics; + + /** + * Creates a plain object from a SearchStatistics message. Also converts values to other types if specified. + * @param message SearchStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SearchStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SearchStatistics { + + /** IndexUsageMode enum. */ + enum IndexUsageMode { + INDEX_USAGE_MODE_UNSPECIFIED = 0, + UNUSED = 1, + PARTIALLY_USED = 2, + FULLY_USED = 4 + } + } + + /** Properties of a VectorSearchStatistics. */ + interface IVectorSearchStatistics { + + /** VectorSearchStatistics indexUsageMode */ + indexUsageMode?: (google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode|keyof typeof google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode|null); + + /** VectorSearchStatistics indexUnusedReasons */ + indexUnusedReasons?: (google.cloud.bigquery.v2.IIndexUnusedReason[]|null); + + /** VectorSearchStatistics storedColumnsUsages */ + storedColumnsUsages?: (google.cloud.bigquery.v2.IStoredColumnsUsage[]|null); + } + + /** Represents a VectorSearchStatistics. */ + class VectorSearchStatistics implements IVectorSearchStatistics { + + /** + * Constructs a new VectorSearchStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IVectorSearchStatistics); + + /** VectorSearchStatistics indexUsageMode. */ + public indexUsageMode: (google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode|keyof typeof google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode); + + /** VectorSearchStatistics indexUnusedReasons. */ + public indexUnusedReasons: google.cloud.bigquery.v2.IIndexUnusedReason[]; + + /** VectorSearchStatistics storedColumnsUsages. */ + public storedColumnsUsages: google.cloud.bigquery.v2.IStoredColumnsUsage[]; + + /** + * Creates a new VectorSearchStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns VectorSearchStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IVectorSearchStatistics): google.cloud.bigquery.v2.VectorSearchStatistics; + + /** + * Encodes the specified VectorSearchStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.VectorSearchStatistics.verify|verify} messages. + * @param message VectorSearchStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IVectorSearchStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VectorSearchStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.VectorSearchStatistics.verify|verify} messages. + * @param message VectorSearchStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IVectorSearchStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VectorSearchStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VectorSearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.VectorSearchStatistics; + + /** + * Decodes a VectorSearchStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VectorSearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.VectorSearchStatistics; + + /** + * Verifies a VectorSearchStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VectorSearchStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VectorSearchStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.VectorSearchStatistics; + + /** + * Creates a plain object from a VectorSearchStatistics message. Also converts values to other types if specified. + * @param message VectorSearchStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.VectorSearchStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VectorSearchStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VectorSearchStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VectorSearchStatistics { + + /** IndexUsageMode enum. */ + enum IndexUsageMode { + INDEX_USAGE_MODE_UNSPECIFIED = 0, + UNUSED = 1, + PARTIALLY_USED = 2, + FULLY_USED = 4 + } + } + + /** Properties of a QueryInfo. */ + interface IQueryInfo { + + /** QueryInfo optimizationDetails */ + optimizationDetails?: (google.protobuf.IStruct|null); + } + + /** Represents a QueryInfo. */ + class QueryInfo implements IQueryInfo { + + /** + * Constructs a new QueryInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IQueryInfo); + + /** QueryInfo optimizationDetails. */ + public optimizationDetails?: (google.protobuf.IStruct|null); + + /** + * Creates a new QueryInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.IQueryInfo): google.cloud.bigquery.v2.QueryInfo; + + /** + * Encodes the specified QueryInfo message. Does not implicitly {@link google.cloud.bigquery.v2.QueryInfo.verify|verify} messages. + * @param message QueryInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IQueryInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryInfo.verify|verify} messages. + * @param message QueryInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IQueryInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.QueryInfo; + + /** + * Decodes a QueryInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.QueryInfo; + + /** + * Verifies a QueryInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.QueryInfo; + + /** + * Creates a plain object from a QueryInfo message. Also converts values to other types if specified. + * @param message QueryInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.QueryInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoadQueryStatistics. */ + interface ILoadQueryStatistics { + + /** LoadQueryStatistics inputFiles */ + inputFiles?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics inputFileBytes */ + inputFileBytes?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics outputRows */ + outputRows?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics outputBytes */ + outputBytes?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics badRecords */ + badRecords?: (google.protobuf.IInt64Value|null); + } + + /** Represents a LoadQueryStatistics. */ + class LoadQueryStatistics implements ILoadQueryStatistics { + + /** + * Constructs a new LoadQueryStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ILoadQueryStatistics); + + /** LoadQueryStatistics inputFiles. */ + public inputFiles?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics inputFileBytes. */ + public inputFileBytes?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics outputRows. */ + public outputRows?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics outputBytes. */ + public outputBytes?: (google.protobuf.IInt64Value|null); + + /** LoadQueryStatistics badRecords. */ + public badRecords?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new LoadQueryStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadQueryStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.ILoadQueryStatistics): google.cloud.bigquery.v2.LoadQueryStatistics; + + /** + * Encodes the specified LoadQueryStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.LoadQueryStatistics.verify|verify} messages. + * @param message LoadQueryStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ILoadQueryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadQueryStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LoadQueryStatistics.verify|verify} messages. + * @param message LoadQueryStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ILoadQueryStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadQueryStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadQueryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.LoadQueryStatistics; + + /** + * Decodes a LoadQueryStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadQueryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.LoadQueryStatistics; + + /** + * Verifies a LoadQueryStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoadQueryStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadQueryStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.LoadQueryStatistics; + + /** + * Creates a plain object from a LoadQueryStatistics message. Also converts values to other types if specified. + * @param message LoadQueryStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.LoadQueryStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadQueryStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadQueryStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IncrementalResultStats. */ + interface IIncrementalResultStats { + + /** IncrementalResultStats disabledReason */ + disabledReason?: (google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason|keyof typeof google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason|null); + + /** IncrementalResultStats disabledReasonDetails */ + disabledReasonDetails?: (string|null); + + /** IncrementalResultStats resultSetLastReplaceTime */ + resultSetLastReplaceTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats resultSetLastModifyTime */ + resultSetLastModifyTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats firstIncrementalRowTime */ + firstIncrementalRowTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats lastIncrementalRowTime */ + lastIncrementalRowTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats incrementalRowCount */ + incrementalRowCount?: (number|Long|string|null); + } + + /** Represents an IncrementalResultStats. */ + class IncrementalResultStats implements IIncrementalResultStats { + + /** + * Constructs a new IncrementalResultStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IIncrementalResultStats); + + /** IncrementalResultStats disabledReason. */ + public disabledReason: (google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason|keyof typeof google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason); + + /** IncrementalResultStats disabledReasonDetails. */ + public disabledReasonDetails: string; + + /** IncrementalResultStats resultSetLastReplaceTime. */ + public resultSetLastReplaceTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats resultSetLastModifyTime. */ + public resultSetLastModifyTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats firstIncrementalRowTime. */ + public firstIncrementalRowTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats lastIncrementalRowTime. */ + public lastIncrementalRowTime?: (google.protobuf.ITimestamp|null); + + /** IncrementalResultStats incrementalRowCount. */ + public incrementalRowCount?: (number|Long|string|null); + + /** + * Creates a new IncrementalResultStats instance using the specified properties. + * @param [properties] Properties to set + * @returns IncrementalResultStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IIncrementalResultStats): google.cloud.bigquery.v2.IncrementalResultStats; + + /** + * Encodes the specified IncrementalResultStats message. Does not implicitly {@link google.cloud.bigquery.v2.IncrementalResultStats.verify|verify} messages. + * @param message IncrementalResultStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IIncrementalResultStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IncrementalResultStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IncrementalResultStats.verify|verify} messages. + * @param message IncrementalResultStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IIncrementalResultStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IncrementalResultStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IncrementalResultStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.IncrementalResultStats; + + /** + * Decodes an IncrementalResultStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IncrementalResultStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.IncrementalResultStats; + + /** + * Verifies an IncrementalResultStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IncrementalResultStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IncrementalResultStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.IncrementalResultStats; + + /** + * Creates a plain object from an IncrementalResultStats message. Also converts values to other types if specified. + * @param message IncrementalResultStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.IncrementalResultStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IncrementalResultStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IncrementalResultStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IncrementalResultStats { + + /** DisabledReason enum. */ + enum DisabledReason { + DISABLED_REASON_UNSPECIFIED = 0, + OTHER = 1, + UNSUPPORTED_OPERATOR = 2 + } + } + + /** Properties of a JobStatistics2. */ + interface IJobStatistics2 { + + /** JobStatistics2 queryPlan */ + queryPlan?: (google.cloud.bigquery.v2.IExplainQueryStage[]|null); + + /** JobStatistics2 estimatedBytesProcessed */ + estimatedBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 timeline */ + timeline?: (google.cloud.bigquery.v2.IQueryTimelineSample[]|null); + + /** JobStatistics2 totalPartitionsProcessed */ + totalPartitionsProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalBytesProcessed */ + totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalBytesProcessedAccuracy */ + totalBytesProcessedAccuracy?: (string|null); + + /** JobStatistics2 totalBytesBilled */ + totalBytesBilled?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 billingTier */ + billingTier?: (google.protobuf.IInt32Value|null); + + /** JobStatistics2 totalSlotMs */ + totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalServicesSkuSlotMs */ + totalServicesSkuSlotMs?: (number|Long|string|null); + + /** JobStatistics2 cacheHit */ + cacheHit?: (google.protobuf.IBoolValue|null); + + /** JobStatistics2 referencedTables */ + referencedTables?: (google.cloud.bigquery.v2.ITableReference[]|null); + + /** JobStatistics2 referencedRoutines */ + referencedRoutines?: (google.cloud.bigquery.v2.IRoutineReference[]|null); + + /** JobStatistics2 referencedPropertyGraphs */ + referencedPropertyGraphs?: (google.cloud.bigquery.v2.IPropertyGraphReference[]|null); + + /** JobStatistics2 schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** JobStatistics2 numDmlAffectedRows */ + numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 dmlStats */ + dmlStats?: (google.cloud.bigquery.v2.IDmlStats|null); + + /** JobStatistics2 undeclaredQueryParameters */ + undeclaredQueryParameters?: (google.cloud.bigquery.v2.IQueryParameter[]|null); + + /** JobStatistics2 statementType */ + statementType?: (string|null); + + /** JobStatistics2 ddlOperationPerformed */ + ddlOperationPerformed?: (string|null); + + /** JobStatistics2 ddlTargetTable */ + ddlTargetTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 ddlDestinationTable */ + ddlDestinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 ddlTargetRowAccessPolicy */ + ddlTargetRowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicyReference|null); + + /** JobStatistics2 ddlAffectedRowAccessPolicyCount */ + ddlAffectedRowAccessPolicyCount?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 ddlTargetRoutine */ + ddlTargetRoutine?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** JobStatistics2 ddlTargetDataset */ + ddlTargetDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobStatistics2 mlStatistics */ + mlStatistics?: (google.cloud.bigquery.v2.IMlStatistics|null); + + /** JobStatistics2 exportDataStatistics */ + exportDataStatistics?: (google.cloud.bigquery.v2.IExportDataStatistics|null); + + /** JobStatistics2 externalServiceCosts */ + externalServiceCosts?: (google.cloud.bigquery.v2.IExternalServiceCost[]|null); + + /** JobStatistics2 biEngineStatistics */ + biEngineStatistics?: (google.cloud.bigquery.v2.IBiEngineStatistics|null); + + /** JobStatistics2 loadQueryStatistics */ + loadQueryStatistics?: (google.cloud.bigquery.v2.ILoadQueryStatistics|null); + + /** JobStatistics2 dclTargetTable */ + dclTargetTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 dclTargetView */ + dclTargetView?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 dclTargetDataset */ + dclTargetDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobStatistics2 searchStatistics */ + searchStatistics?: (google.cloud.bigquery.v2.ISearchStatistics|null); + + /** JobStatistics2 vectorSearchStatistics */ + vectorSearchStatistics?: (google.cloud.bigquery.v2.IVectorSearchStatistics|null); + + /** JobStatistics2 performanceInsights */ + performanceInsights?: (google.cloud.bigquery.v2.IPerformanceInsights|null); + + /** JobStatistics2 queryInfo */ + queryInfo?: (google.cloud.bigquery.v2.IQueryInfo|null); + + /** JobStatistics2 sparkStatistics */ + sparkStatistics?: (google.cloud.bigquery.v2.ISparkStatistics|null); + + /** JobStatistics2 transferredBytes */ + transferredBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 materializedViewStatistics */ + materializedViewStatistics?: (google.cloud.bigquery.v2.IMaterializedViewStatistics|null); + + /** JobStatistics2 metadataCacheStatistics */ + metadataCacheStatistics?: (google.cloud.bigquery.v2.IMetadataCacheStatistics|null); + + /** JobStatistics2 incrementalResultStats */ + incrementalResultStats?: (google.cloud.bigquery.v2.IIncrementalResultStats|null); + + /** JobStatistics2 genAiStats */ + genAiStats?: (google.cloud.bigquery.v2.IGenAiStats|null); + } + + /** Represents a JobStatistics2. */ + class JobStatistics2 implements IJobStatistics2 { + + /** + * Constructs a new JobStatistics2. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobStatistics2); + + /** JobStatistics2 queryPlan. */ + public queryPlan: google.cloud.bigquery.v2.IExplainQueryStage[]; + + /** JobStatistics2 estimatedBytesProcessed. */ + public estimatedBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 timeline. */ + public timeline: google.cloud.bigquery.v2.IQueryTimelineSample[]; + + /** JobStatistics2 totalPartitionsProcessed. */ + public totalPartitionsProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalBytesProcessed. */ + public totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalBytesProcessedAccuracy. */ + public totalBytesProcessedAccuracy: string; + + /** JobStatistics2 totalBytesBilled. */ + public totalBytesBilled?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 billingTier. */ + public billingTier?: (google.protobuf.IInt32Value|null); + + /** JobStatistics2 totalSlotMs. */ + public totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 totalServicesSkuSlotMs. */ + public totalServicesSkuSlotMs?: (number|Long|string|null); + + /** JobStatistics2 cacheHit. */ + public cacheHit?: (google.protobuf.IBoolValue|null); + + /** JobStatistics2 referencedTables. */ + public referencedTables: google.cloud.bigquery.v2.ITableReference[]; + + /** JobStatistics2 referencedRoutines. */ + public referencedRoutines: google.cloud.bigquery.v2.IRoutineReference[]; + + /** JobStatistics2 referencedPropertyGraphs. */ + public referencedPropertyGraphs: google.cloud.bigquery.v2.IPropertyGraphReference[]; + + /** JobStatistics2 schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** JobStatistics2 numDmlAffectedRows. */ + public numDmlAffectedRows?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 dmlStats. */ + public dmlStats?: (google.cloud.bigquery.v2.IDmlStats|null); + + /** JobStatistics2 undeclaredQueryParameters. */ + public undeclaredQueryParameters: google.cloud.bigquery.v2.IQueryParameter[]; + + /** JobStatistics2 statementType. */ + public statementType: string; + + /** JobStatistics2 ddlOperationPerformed. */ + public ddlOperationPerformed: string; + + /** JobStatistics2 ddlTargetTable. */ + public ddlTargetTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 ddlDestinationTable. */ + public ddlDestinationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 ddlTargetRowAccessPolicy. */ + public ddlTargetRowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicyReference|null); + + /** JobStatistics2 ddlAffectedRowAccessPolicyCount. */ + public ddlAffectedRowAccessPolicyCount?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 ddlTargetRoutine. */ + public ddlTargetRoutine?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** JobStatistics2 ddlTargetDataset. */ + public ddlTargetDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobStatistics2 mlStatistics. */ + public mlStatistics?: (google.cloud.bigquery.v2.IMlStatistics|null); + + /** JobStatistics2 exportDataStatistics. */ + public exportDataStatistics?: (google.cloud.bigquery.v2.IExportDataStatistics|null); + + /** JobStatistics2 externalServiceCosts. */ + public externalServiceCosts: google.cloud.bigquery.v2.IExternalServiceCost[]; + + /** JobStatistics2 biEngineStatistics. */ + public biEngineStatistics?: (google.cloud.bigquery.v2.IBiEngineStatistics|null); + + /** JobStatistics2 loadQueryStatistics. */ + public loadQueryStatistics?: (google.cloud.bigquery.v2.ILoadQueryStatistics|null); + + /** JobStatistics2 dclTargetTable. */ + public dclTargetTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 dclTargetView. */ + public dclTargetView?: (google.cloud.bigquery.v2.ITableReference|null); + + /** JobStatistics2 dclTargetDataset. */ + public dclTargetDataset?: (google.cloud.bigquery.v2.IDatasetReference|null); + + /** JobStatistics2 searchStatistics. */ + public searchStatistics?: (google.cloud.bigquery.v2.ISearchStatistics|null); + + /** JobStatistics2 vectorSearchStatistics. */ + public vectorSearchStatistics?: (google.cloud.bigquery.v2.IVectorSearchStatistics|null); + + /** JobStatistics2 performanceInsights. */ + public performanceInsights?: (google.cloud.bigquery.v2.IPerformanceInsights|null); + + /** JobStatistics2 queryInfo. */ + public queryInfo?: (google.cloud.bigquery.v2.IQueryInfo|null); + + /** JobStatistics2 sparkStatistics. */ + public sparkStatistics?: (google.cloud.bigquery.v2.ISparkStatistics|null); + + /** JobStatistics2 transferredBytes. */ + public transferredBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics2 materializedViewStatistics. */ + public materializedViewStatistics?: (google.cloud.bigquery.v2.IMaterializedViewStatistics|null); + + /** JobStatistics2 metadataCacheStatistics. */ + public metadataCacheStatistics?: (google.cloud.bigquery.v2.IMetadataCacheStatistics|null); + + /** JobStatistics2 incrementalResultStats. */ + public incrementalResultStats?: (google.cloud.bigquery.v2.IIncrementalResultStats|null); + + /** JobStatistics2 genAiStats. */ + public genAiStats?: (google.cloud.bigquery.v2.IGenAiStats|null); + + /** + * Creates a new JobStatistics2 instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatistics2 instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobStatistics2): google.cloud.bigquery.v2.JobStatistics2; + + /** + * Encodes the specified JobStatistics2 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics2.verify|verify} messages. + * @param message JobStatistics2 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobStatistics2, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatistics2 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics2.verify|verify} messages. + * @param message JobStatistics2 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobStatistics2, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatistics2 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatistics2 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatistics2; + + /** + * Decodes a JobStatistics2 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatistics2 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatistics2; + + /** + * Verifies a JobStatistics2 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatistics2 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatistics2 + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatistics2; + + /** + * Creates a plain object from a JobStatistics2 message. Also converts values to other types if specified. + * @param message JobStatistics2 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatistics2, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatistics2 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatistics2 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobStatistics3. */ + interface IJobStatistics3 { + + /** JobStatistics3 inputFiles */ + inputFiles?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 inputFileBytes */ + inputFileBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 outputRows */ + outputRows?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 outputBytes */ + outputBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 badRecords */ + badRecords?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 timeline */ + timeline?: (google.cloud.bigquery.v2.IQueryTimelineSample[]|null); + } + + /** Represents a JobStatistics3. */ + class JobStatistics3 implements IJobStatistics3 { + + /** + * Constructs a new JobStatistics3. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobStatistics3); + + /** JobStatistics3 inputFiles. */ + public inputFiles?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 inputFileBytes. */ + public inputFileBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 outputRows. */ + public outputRows?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 outputBytes. */ + public outputBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 badRecords. */ + public badRecords?: (google.protobuf.IInt64Value|null); + + /** JobStatistics3 timeline. */ + public timeline: google.cloud.bigquery.v2.IQueryTimelineSample[]; + + /** + * Creates a new JobStatistics3 instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatistics3 instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobStatistics3): google.cloud.bigquery.v2.JobStatistics3; + + /** + * Encodes the specified JobStatistics3 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics3.verify|verify} messages. + * @param message JobStatistics3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobStatistics3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatistics3 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics3.verify|verify} messages. + * @param message JobStatistics3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobStatistics3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatistics3 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatistics3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatistics3; + + /** + * Decodes a JobStatistics3 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatistics3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatistics3; + + /** + * Verifies a JobStatistics3 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatistics3 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatistics3 + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatistics3; + + /** + * Creates a plain object from a JobStatistics3 message. Also converts values to other types if specified. + * @param message JobStatistics3 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatistics3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatistics3 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatistics3 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobStatistics4. */ + interface IJobStatistics4 { + + /** JobStatistics4 destinationUriFileCounts */ + destinationUriFileCounts?: ((number|Long|string)[]|null); + + /** JobStatistics4 inputBytes */ + inputBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics4 timeline */ + timeline?: (google.cloud.bigquery.v2.IQueryTimelineSample[]|null); + } + + /** Represents a JobStatistics4. */ + class JobStatistics4 implements IJobStatistics4 { + + /** + * Constructs a new JobStatistics4. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobStatistics4); + + /** JobStatistics4 destinationUriFileCounts. */ + public destinationUriFileCounts: (number|Long|string)[]; + + /** JobStatistics4 inputBytes. */ + public inputBytes?: (google.protobuf.IInt64Value|null); + + /** JobStatistics4 timeline. */ + public timeline: google.cloud.bigquery.v2.IQueryTimelineSample[]; + + /** + * Creates a new JobStatistics4 instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatistics4 instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobStatistics4): google.cloud.bigquery.v2.JobStatistics4; + + /** + * Encodes the specified JobStatistics4 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics4.verify|verify} messages. + * @param message JobStatistics4 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobStatistics4, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatistics4 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics4.verify|verify} messages. + * @param message JobStatistics4 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobStatistics4, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatistics4 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatistics4 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatistics4; + + /** + * Decodes a JobStatistics4 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatistics4 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatistics4; + + /** + * Verifies a JobStatistics4 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatistics4 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatistics4 + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatistics4; + + /** + * Creates a plain object from a JobStatistics4 message. Also converts values to other types if specified. + * @param message JobStatistics4 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatistics4, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatistics4 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatistics4 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyJobStatistics. */ + interface ICopyJobStatistics { + + /** CopyJobStatistics copiedRows */ + copiedRows?: (google.protobuf.IInt64Value|null); + + /** CopyJobStatistics copiedLogicalBytes */ + copiedLogicalBytes?: (google.protobuf.IInt64Value|null); + } + + /** Represents a CopyJobStatistics. */ + class CopyJobStatistics implements ICopyJobStatistics { + + /** + * Constructs a new CopyJobStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ICopyJobStatistics); + + /** CopyJobStatistics copiedRows. */ + public copiedRows?: (google.protobuf.IInt64Value|null); + + /** CopyJobStatistics copiedLogicalBytes. */ + public copiedLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new CopyJobStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyJobStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.ICopyJobStatistics): google.cloud.bigquery.v2.CopyJobStatistics; + + /** + * Encodes the specified CopyJobStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.CopyJobStatistics.verify|verify} messages. + * @param message CopyJobStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ICopyJobStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CopyJobStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CopyJobStatistics.verify|verify} messages. + * @param message CopyJobStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ICopyJobStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CopyJobStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CopyJobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.CopyJobStatistics; + + /** + * Decodes a CopyJobStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CopyJobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.CopyJobStatistics; + + /** + * Verifies a CopyJobStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CopyJobStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyJobStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.CopyJobStatistics; + + /** + * Creates a plain object from a CopyJobStatistics message. Also converts values to other types if specified. + * @param message CopyJobStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.CopyJobStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyJobStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyJobStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MlStatistics. */ + interface IMlStatistics { + + /** MlStatistics maxIterations */ + maxIterations?: (number|Long|string|null); + + /** MlStatistics iterationResults */ + iterationResults?: (google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult[]|null); + + /** MlStatistics modelType */ + modelType?: (google.cloud.bigquery.v2.Model.ModelType|keyof typeof google.cloud.bigquery.v2.Model.ModelType|null); + + /** MlStatistics trainingType */ + trainingType?: (google.cloud.bigquery.v2.MlStatistics.TrainingType|keyof typeof google.cloud.bigquery.v2.MlStatistics.TrainingType|null); + + /** MlStatistics hparamTrials */ + hparamTrials?: (google.cloud.bigquery.v2.Model.IHparamTuningTrial[]|null); + } + + /** Represents a MlStatistics. */ + class MlStatistics implements IMlStatistics { + + /** + * Constructs a new MlStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMlStatistics); + + /** MlStatistics maxIterations. */ + public maxIterations: (number|Long|string); + + /** MlStatistics iterationResults. */ + public iterationResults: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult[]; + + /** MlStatistics modelType. */ + public modelType: (google.cloud.bigquery.v2.Model.ModelType|keyof typeof google.cloud.bigquery.v2.Model.ModelType); + + /** MlStatistics trainingType. */ + public trainingType: (google.cloud.bigquery.v2.MlStatistics.TrainingType|keyof typeof google.cloud.bigquery.v2.MlStatistics.TrainingType); + + /** MlStatistics hparamTrials. */ + public hparamTrials: google.cloud.bigquery.v2.Model.IHparamTuningTrial[]; + + /** + * Creates a new MlStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns MlStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMlStatistics): google.cloud.bigquery.v2.MlStatistics; + + /** + * Encodes the specified MlStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MlStatistics.verify|verify} messages. + * @param message MlStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMlStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MlStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MlStatistics.verify|verify} messages. + * @param message MlStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMlStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MlStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MlStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MlStatistics; + + /** + * Decodes a MlStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MlStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MlStatistics; + + /** + * Verifies a MlStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MlStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MlStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MlStatistics; + + /** + * Creates a plain object from a MlStatistics message. Also converts values to other types if specified. + * @param message MlStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MlStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MlStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MlStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MlStatistics { + + /** TrainingType enum. */ + enum TrainingType { + TRAINING_TYPE_UNSPECIFIED = 0, + SINGLE_TRAINING = 1, + HPARAM_TUNING = 2 + } + } + + /** Properties of a ScriptStatistics. */ + interface IScriptStatistics { + + /** ScriptStatistics evaluationKind */ + evaluationKind?: (google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind|keyof typeof google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind|null); + + /** ScriptStatistics stackFrames */ + stackFrames?: (google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame[]|null); + } + + /** Represents a ScriptStatistics. */ + class ScriptStatistics implements IScriptStatistics { + + /** + * Constructs a new ScriptStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IScriptStatistics); + + /** ScriptStatistics evaluationKind. */ + public evaluationKind: (google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind|keyof typeof google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind); + + /** ScriptStatistics stackFrames. */ + public stackFrames: google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame[]; + + /** + * Creates a new ScriptStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns ScriptStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IScriptStatistics): google.cloud.bigquery.v2.ScriptStatistics; + + /** + * Encodes the specified ScriptStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.verify|verify} messages. + * @param message ScriptStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IScriptStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScriptStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.verify|verify} messages. + * @param message ScriptStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IScriptStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScriptStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScriptStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ScriptStatistics; + + /** + * Decodes a ScriptStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScriptStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ScriptStatistics; + + /** + * Verifies a ScriptStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScriptStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScriptStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ScriptStatistics; + + /** + * Creates a plain object from a ScriptStatistics message. Also converts values to other types if specified. + * @param message ScriptStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ScriptStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScriptStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScriptStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScriptStatistics { + + /** EvaluationKind enum. */ + enum EvaluationKind { + EVALUATION_KIND_UNSPECIFIED = 0, + STATEMENT = 1, + EXPRESSION = 2 + } + + /** Properties of a ScriptStackFrame. */ + interface IScriptStackFrame { + + /** ScriptStackFrame startLine */ + startLine?: (number|null); + + /** ScriptStackFrame startColumn */ + startColumn?: (number|null); + + /** ScriptStackFrame endLine */ + endLine?: (number|null); + + /** ScriptStackFrame endColumn */ + endColumn?: (number|null); + + /** ScriptStackFrame procedureId */ + procedureId?: (string|null); + + /** ScriptStackFrame text */ + text?: (string|null); + } + + /** Represents a ScriptStackFrame. */ + class ScriptStackFrame implements IScriptStackFrame { + + /** + * Constructs a new ScriptStackFrame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame); + + /** ScriptStackFrame startLine. */ + public startLine: number; + + /** ScriptStackFrame startColumn. */ + public startColumn: number; + + /** ScriptStackFrame endLine. */ + public endLine: number; + + /** ScriptStackFrame endColumn. */ + public endColumn: number; + + /** ScriptStackFrame procedureId. */ + public procedureId: string; + + /** ScriptStackFrame text. */ + public text: string; + + /** + * Creates a new ScriptStackFrame instance using the specified properties. + * @param [properties] Properties to set + * @returns ScriptStackFrame instance + */ + public static create(properties?: google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame): google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame; + + /** + * Encodes the specified ScriptStackFrame message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.verify|verify} messages. + * @param message ScriptStackFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScriptStackFrame message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.verify|verify} messages. + * @param message ScriptStackFrame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScriptStackFrame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScriptStackFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame; + + /** + * Decodes a ScriptStackFrame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScriptStackFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame; + + /** + * Verifies a ScriptStackFrame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScriptStackFrame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScriptStackFrame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame; + + /** + * Creates a plain object from a ScriptStackFrame message. Also converts values to other types if specified. + * @param message ScriptStackFrame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScriptStackFrame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScriptStackFrame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RowLevelSecurityStatistics. */ + interface IRowLevelSecurityStatistics { + + /** RowLevelSecurityStatistics rowLevelSecurityApplied */ + rowLevelSecurityApplied?: (boolean|null); + } + + /** Represents a RowLevelSecurityStatistics. */ + class RowLevelSecurityStatistics implements IRowLevelSecurityStatistics { + + /** + * Constructs a new RowLevelSecurityStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRowLevelSecurityStatistics); + + /** RowLevelSecurityStatistics rowLevelSecurityApplied. */ + public rowLevelSecurityApplied: boolean; + + /** + * Creates a new RowLevelSecurityStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns RowLevelSecurityStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRowLevelSecurityStatistics): google.cloud.bigquery.v2.RowLevelSecurityStatistics; + + /** + * Encodes the specified RowLevelSecurityStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.RowLevelSecurityStatistics.verify|verify} messages. + * @param message RowLevelSecurityStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRowLevelSecurityStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowLevelSecurityStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowLevelSecurityStatistics.verify|verify} messages. + * @param message RowLevelSecurityStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRowLevelSecurityStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowLevelSecurityStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowLevelSecurityStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RowLevelSecurityStatistics; + + /** + * Decodes a RowLevelSecurityStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowLevelSecurityStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RowLevelSecurityStatistics; + + /** + * Verifies a RowLevelSecurityStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowLevelSecurityStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowLevelSecurityStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RowLevelSecurityStatistics; + + /** + * Creates a plain object from a RowLevelSecurityStatistics message. Also converts values to other types if specified. + * @param message RowLevelSecurityStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RowLevelSecurityStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowLevelSecurityStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowLevelSecurityStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataMaskingStatistics. */ + interface IDataMaskingStatistics { + + /** DataMaskingStatistics dataMaskingApplied */ + dataMaskingApplied?: (boolean|null); + } + + /** Represents a DataMaskingStatistics. */ + class DataMaskingStatistics implements IDataMaskingStatistics { + + /** + * Constructs a new DataMaskingStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDataMaskingStatistics); + + /** DataMaskingStatistics dataMaskingApplied. */ + public dataMaskingApplied: boolean; + + /** + * Creates a new DataMaskingStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns DataMaskingStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDataMaskingStatistics): google.cloud.bigquery.v2.DataMaskingStatistics; + + /** + * Encodes the specified DataMaskingStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.DataMaskingStatistics.verify|verify} messages. + * @param message DataMaskingStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDataMaskingStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataMaskingStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataMaskingStatistics.verify|verify} messages. + * @param message DataMaskingStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDataMaskingStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataMaskingStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataMaskingStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DataMaskingStatistics; + + /** + * Decodes a DataMaskingStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataMaskingStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DataMaskingStatistics; + + /** + * Verifies a DataMaskingStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataMaskingStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataMaskingStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DataMaskingStatistics; + + /** + * Creates a plain object from a DataMaskingStatistics message. Also converts values to other types if specified. + * @param message DataMaskingStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DataMaskingStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataMaskingStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataMaskingStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobStatistics. */ + interface IJobStatistics { + + /** JobStatistics creationTime */ + creationTime?: (number|Long|string|null); + + /** JobStatistics startTime */ + startTime?: (number|Long|string|null); + + /** JobStatistics endTime */ + endTime?: (number|Long|string|null); + + /** JobStatistics totalBytesProcessed */ + totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics completionRatio */ + completionRatio?: (google.protobuf.IDoubleValue|null); + + /** JobStatistics quotaDeferments */ + quotaDeferments?: (string[]|null); + + /** JobStatistics query */ + query?: (google.cloud.bigquery.v2.IJobStatistics2|null); + + /** JobStatistics load */ + load?: (google.cloud.bigquery.v2.IJobStatistics3|null); + + /** JobStatistics extract */ + extract?: (google.cloud.bigquery.v2.IJobStatistics4|null); + + /** JobStatistics copy */ + copy?: (google.cloud.bigquery.v2.ICopyJobStatistics|null); + + /** JobStatistics totalSlotMs */ + totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** JobStatistics reservationId */ + reservationId?: (string|null); + + /** JobStatistics numChildJobs */ + numChildJobs?: (number|Long|string|null); + + /** JobStatistics parentJobId */ + parentJobId?: (string|null); + + /** JobStatistics scriptStatistics */ + scriptStatistics?: (google.cloud.bigquery.v2.IScriptStatistics|null); + + /** JobStatistics rowLevelSecurityStatistics */ + rowLevelSecurityStatistics?: (google.cloud.bigquery.v2.IRowLevelSecurityStatistics|null); + + /** JobStatistics dataMaskingStatistics */ + dataMaskingStatistics?: (google.cloud.bigquery.v2.IDataMaskingStatistics|null); + + /** JobStatistics transactionInfo */ + transactionInfo?: (google.cloud.bigquery.v2.JobStatistics.ITransactionInfo|null); + + /** JobStatistics sessionInfo */ + sessionInfo?: (google.cloud.bigquery.v2.ISessionInfo|null); + + /** JobStatistics finalExecutionDurationMs */ + finalExecutionDurationMs?: (number|Long|string|null); + + /** JobStatistics edition */ + edition?: (google.cloud.bigquery.v2.ReservationEdition|keyof typeof google.cloud.bigquery.v2.ReservationEdition|null); + + /** JobStatistics reservationGroupPath */ + reservationGroupPath?: (string[]|null); + } + + /** Represents a JobStatistics. */ + class JobStatistics implements IJobStatistics { + + /** + * Constructs a new JobStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobStatistics); + + /** JobStatistics creationTime. */ + public creationTime: (number|Long|string); + + /** JobStatistics startTime. */ + public startTime: (number|Long|string); + + /** JobStatistics endTime. */ + public endTime: (number|Long|string); + + /** JobStatistics totalBytesProcessed. */ + public totalBytesProcessed?: (google.protobuf.IInt64Value|null); + + /** JobStatistics completionRatio. */ + public completionRatio?: (google.protobuf.IDoubleValue|null); + + /** JobStatistics quotaDeferments. */ + public quotaDeferments: string[]; + + /** JobStatistics query. */ + public query?: (google.cloud.bigquery.v2.IJobStatistics2|null); + + /** JobStatistics load. */ + public load?: (google.cloud.bigquery.v2.IJobStatistics3|null); + + /** JobStatistics extract. */ + public extract?: (google.cloud.bigquery.v2.IJobStatistics4|null); + + /** JobStatistics copy. */ + public copy?: (google.cloud.bigquery.v2.ICopyJobStatistics|null); + + /** JobStatistics totalSlotMs. */ + public totalSlotMs?: (google.protobuf.IInt64Value|null); + + /** JobStatistics reservationId. */ + public reservationId: string; + + /** JobStatistics numChildJobs. */ + public numChildJobs: (number|Long|string); + + /** JobStatistics parentJobId. */ + public parentJobId: string; + + /** JobStatistics scriptStatistics. */ + public scriptStatistics?: (google.cloud.bigquery.v2.IScriptStatistics|null); + + /** JobStatistics rowLevelSecurityStatistics. */ + public rowLevelSecurityStatistics?: (google.cloud.bigquery.v2.IRowLevelSecurityStatistics|null); + + /** JobStatistics dataMaskingStatistics. */ + public dataMaskingStatistics?: (google.cloud.bigquery.v2.IDataMaskingStatistics|null); + + /** JobStatistics transactionInfo. */ + public transactionInfo?: (google.cloud.bigquery.v2.JobStatistics.ITransactionInfo|null); + + /** JobStatistics sessionInfo. */ + public sessionInfo?: (google.cloud.bigquery.v2.ISessionInfo|null); + + /** JobStatistics finalExecutionDurationMs. */ + public finalExecutionDurationMs: (number|Long|string); + + /** JobStatistics edition. */ + public edition: (google.cloud.bigquery.v2.ReservationEdition|keyof typeof google.cloud.bigquery.v2.ReservationEdition); + + /** JobStatistics reservationGroupPath. */ + public reservationGroupPath: string[]; + + /** + * Creates a new JobStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobStatistics): google.cloud.bigquery.v2.JobStatistics; + + /** + * Encodes the specified JobStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.verify|verify} messages. + * @param message JobStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.verify|verify} messages. + * @param message JobStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatistics; + + /** + * Decodes a JobStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatistics; + + /** + * Verifies a JobStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatistics; + + /** + * Creates a plain object from a JobStatistics message. Also converts values to other types if specified. + * @param message JobStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatistics { + + /** Properties of a TransactionInfo. */ + interface ITransactionInfo { + + /** TransactionInfo transactionId */ + transactionId?: (string|null); + } + + /** Represents a TransactionInfo. */ + class TransactionInfo implements ITransactionInfo { + + /** + * Constructs a new TransactionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.JobStatistics.ITransactionInfo); + + /** TransactionInfo transactionId. */ + public transactionId: string; + + /** + * Creates a new TransactionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.JobStatistics.ITransactionInfo): google.cloud.bigquery.v2.JobStatistics.TransactionInfo; + + /** + * Encodes the specified TransactionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.TransactionInfo.verify|verify} messages. + * @param message TransactionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.JobStatistics.ITransactionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransactionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.TransactionInfo.verify|verify} messages. + * @param message TransactionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.JobStatistics.ITransactionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatistics.TransactionInfo; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatistics.TransactionInfo; + + /** + * Verifies a TransactionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransactionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransactionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatistics.TransactionInfo; + + /** + * Creates a plain object from a TransactionInfo message. Also converts values to other types if specified. + * @param message TransactionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatistics.TransactionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransactionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransactionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DmlStats. */ + interface IDmlStats { + + /** DmlStats insertedRowCount */ + insertedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats deletedRowCount */ + deletedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats updatedRowCount */ + updatedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats dmlMode */ + dmlMode?: (google.cloud.bigquery.v2.DmlStats.DmlMode|keyof typeof google.cloud.bigquery.v2.DmlStats.DmlMode|null); + + /** DmlStats fineGrainedDmlUnusedReason */ + fineGrainedDmlUnusedReason?: (google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason|keyof typeof google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason|null); + } + + /** Represents a DmlStats. */ + class DmlStats implements IDmlStats { + + /** + * Constructs a new DmlStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDmlStats); + + /** DmlStats insertedRowCount. */ + public insertedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats deletedRowCount. */ + public deletedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats updatedRowCount. */ + public updatedRowCount?: (google.protobuf.IInt64Value|null); + + /** DmlStats dmlMode. */ + public dmlMode: (google.cloud.bigquery.v2.DmlStats.DmlMode|keyof typeof google.cloud.bigquery.v2.DmlStats.DmlMode); + + /** DmlStats fineGrainedDmlUnusedReason. */ + public fineGrainedDmlUnusedReason: (google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason|keyof typeof google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason); + + /** + * Creates a new DmlStats instance using the specified properties. + * @param [properties] Properties to set + * @returns DmlStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDmlStats): google.cloud.bigquery.v2.DmlStats; + + /** + * Encodes the specified DmlStats message. Does not implicitly {@link google.cloud.bigquery.v2.DmlStats.verify|verify} messages. + * @param message DmlStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDmlStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DmlStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DmlStats.verify|verify} messages. + * @param message DmlStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDmlStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DmlStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DmlStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DmlStats; + + /** + * Decodes a DmlStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DmlStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DmlStats; + + /** + * Verifies a DmlStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DmlStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DmlStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DmlStats; + + /** + * Creates a plain object from a DmlStats message. Also converts values to other types if specified. + * @param message DmlStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DmlStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DmlStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DmlStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DmlStats { + + /** DmlMode enum. */ + enum DmlMode { + DML_MODE_UNSPECIFIED = 0, + COARSE_GRAINED_DML = 1, + FINE_GRAINED_DML = 2 + } + + /** FineGrainedDmlUnusedReason enum. */ + enum FineGrainedDmlUnusedReason { + FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED = 0, + MAX_PARTITION_SIZE_EXCEEDED = 1, + TABLE_NOT_ENROLLED = 2, + DML_IN_MULTI_STATEMENT_TRANSACTION = 3 + } + } + + /** Properties of a PerformanceInsights. */ + interface IPerformanceInsights { + + /** PerformanceInsights avgPreviousExecutionMs */ + avgPreviousExecutionMs?: (number|Long|string|null); + + /** PerformanceInsights stagePerformanceStandaloneInsights */ + stagePerformanceStandaloneInsights?: (google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight[]|null); + + /** PerformanceInsights stagePerformanceChangeInsights */ + stagePerformanceChangeInsights?: (google.cloud.bigquery.v2.IStagePerformanceChangeInsight[]|null); + + /** PerformanceInsights tableChangeInsights */ + tableChangeInsights?: (google.cloud.bigquery.v2.ITableChangeInsight[]|null); + } + + /** Represents a PerformanceInsights. */ + class PerformanceInsights implements IPerformanceInsights { + + /** + * Constructs a new PerformanceInsights. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPerformanceInsights); + + /** PerformanceInsights avgPreviousExecutionMs. */ + public avgPreviousExecutionMs: (number|Long|string); + + /** PerformanceInsights stagePerformanceStandaloneInsights. */ + public stagePerformanceStandaloneInsights: google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight[]; + + /** PerformanceInsights stagePerformanceChangeInsights. */ + public stagePerformanceChangeInsights: google.cloud.bigquery.v2.IStagePerformanceChangeInsight[]; + + /** PerformanceInsights tableChangeInsights. */ + public tableChangeInsights: google.cloud.bigquery.v2.ITableChangeInsight[]; + + /** + * Creates a new PerformanceInsights instance using the specified properties. + * @param [properties] Properties to set + * @returns PerformanceInsights instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPerformanceInsights): google.cloud.bigquery.v2.PerformanceInsights; + + /** + * Encodes the specified PerformanceInsights message. Does not implicitly {@link google.cloud.bigquery.v2.PerformanceInsights.verify|verify} messages. + * @param message PerformanceInsights message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPerformanceInsights, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PerformanceInsights message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PerformanceInsights.verify|verify} messages. + * @param message PerformanceInsights message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPerformanceInsights, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PerformanceInsights message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PerformanceInsights + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PerformanceInsights; + + /** + * Decodes a PerformanceInsights message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PerformanceInsights + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PerformanceInsights; + + /** + * Verifies a PerformanceInsights message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PerformanceInsights message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PerformanceInsights + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PerformanceInsights; + + /** + * Creates a plain object from a PerformanceInsights message. Also converts values to other types if specified. + * @param message PerformanceInsights + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PerformanceInsights, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PerformanceInsights to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PerformanceInsights + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StagePerformanceChangeInsight. */ + interface IStagePerformanceChangeInsight { + + /** StagePerformanceChangeInsight stageId */ + stageId?: (number|Long|string|null); + + /** StagePerformanceChangeInsight inputDataChange */ + inputDataChange?: (google.cloud.bigquery.v2.IInputDataChange|null); + } + + /** Represents a StagePerformanceChangeInsight. */ + class StagePerformanceChangeInsight implements IStagePerformanceChangeInsight { + + /** + * Constructs a new StagePerformanceChangeInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStagePerformanceChangeInsight); + + /** StagePerformanceChangeInsight stageId. */ + public stageId: (number|Long|string); + + /** StagePerformanceChangeInsight inputDataChange. */ + public inputDataChange?: (google.cloud.bigquery.v2.IInputDataChange|null); + + /** + * Creates a new StagePerformanceChangeInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns StagePerformanceChangeInsight instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStagePerformanceChangeInsight): google.cloud.bigquery.v2.StagePerformanceChangeInsight; + + /** + * Encodes the specified StagePerformanceChangeInsight message. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceChangeInsight.verify|verify} messages. + * @param message StagePerformanceChangeInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStagePerformanceChangeInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StagePerformanceChangeInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceChangeInsight.verify|verify} messages. + * @param message StagePerformanceChangeInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStagePerformanceChangeInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StagePerformanceChangeInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StagePerformanceChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StagePerformanceChangeInsight; + + /** + * Decodes a StagePerformanceChangeInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StagePerformanceChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StagePerformanceChangeInsight; + + /** + * Verifies a StagePerformanceChangeInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StagePerformanceChangeInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StagePerformanceChangeInsight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StagePerformanceChangeInsight; + + /** + * Creates a plain object from a StagePerformanceChangeInsight message. Also converts values to other types if specified. + * @param message StagePerformanceChangeInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StagePerformanceChangeInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StagePerformanceChangeInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StagePerformanceChangeInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputDataChange. */ + interface IInputDataChange { + + /** InputDataChange recordsReadDiffPercentage */ + recordsReadDiffPercentage?: (number|null); + } + + /** Represents an InputDataChange. */ + class InputDataChange implements IInputDataChange { + + /** + * Constructs a new InputDataChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IInputDataChange); + + /** InputDataChange recordsReadDiffPercentage. */ + public recordsReadDiffPercentage: number; + + /** + * Creates a new InputDataChange instance using the specified properties. + * @param [properties] Properties to set + * @returns InputDataChange instance + */ + public static create(properties?: google.cloud.bigquery.v2.IInputDataChange): google.cloud.bigquery.v2.InputDataChange; + + /** + * Encodes the specified InputDataChange message. Does not implicitly {@link google.cloud.bigquery.v2.InputDataChange.verify|verify} messages. + * @param message InputDataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IInputDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputDataChange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InputDataChange.verify|verify} messages. + * @param message InputDataChange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IInputDataChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputDataChange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputDataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.InputDataChange; + + /** + * Decodes an InputDataChange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputDataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.InputDataChange; + + /** + * Verifies an InputDataChange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputDataChange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputDataChange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.InputDataChange; + + /** + * Creates a plain object from an InputDataChange message. Also converts values to other types if specified. + * @param message InputDataChange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.InputDataChange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputDataChange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputDataChange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StagePerformanceStandaloneInsight. */ + interface IStagePerformanceStandaloneInsight { + + /** StagePerformanceStandaloneInsight stageId */ + stageId?: (number|Long|string|null); + + /** StagePerformanceStandaloneInsight slotContention */ + slotContention?: (boolean|null); + + /** StagePerformanceStandaloneInsight insufficientShuffleQuota */ + insufficientShuffleQuota?: (boolean|null); + + /** StagePerformanceStandaloneInsight biEngineReasons */ + biEngineReasons?: (google.cloud.bigquery.v2.IBiEngineReason[]|null); + + /** StagePerformanceStandaloneInsight highCardinalityJoins */ + highCardinalityJoins?: (google.cloud.bigquery.v2.IHighCardinalityJoin[]|null); + + /** StagePerformanceStandaloneInsight partitionSkew */ + partitionSkew?: (google.cloud.bigquery.v2.IPartitionSkew|null); + } + + /** Represents a StagePerformanceStandaloneInsight. */ + class StagePerformanceStandaloneInsight implements IStagePerformanceStandaloneInsight { + + /** + * Constructs a new StagePerformanceStandaloneInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight); + + /** StagePerformanceStandaloneInsight stageId. */ + public stageId: (number|Long|string); + + /** StagePerformanceStandaloneInsight slotContention. */ + public slotContention?: (boolean|null); + + /** StagePerformanceStandaloneInsight insufficientShuffleQuota. */ + public insufficientShuffleQuota?: (boolean|null); + + /** StagePerformanceStandaloneInsight biEngineReasons. */ + public biEngineReasons: google.cloud.bigquery.v2.IBiEngineReason[]; + + /** StagePerformanceStandaloneInsight highCardinalityJoins. */ + public highCardinalityJoins: google.cloud.bigquery.v2.IHighCardinalityJoin[]; + + /** StagePerformanceStandaloneInsight partitionSkew. */ + public partitionSkew?: (google.cloud.bigquery.v2.IPartitionSkew|null); + + /** + * Creates a new StagePerformanceStandaloneInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns StagePerformanceStandaloneInsight instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight): google.cloud.bigquery.v2.StagePerformanceStandaloneInsight; + + /** + * Encodes the specified StagePerformanceStandaloneInsight message. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.verify|verify} messages. + * @param message StagePerformanceStandaloneInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StagePerformanceStandaloneInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.verify|verify} messages. + * @param message StagePerformanceStandaloneInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StagePerformanceStandaloneInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StagePerformanceStandaloneInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.StagePerformanceStandaloneInsight; + + /** + * Decodes a StagePerformanceStandaloneInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StagePerformanceStandaloneInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.StagePerformanceStandaloneInsight; + + /** + * Verifies a StagePerformanceStandaloneInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StagePerformanceStandaloneInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StagePerformanceStandaloneInsight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.StagePerformanceStandaloneInsight; + + /** + * Creates a plain object from a StagePerformanceStandaloneInsight message. Also converts values to other types if specified. + * @param message StagePerformanceStandaloneInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.StagePerformanceStandaloneInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StagePerformanceStandaloneInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StagePerformanceStandaloneInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HighCardinalityJoin. */ + interface IHighCardinalityJoin { + + /** HighCardinalityJoin leftRows */ + leftRows?: (number|Long|string|null); + + /** HighCardinalityJoin rightRows */ + rightRows?: (number|Long|string|null); + + /** HighCardinalityJoin outputRows */ + outputRows?: (number|Long|string|null); + + /** HighCardinalityJoin stepIndex */ + stepIndex?: (number|null); + } + + /** Represents a HighCardinalityJoin. */ + class HighCardinalityJoin implements IHighCardinalityJoin { + + /** + * Constructs a new HighCardinalityJoin. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IHighCardinalityJoin); + + /** HighCardinalityJoin leftRows. */ + public leftRows: (number|Long|string); + + /** HighCardinalityJoin rightRows. */ + public rightRows: (number|Long|string); + + /** HighCardinalityJoin outputRows. */ + public outputRows: (number|Long|string); + + /** HighCardinalityJoin stepIndex. */ + public stepIndex: number; + + /** + * Creates a new HighCardinalityJoin instance using the specified properties. + * @param [properties] Properties to set + * @returns HighCardinalityJoin instance + */ + public static create(properties?: google.cloud.bigquery.v2.IHighCardinalityJoin): google.cloud.bigquery.v2.HighCardinalityJoin; + + /** + * Encodes the specified HighCardinalityJoin message. Does not implicitly {@link google.cloud.bigquery.v2.HighCardinalityJoin.verify|verify} messages. + * @param message HighCardinalityJoin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IHighCardinalityJoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HighCardinalityJoin message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.HighCardinalityJoin.verify|verify} messages. + * @param message HighCardinalityJoin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IHighCardinalityJoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HighCardinalityJoin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HighCardinalityJoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.HighCardinalityJoin; + + /** + * Decodes a HighCardinalityJoin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HighCardinalityJoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.HighCardinalityJoin; + + /** + * Verifies a HighCardinalityJoin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HighCardinalityJoin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HighCardinalityJoin + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.HighCardinalityJoin; + + /** + * Creates a plain object from a HighCardinalityJoin message. Also converts values to other types if specified. + * @param message HighCardinalityJoin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.HighCardinalityJoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HighCardinalityJoin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HighCardinalityJoin + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionSkew. */ + interface IPartitionSkew { + + /** PartitionSkew skewSources */ + skewSources?: (google.cloud.bigquery.v2.PartitionSkew.ISkewSource[]|null); + } + + /** Represents a PartitionSkew. */ + class PartitionSkew implements IPartitionSkew { + + /** + * Constructs a new PartitionSkew. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPartitionSkew); + + /** PartitionSkew skewSources. */ + public skewSources: google.cloud.bigquery.v2.PartitionSkew.ISkewSource[]; + + /** + * Creates a new PartitionSkew instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionSkew instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPartitionSkew): google.cloud.bigquery.v2.PartitionSkew; + + /** + * Encodes the specified PartitionSkew message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.verify|verify} messages. + * @param message PartitionSkew message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPartitionSkew, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionSkew message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.verify|verify} messages. + * @param message PartitionSkew message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPartitionSkew, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionSkew message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionSkew + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PartitionSkew; + + /** + * Decodes a PartitionSkew message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionSkew + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PartitionSkew; + + /** + * Verifies a PartitionSkew message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionSkew message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionSkew + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PartitionSkew; + + /** + * Creates a plain object from a PartitionSkew message. Also converts values to other types if specified. + * @param message PartitionSkew + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PartitionSkew, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionSkew to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionSkew + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartitionSkew { + + /** Properties of a SkewSource. */ + interface ISkewSource { + + /** SkewSource stageId */ + stageId?: (number|Long|string|null); + } + + /** Represents a SkewSource. */ + class SkewSource implements ISkewSource { + + /** + * Constructs a new SkewSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.PartitionSkew.ISkewSource); + + /** SkewSource stageId. */ + public stageId: (number|Long|string); + + /** + * Creates a new SkewSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SkewSource instance + */ + public static create(properties?: google.cloud.bigquery.v2.PartitionSkew.ISkewSource): google.cloud.bigquery.v2.PartitionSkew.SkewSource; + + /** + * Encodes the specified SkewSource message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.SkewSource.verify|verify} messages. + * @param message SkewSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.PartitionSkew.ISkewSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkewSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.SkewSource.verify|verify} messages. + * @param message SkewSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.PartitionSkew.ISkewSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkewSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkewSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PartitionSkew.SkewSource; + + /** + * Decodes a SkewSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkewSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PartitionSkew.SkewSource; + + /** + * Verifies a SkewSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkewSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkewSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PartitionSkew.SkewSource; + + /** + * Creates a plain object from a SkewSource message. Also converts values to other types if specified. + * @param message SkewSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PartitionSkew.SkewSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkewSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkewSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TableChangeInsight. */ + interface ITableChangeInsight { + + /** TableChangeInsight tableReference */ + tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableChangeInsight metadataCacheStalenessInsight */ + metadataCacheStalenessInsight?: (google.cloud.bigquery.v2.IMetadataCacheStalenessInsight|null); + + /** TableChangeInsight metadataCacheNotUsedButUsedPreviously */ + metadataCacheNotUsedButUsedPreviously?: (boolean|null); + } + + /** Represents a TableChangeInsight. */ + class TableChangeInsight implements ITableChangeInsight { + + /** + * Constructs a new TableChangeInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableChangeInsight); + + /** TableChangeInsight tableReference. */ + public tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableChangeInsight metadataCacheStalenessInsight. */ + public metadataCacheStalenessInsight?: (google.cloud.bigquery.v2.IMetadataCacheStalenessInsight|null); + + /** TableChangeInsight metadataCacheNotUsedButUsedPreviously. */ + public metadataCacheNotUsedButUsedPreviously?: (boolean|null); + + /** + * Creates a new TableChangeInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns TableChangeInsight instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableChangeInsight): google.cloud.bigquery.v2.TableChangeInsight; + + /** + * Encodes the specified TableChangeInsight message. Does not implicitly {@link google.cloud.bigquery.v2.TableChangeInsight.verify|verify} messages. + * @param message TableChangeInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableChangeInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableChangeInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableChangeInsight.verify|verify} messages. + * @param message TableChangeInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableChangeInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableChangeInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableChangeInsight; + + /** + * Decodes a TableChangeInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableChangeInsight; + + /** + * Verifies a TableChangeInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableChangeInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableChangeInsight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableChangeInsight; + + /** + * Creates a plain object from a TableChangeInsight message. Also converts values to other types if specified. + * @param message TableChangeInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableChangeInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableChangeInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableChangeInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetadataCacheStalenessInsight. */ + interface IMetadataCacheStalenessInsight { + + /** MetadataCacheStalenessInsight avgPreviousStalenessMs */ + avgPreviousStalenessMs?: (google.protobuf.IDuration|null); + + /** MetadataCacheStalenessInsight stalenessPercentageIncrease */ + stalenessPercentageIncrease?: (number|null); + } + + /** Represents a MetadataCacheStalenessInsight. */ + class MetadataCacheStalenessInsight implements IMetadataCacheStalenessInsight { + + /** + * Constructs a new MetadataCacheStalenessInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMetadataCacheStalenessInsight); + + /** MetadataCacheStalenessInsight avgPreviousStalenessMs. */ + public avgPreviousStalenessMs?: (google.protobuf.IDuration|null); + + /** MetadataCacheStalenessInsight stalenessPercentageIncrease. */ + public stalenessPercentageIncrease: number; + + /** + * Creates a new MetadataCacheStalenessInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataCacheStalenessInsight instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMetadataCacheStalenessInsight): google.cloud.bigquery.v2.MetadataCacheStalenessInsight; + + /** + * Encodes the specified MetadataCacheStalenessInsight message. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStalenessInsight.verify|verify} messages. + * @param message MetadataCacheStalenessInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMetadataCacheStalenessInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataCacheStalenessInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStalenessInsight.verify|verify} messages. + * @param message MetadataCacheStalenessInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMetadataCacheStalenessInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataCacheStalenessInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataCacheStalenessInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MetadataCacheStalenessInsight; + + /** + * Decodes a MetadataCacheStalenessInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataCacheStalenessInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MetadataCacheStalenessInsight; + + /** + * Verifies a MetadataCacheStalenessInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataCacheStalenessInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataCacheStalenessInsight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MetadataCacheStalenessInsight; + + /** + * Creates a plain object from a MetadataCacheStalenessInsight message. Also converts values to other types if specified. + * @param message MetadataCacheStalenessInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MetadataCacheStalenessInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataCacheStalenessInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataCacheStalenessInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkStatistics. */ + interface ISparkStatistics { + + /** SparkStatistics sparkJobId */ + sparkJobId?: (string|null); + + /** SparkStatistics sparkJobLocation */ + sparkJobLocation?: (string|null); + + /** SparkStatistics endpoints */ + endpoints?: ({ [k: string]: string }|null); + + /** SparkStatistics loggingInfo */ + loggingInfo?: (google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo|null); + + /** SparkStatistics kmsKeyName */ + kmsKeyName?: (string|null); + + /** SparkStatistics gcsStagingBucket */ + gcsStagingBucket?: (string|null); + } + + /** Represents a SparkStatistics. */ + class SparkStatistics implements ISparkStatistics { + + /** + * Constructs a new SparkStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISparkStatistics); + + /** SparkStatistics sparkJobId. */ + public sparkJobId?: (string|null); + + /** SparkStatistics sparkJobLocation. */ + public sparkJobLocation?: (string|null); + + /** SparkStatistics endpoints. */ + public endpoints: { [k: string]: string }; + + /** SparkStatistics loggingInfo. */ + public loggingInfo?: (google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo|null); + + /** SparkStatistics kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** SparkStatistics gcsStagingBucket. */ + public gcsStagingBucket?: (string|null); + + /** + * Creates a new SparkStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISparkStatistics): google.cloud.bigquery.v2.SparkStatistics; + + /** + * Encodes the specified SparkStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.verify|verify} messages. + * @param message SparkStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISparkStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.verify|verify} messages. + * @param message SparkStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISparkStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SparkStatistics; + + /** + * Decodes a SparkStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SparkStatistics; + + /** + * Verifies a SparkStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SparkStatistics; + + /** + * Creates a plain object from a SparkStatistics message. Also converts values to other types if specified. + * @param message SparkStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SparkStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SparkStatistics { + + /** Properties of a LoggingInfo. */ + interface ILoggingInfo { + + /** LoggingInfo resourceType */ + resourceType?: (string|null); + + /** LoggingInfo projectId */ + projectId?: (string|null); + } + + /** Represents a LoggingInfo. */ + class LoggingInfo implements ILoggingInfo { + + /** + * Constructs a new LoggingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo); + + /** LoggingInfo resourceType. */ + public resourceType: string; + + /** LoggingInfo projectId. */ + public projectId: string; + + /** + * Creates a new LoggingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo): google.cloud.bigquery.v2.SparkStatistics.LoggingInfo; + + /** + * Encodes the specified LoggingInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.verify|verify} messages. + * @param message LoggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.verify|verify} messages. + * @param message LoggingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SparkStatistics.LoggingInfo; + + /** + * Decodes a LoggingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SparkStatistics.LoggingInfo; + + /** + * Verifies a LoggingInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SparkStatistics.LoggingInfo; + + /** + * Creates a plain object from a LoggingInfo message. Also converts values to other types if specified. + * @param message LoggingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SparkStatistics.LoggingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MaterializedViewStatistics. */ + interface IMaterializedViewStatistics { + + /** MaterializedViewStatistics materializedView */ + materializedView?: (google.cloud.bigquery.v2.IMaterializedView[]|null); + } + + /** Represents a MaterializedViewStatistics. */ + class MaterializedViewStatistics implements IMaterializedViewStatistics { + + /** + * Constructs a new MaterializedViewStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMaterializedViewStatistics); + + /** MaterializedViewStatistics materializedView. */ + public materializedView: google.cloud.bigquery.v2.IMaterializedView[]; + + /** + * Creates a new MaterializedViewStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedViewStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMaterializedViewStatistics): google.cloud.bigquery.v2.MaterializedViewStatistics; + + /** + * Encodes the specified MaterializedViewStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatistics.verify|verify} messages. + * @param message MaterializedViewStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMaterializedViewStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedViewStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatistics.verify|verify} messages. + * @param message MaterializedViewStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMaterializedViewStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedViewStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedViewStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MaterializedViewStatistics; + + /** + * Decodes a MaterializedViewStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedViewStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MaterializedViewStatistics; + + /** + * Verifies a MaterializedViewStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedViewStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedViewStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MaterializedViewStatistics; + + /** + * Creates a plain object from a MaterializedViewStatistics message. Also converts values to other types if specified. + * @param message MaterializedViewStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MaterializedViewStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedViewStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedViewStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializedView. */ + interface IMaterializedView { + + /** MaterializedView tableReference */ + tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** MaterializedView chosen */ + chosen?: (boolean|null); + + /** MaterializedView estimatedBytesSaved */ + estimatedBytesSaved?: (number|Long|string|null); + + /** MaterializedView rejectedReason */ + rejectedReason?: (google.cloud.bigquery.v2.MaterializedView.RejectedReason|keyof typeof google.cloud.bigquery.v2.MaterializedView.RejectedReason|null); + } + + /** Represents a MaterializedView. */ + class MaterializedView implements IMaterializedView { + + /** + * Constructs a new MaterializedView. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMaterializedView); + + /** MaterializedView tableReference. */ + public tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** MaterializedView chosen. */ + public chosen?: (boolean|null); + + /** MaterializedView estimatedBytesSaved. */ + public estimatedBytesSaved?: (number|Long|string|null); + + /** MaterializedView rejectedReason. */ + public rejectedReason?: (google.cloud.bigquery.v2.MaterializedView.RejectedReason|keyof typeof google.cloud.bigquery.v2.MaterializedView.RejectedReason|null); + + /** + * Creates a new MaterializedView instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedView instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMaterializedView): google.cloud.bigquery.v2.MaterializedView; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedView.verify|verify} messages. + * @param message MaterializedView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMaterializedView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MaterializedView; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MaterializedView; + + /** + * Verifies a MaterializedView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedView + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MaterializedView; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @param message MaterializedView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MaterializedView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MaterializedView { + + /** RejectedReason enum. */ + enum RejectedReason { + REJECTED_REASON_UNSPECIFIED = 0, + NO_DATA = 1, + COST = 2, + BASE_TABLE_TRUNCATED = 3, + BASE_TABLE_DATA_CHANGE = 4, + BASE_TABLE_PARTITION_EXPIRATION_CHANGE = 5, + BASE_TABLE_EXPIRED_PARTITION = 6, + BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE = 7, + TIME_ZONE = 8, + OUT_OF_TIME_TRAVEL_WINDOW = 9, + BASE_TABLE_FINE_GRAINED_SECURITY_POLICY = 10, + BASE_TABLE_TOO_STALE = 11 + } + } + + /** Properties of a PruningStats. */ + interface IPruningStats { + + /** PruningStats postCmetaPruningPartitionCount */ + postCmetaPruningPartitionCount?: (number|Long|string|null); + + /** PruningStats preCmetaPruningParallelInputCount */ + preCmetaPruningParallelInputCount?: (number|Long|string|null); + + /** PruningStats postCmetaPruningParallelInputCount */ + postCmetaPruningParallelInputCount?: (number|Long|string|null); + } + + /** Represents a PruningStats. */ + class PruningStats implements IPruningStats { + + /** + * Constructs a new PruningStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPruningStats); + + /** PruningStats postCmetaPruningPartitionCount. */ + public postCmetaPruningPartitionCount?: (number|Long|string|null); + + /** PruningStats preCmetaPruningParallelInputCount. */ + public preCmetaPruningParallelInputCount?: (number|Long|string|null); + + /** PruningStats postCmetaPruningParallelInputCount. */ + public postCmetaPruningParallelInputCount?: (number|Long|string|null); + + /** + * Creates a new PruningStats instance using the specified properties. + * @param [properties] Properties to set + * @returns PruningStats instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPruningStats): google.cloud.bigquery.v2.PruningStats; + + /** + * Encodes the specified PruningStats message. Does not implicitly {@link google.cloud.bigquery.v2.PruningStats.verify|verify} messages. + * @param message PruningStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPruningStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PruningStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PruningStats.verify|verify} messages. + * @param message PruningStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPruningStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PruningStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PruningStats; + + /** + * Decodes a PruningStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PruningStats; + + /** + * Verifies a PruningStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PruningStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PruningStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PruningStats; + + /** + * Creates a plain object from a PruningStats message. Also converts values to other types if specified. + * @param message PruningStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PruningStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PruningStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PruningStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableMetadataCacheUsage. */ + interface ITableMetadataCacheUsage { + + /** TableMetadataCacheUsage tableReference */ + tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableMetadataCacheUsage unusedReason */ + unusedReason?: (google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|keyof typeof google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|null); + + /** TableMetadataCacheUsage explanation */ + explanation?: (string|null); + + /** TableMetadataCacheUsage staleness */ + staleness?: (google.protobuf.IDuration|null); + + /** TableMetadataCacheUsage tableType */ + tableType?: (string|null); + + /** TableMetadataCacheUsage pruningStats */ + pruningStats?: (google.cloud.bigquery.v2.IPruningStats|null); + } + + /** Represents a TableMetadataCacheUsage. */ + class TableMetadataCacheUsage implements ITableMetadataCacheUsage { + + /** + * Constructs a new TableMetadataCacheUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableMetadataCacheUsage); + + /** TableMetadataCacheUsage tableReference. */ + public tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableMetadataCacheUsage unusedReason. */ + public unusedReason?: (google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|keyof typeof google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|null); + + /** TableMetadataCacheUsage explanation. */ + public explanation?: (string|null); + + /** TableMetadataCacheUsage staleness. */ + public staleness?: (google.protobuf.IDuration|null); + + /** TableMetadataCacheUsage tableType. */ + public tableType: string; + + /** TableMetadataCacheUsage pruningStats. */ + public pruningStats?: (google.cloud.bigquery.v2.IPruningStats|null); + + /** + * Creates a new TableMetadataCacheUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns TableMetadataCacheUsage instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableMetadataCacheUsage): google.cloud.bigquery.v2.TableMetadataCacheUsage; + + /** + * Encodes the specified TableMetadataCacheUsage message. Does not implicitly {@link google.cloud.bigquery.v2.TableMetadataCacheUsage.verify|verify} messages. + * @param message TableMetadataCacheUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableMetadataCacheUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableMetadataCacheUsage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableMetadataCacheUsage.verify|verify} messages. + * @param message TableMetadataCacheUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableMetadataCacheUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableMetadataCacheUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableMetadataCacheUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableMetadataCacheUsage; + + /** + * Decodes a TableMetadataCacheUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableMetadataCacheUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableMetadataCacheUsage; + + /** + * Verifies a TableMetadataCacheUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableMetadataCacheUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableMetadataCacheUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableMetadataCacheUsage; + + /** + * Creates a plain object from a TableMetadataCacheUsage message. Also converts values to other types if specified. + * @param message TableMetadataCacheUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableMetadataCacheUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableMetadataCacheUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableMetadataCacheUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TableMetadataCacheUsage { + + /** UnusedReason enum. */ + enum UnusedReason { + UNUSED_REASON_UNSPECIFIED = 0, + EXCEEDED_MAX_STALENESS = 1, + METADATA_CACHING_NOT_ENABLED = 3, + OTHER_REASON = 2 + } + } + + /** Properties of a MetadataCacheStatistics. */ + interface IMetadataCacheStatistics { + + /** MetadataCacheStatistics tableMetadataCacheUsage */ + tableMetadataCacheUsage?: (google.cloud.bigquery.v2.ITableMetadataCacheUsage[]|null); + } + + /** Represents a MetadataCacheStatistics. */ + class MetadataCacheStatistics implements IMetadataCacheStatistics { + + /** + * Constructs a new MetadataCacheStatistics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMetadataCacheStatistics); + + /** MetadataCacheStatistics tableMetadataCacheUsage. */ + public tableMetadataCacheUsage: google.cloud.bigquery.v2.ITableMetadataCacheUsage[]; + + /** + * Creates a new MetadataCacheStatistics instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataCacheStatistics instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMetadataCacheStatistics): google.cloud.bigquery.v2.MetadataCacheStatistics; + + /** + * Encodes the specified MetadataCacheStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStatistics.verify|verify} messages. + * @param message MetadataCacheStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMetadataCacheStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataCacheStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStatistics.verify|verify} messages. + * @param message MetadataCacheStatistics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMetadataCacheStatistics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataCacheStatistics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataCacheStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MetadataCacheStatistics; + + /** + * Decodes a MetadataCacheStatistics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataCacheStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MetadataCacheStatistics; + + /** + * Verifies a MetadataCacheStatistics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataCacheStatistics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataCacheStatistics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MetadataCacheStatistics; + + /** + * Creates a plain object from a MetadataCacheStatistics message. Also converts values to other types if specified. + * @param message MetadataCacheStatistics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MetadataCacheStatistics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataCacheStatistics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataCacheStatistics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ReservationEdition enum. */ + enum ReservationEdition { + RESERVATION_EDITION_UNSPECIFIED = 0, + STANDARD = 1, + ENTERPRISE = 2, + ENTERPRISE_PLUS = 3 + } + + /** Represents a ModelService */ + class ModelService extends $protobuf.rpc.Service { + + /** + * Constructs a new ModelService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ModelService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ModelService; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.cloud.bigquery.v2.IGetModelRequest, callback: google.cloud.bigquery.v2.ModelService.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.cloud.bigquery.v2.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.cloud.bigquery.v2.IListModelsRequest, callback: google.cloud.bigquery.v2.ModelService.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.cloud.bigquery.v2.IListModelsRequest): Promise; + + /** + * Calls PatchModel. + * @param request PatchModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public patchModel(request: google.cloud.bigquery.v2.IPatchModelRequest, callback: google.cloud.bigquery.v2.ModelService.PatchModelCallback): void; + + /** + * Calls PatchModel. + * @param request PatchModelRequest message or plain object + * @returns Promise + */ + public patchModel(request: google.cloud.bigquery.v2.IPatchModelRequest): Promise; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteModel(request: google.cloud.bigquery.v2.IDeleteModelRequest, callback: google.cloud.bigquery.v2.ModelService.DeleteModelCallback): void; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise + */ + public deleteModel(request: google.cloud.bigquery.v2.IDeleteModelRequest): Promise; + } + + namespace ModelService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Model) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|patchModel}. + * @param error Error, if any + * @param [response] Model + */ + type PatchModelCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Model) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|deleteModel}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteModelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a RemoteModelInfo. */ + interface IRemoteModelInfo { + + /** RemoteModelInfo endpoint */ + endpoint?: (string|null); + + /** RemoteModelInfo remoteServiceType */ + remoteServiceType?: (google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|keyof typeof google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|null); + + /** RemoteModelInfo connection */ + connection?: (string|null); + + /** RemoteModelInfo maxBatchingRows */ + maxBatchingRows?: (number|Long|string|null); + + /** RemoteModelInfo remoteModelVersion */ + remoteModelVersion?: (string|null); + + /** RemoteModelInfo speechRecognizer */ + speechRecognizer?: (string|null); + } + + /** Represents a RemoteModelInfo. */ + class RemoteModelInfo implements IRemoteModelInfo { + + /** + * Constructs a new RemoteModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRemoteModelInfo); + + /** RemoteModelInfo endpoint. */ + public endpoint?: (string|null); + + /** RemoteModelInfo remoteServiceType. */ + public remoteServiceType?: (google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|keyof typeof google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|null); + + /** RemoteModelInfo connection. */ + public connection: string; + + /** RemoteModelInfo maxBatchingRows. */ + public maxBatchingRows: (number|Long|string); + + /** RemoteModelInfo remoteModelVersion. */ + public remoteModelVersion: string; + + /** RemoteModelInfo speechRecognizer. */ + public speechRecognizer: string; + + /** RemoteModelInfo remoteService. */ + public remoteService?: ("endpoint"|"remoteServiceType"); + + /** + * Creates a new RemoteModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteModelInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRemoteModelInfo): google.cloud.bigquery.v2.RemoteModelInfo; + + /** + * Encodes the specified RemoteModelInfo message. Does not implicitly {@link google.cloud.bigquery.v2.RemoteModelInfo.verify|verify} messages. + * @param message RemoteModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRemoteModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteModelInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RemoteModelInfo.verify|verify} messages. + * @param message RemoteModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRemoteModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RemoteModelInfo; + + /** + * Decodes a RemoteModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RemoteModelInfo; + + /** + * Verifies a RemoteModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RemoteModelInfo; + + /** + * Creates a plain object from a RemoteModelInfo message. Also converts values to other types if specified. + * @param message RemoteModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RemoteModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RemoteModelInfo { + + /** RemoteServiceType enum. */ + enum RemoteServiceType { + REMOTE_SERVICE_TYPE_UNSPECIFIED = 0, + CLOUD_AI_TRANSLATE_V3 = 1, + CLOUD_AI_VISION_V1 = 2, + CLOUD_AI_NATURAL_LANGUAGE_V1 = 3, + CLOUD_AI_SPEECH_TO_TEXT_V2 = 7 + } + } + + /** Properties of a TransformColumn. */ + interface ITransformColumn { + + /** TransformColumn name */ + name?: (string|null); + + /** TransformColumn type */ + type?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** TransformColumn transformSql */ + transformSql?: (string|null); + } + + /** Represents a TransformColumn. */ + class TransformColumn implements ITransformColumn { + + /** + * Constructs a new TransformColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITransformColumn); + + /** TransformColumn name. */ + public name: string; + + /** TransformColumn type. */ + public type?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** TransformColumn transformSql. */ + public transformSql: string; + + /** + * Creates a new TransformColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformColumn instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITransformColumn): google.cloud.bigquery.v2.TransformColumn; + + /** + * Encodes the specified TransformColumn message. Does not implicitly {@link google.cloud.bigquery.v2.TransformColumn.verify|verify} messages. + * @param message TransformColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITransformColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TransformColumn.verify|verify} messages. + * @param message TransformColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITransformColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TransformColumn; + + /** + * Decodes a TransformColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TransformColumn; + + /** + * Verifies a TransformColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransformColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TransformColumn; + + /** + * Creates a plain object from a TransformColumn message. Also converts values to other types if specified. + * @param message TransformColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TransformColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransformColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model etag */ + etag?: (string|null); + + /** Model modelReference */ + modelReference?: (google.cloud.bigquery.v2.IModelReference|null); + + /** Model creationTime */ + creationTime?: (number|Long|string|null); + + /** Model lastModifiedTime */ + lastModifiedTime?: (number|Long|string|null); + + /** Model description */ + description?: (string|null); + + /** Model friendlyName */ + friendlyName?: (string|null); + + /** Model labels */ + labels?: ({ [k: string]: string }|null); + + /** Model expirationTime */ + expirationTime?: (number|Long|string|null); + + /** Model location */ + location?: (string|null); + + /** Model encryptionConfiguration */ + encryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Model modelType */ + modelType?: (google.cloud.bigquery.v2.Model.ModelType|keyof typeof google.cloud.bigquery.v2.Model.ModelType|null); + + /** Model trainingRuns */ + trainingRuns?: (google.cloud.bigquery.v2.Model.ITrainingRun[]|null); + + /** Model featureColumns */ + featureColumns?: (google.cloud.bigquery.v2.IStandardSqlField[]|null); + + /** Model labelColumns */ + labelColumns?: (google.cloud.bigquery.v2.IStandardSqlField[]|null); + + /** Model transformColumns */ + transformColumns?: (google.cloud.bigquery.v2.ITransformColumn[]|null); + + /** Model hparamSearchSpaces */ + hparamSearchSpaces?: (google.cloud.bigquery.v2.Model.IHparamSearchSpaces|null); + + /** Model defaultTrialId */ + defaultTrialId?: (number|Long|string|null); + + /** Model hparamTrials */ + hparamTrials?: (google.cloud.bigquery.v2.Model.IHparamTuningTrial[]|null); + + /** Model optimalTrialIds */ + optimalTrialIds?: ((number|Long|string)[]|null); + + /** Model remoteModelInfo */ + remoteModelInfo?: (google.cloud.bigquery.v2.IRemoteModelInfo|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IModel); + + /** Model etag. */ + public etag: string; + + /** Model modelReference. */ + public modelReference?: (google.cloud.bigquery.v2.IModelReference|null); + + /** Model creationTime. */ + public creationTime: (number|Long|string); + + /** Model lastModifiedTime. */ + public lastModifiedTime: (number|Long|string); + + /** Model description. */ + public description: string; + + /** Model friendlyName. */ + public friendlyName: string; + + /** Model labels. */ + public labels: { [k: string]: string }; + + /** Model expirationTime. */ + public expirationTime: (number|Long|string); + + /** Model location. */ + public location: string; + + /** Model encryptionConfiguration. */ + public encryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Model modelType. */ + public modelType: (google.cloud.bigquery.v2.Model.ModelType|keyof typeof google.cloud.bigquery.v2.Model.ModelType); + + /** Model trainingRuns. */ + public trainingRuns: google.cloud.bigquery.v2.Model.ITrainingRun[]; + + /** Model featureColumns. */ + public featureColumns: google.cloud.bigquery.v2.IStandardSqlField[]; + + /** Model labelColumns. */ + public labelColumns: google.cloud.bigquery.v2.IStandardSqlField[]; + + /** Model transformColumns. */ + public transformColumns: google.cloud.bigquery.v2.ITransformColumn[]; + + /** Model hparamSearchSpaces. */ + public hparamSearchSpaces?: (google.cloud.bigquery.v2.Model.IHparamSearchSpaces|null); + + /** Model defaultTrialId. */ + public defaultTrialId: (number|Long|string); + + /** Model hparamTrials. */ + public hparamTrials: google.cloud.bigquery.v2.Model.IHparamTuningTrial[]; + + /** Model optimalTrialIds. */ + public optimalTrialIds: (number|Long|string)[]; + + /** Model remoteModelInfo. */ + public remoteModelInfo?: (google.cloud.bigquery.v2.IRemoteModelInfo|null); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.bigquery.v2.IModel): google.cloud.bigquery.v2.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.bigquery.v2.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Model { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + LINEAR_REGRESSION = 1, + LOGISTIC_REGRESSION = 2, + KMEANS = 3, + MATRIX_FACTORIZATION = 4, + DNN_CLASSIFIER = 5, + TENSORFLOW = 6, + DNN_REGRESSOR = 7, + XGBOOST = 8, + BOOSTED_TREE_REGRESSOR = 9, + BOOSTED_TREE_CLASSIFIER = 10, + ARIMA = 11, + AUTOML_REGRESSOR = 12, + AUTOML_CLASSIFIER = 13, + PCA = 14, + DNN_LINEAR_COMBINED_CLASSIFIER = 16, + DNN_LINEAR_COMBINED_REGRESSOR = 17, + AUTOENCODER = 18, + ARIMA_PLUS = 19, + ARIMA_PLUS_XREG = 23, + RANDOM_FOREST_REGRESSOR = 24, + RANDOM_FOREST_CLASSIFIER = 25, + TENSORFLOW_LITE = 26, + ONNX = 28, + TRANSFORM_ONLY = 29, + CONTRIBUTION_ANALYSIS = 37 + } + + /** LossType enum. */ + enum LossType { + LOSS_TYPE_UNSPECIFIED = 0, + MEAN_SQUARED_LOSS = 1, + MEAN_LOG_LOSS = 2 + } + + /** DistanceType enum. */ + enum DistanceType { + DISTANCE_TYPE_UNSPECIFIED = 0, + EUCLIDEAN = 1, + COSINE = 2 + } + + /** DataSplitMethod enum. */ + enum DataSplitMethod { + DATA_SPLIT_METHOD_UNSPECIFIED = 0, + RANDOM = 1, + CUSTOM = 2, + SEQUENTIAL = 3, + NO_SPLIT = 4, + AUTO_SPLIT = 5 + } + + /** DataFrequency enum. */ + enum DataFrequency { + DATA_FREQUENCY_UNSPECIFIED = 0, + AUTO_FREQUENCY = 1, + YEARLY = 2, + QUARTERLY = 3, + MONTHLY = 4, + WEEKLY = 5, + DAILY = 6, + HOURLY = 7, + PER_MINUTE = 8 + } + + /** HolidayRegion enum. */ + enum HolidayRegion { + HOLIDAY_REGION_UNSPECIFIED = 0, + GLOBAL = 1, + NA = 2, + JAPAC = 3, + EMEA = 4, + LAC = 5, + AE = 6, + AR = 7, + AT = 8, + AU = 9, + BE = 10, + BR = 11, + CA = 12, + CH = 13, + CL = 14, + CN = 15, + CO = 16, + CS = 17, + CZ = 18, + DE = 19, + DK = 20, + DZ = 21, + EC = 22, + EE = 23, + EG = 24, + ES = 25, + FI = 26, + FR = 27, + GB = 28, + GR = 29, + HK = 30, + HU = 31, + ID = 32, + IE = 33, + IL = 34, + IN = 35, + IR = 36, + IT = 37, + JP = 38, + KR = 39, + LV = 40, + MA = 41, + MX = 42, + MY = 43, + NG = 44, + NL = 45, + NO = 46, + NZ = 47, + PE = 48, + PH = 49, + PK = 50, + PL = 51, + PT = 52, + RO = 53, + RS = 54, + RU = 55, + SA = 56, + SE = 57, + SG = 58, + SI = 59, + SK = 60, + TH = 61, + TR = 62, + TW = 63, + UA = 64, + US = 65, + VE = 66, + VN = 67, + ZA = 68 + } + + /** Properties of a SeasonalPeriod. */ + interface ISeasonalPeriod { + } + + /** Represents a SeasonalPeriod. */ + class SeasonalPeriod implements ISeasonalPeriod { + + /** + * Constructs a new SeasonalPeriod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ISeasonalPeriod); + + /** + * Creates a new SeasonalPeriod instance using the specified properties. + * @param [properties] Properties to set + * @returns SeasonalPeriod instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ISeasonalPeriod): google.cloud.bigquery.v2.Model.SeasonalPeriod; + + /** + * Encodes the specified SeasonalPeriod message. Does not implicitly {@link google.cloud.bigquery.v2.Model.SeasonalPeriod.verify|verify} messages. + * @param message SeasonalPeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ISeasonalPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeasonalPeriod message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.SeasonalPeriod.verify|verify} messages. + * @param message SeasonalPeriod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ISeasonalPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeasonalPeriod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeasonalPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.SeasonalPeriod; + + /** + * Decodes a SeasonalPeriod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeasonalPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.SeasonalPeriod; + + /** + * Verifies a SeasonalPeriod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SeasonalPeriod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeasonalPeriod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.SeasonalPeriod; + + /** + * Creates a plain object from a SeasonalPeriod message. Also converts values to other types if specified. + * @param message SeasonalPeriod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.SeasonalPeriod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeasonalPeriod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeasonalPeriod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SeasonalPeriod { + + /** SeasonalPeriodType enum. */ + enum SeasonalPeriodType { + SEASONAL_PERIOD_TYPE_UNSPECIFIED = 0, + NO_SEASONALITY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + QUARTERLY = 5, + YEARLY = 6, + HOURLY = 7 + } + } + + /** ColorSpace enum. */ + enum ColorSpace { + COLOR_SPACE_UNSPECIFIED = 0, + RGB = 1, + HSV = 2, + YIQ = 3, + YUV = 4, + GRAYSCALE = 5 + } + + /** Properties of a KmeansEnums. */ + interface IKmeansEnums { + } + + /** Represents a KmeansEnums. */ + class KmeansEnums implements IKmeansEnums { + + /** + * Constructs a new KmeansEnums. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IKmeansEnums); + + /** + * Creates a new KmeansEnums instance using the specified properties. + * @param [properties] Properties to set + * @returns KmeansEnums instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IKmeansEnums): google.cloud.bigquery.v2.Model.KmeansEnums; + + /** + * Encodes the specified KmeansEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.KmeansEnums.verify|verify} messages. + * @param message KmeansEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IKmeansEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KmeansEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.KmeansEnums.verify|verify} messages. + * @param message KmeansEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IKmeansEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KmeansEnums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KmeansEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.KmeansEnums; + + /** + * Decodes a KmeansEnums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KmeansEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.KmeansEnums; + + /** + * Verifies a KmeansEnums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KmeansEnums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KmeansEnums + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.KmeansEnums; + + /** + * Creates a plain object from a KmeansEnums message. Also converts values to other types if specified. + * @param message KmeansEnums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.KmeansEnums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KmeansEnums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KmeansEnums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KmeansEnums { + + /** KmeansInitializationMethod enum. */ + enum KmeansInitializationMethod { + KMEANS_INITIALIZATION_METHOD_UNSPECIFIED = 0, + RANDOM = 1, + CUSTOM = 2, + KMEANS_PLUS_PLUS = 3 + } + } + + /** Properties of a BoostedTreeOptionEnums. */ + interface IBoostedTreeOptionEnums { + } + + /** Represents a BoostedTreeOptionEnums. */ + class BoostedTreeOptionEnums implements IBoostedTreeOptionEnums { + + /** + * Constructs a new BoostedTreeOptionEnums. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums); + + /** + * Creates a new BoostedTreeOptionEnums instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostedTreeOptionEnums instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums): google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums; + + /** + * Encodes the specified BoostedTreeOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.verify|verify} messages. + * @param message BoostedTreeOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostedTreeOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.verify|verify} messages. + * @param message BoostedTreeOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostedTreeOptionEnums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostedTreeOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums; + + /** + * Decodes a BoostedTreeOptionEnums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostedTreeOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums; + + /** + * Verifies a BoostedTreeOptionEnums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostedTreeOptionEnums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostedTreeOptionEnums + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums; + + /** + * Creates a plain object from a BoostedTreeOptionEnums message. Also converts values to other types if specified. + * @param message BoostedTreeOptionEnums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostedTreeOptionEnums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostedTreeOptionEnums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoostedTreeOptionEnums { + + /** BoosterType enum. */ + enum BoosterType { + BOOSTER_TYPE_UNSPECIFIED = 0, + GBTREE = 1, + DART = 2 + } + + /** DartNormalizeType enum. */ + enum DartNormalizeType { + DART_NORMALIZE_TYPE_UNSPECIFIED = 0, + TREE = 1, + FOREST = 2 + } + + /** TreeMethod enum. */ + enum TreeMethod { + TREE_METHOD_UNSPECIFIED = 0, + AUTO = 1, + EXACT = 2, + APPROX = 3, + HIST = 4 + } + } + + /** Properties of a HparamTuningEnums. */ + interface IHparamTuningEnums { + } + + /** Represents a HparamTuningEnums. */ + class HparamTuningEnums implements IHparamTuningEnums { + + /** + * Constructs a new HparamTuningEnums. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IHparamTuningEnums); + + /** + * Creates a new HparamTuningEnums instance using the specified properties. + * @param [properties] Properties to set + * @returns HparamTuningEnums instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IHparamTuningEnums): google.cloud.bigquery.v2.Model.HparamTuningEnums; + + /** + * Encodes the specified HparamTuningEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningEnums.verify|verify} messages. + * @param message HparamTuningEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IHparamTuningEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HparamTuningEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningEnums.verify|verify} messages. + * @param message HparamTuningEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IHparamTuningEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HparamTuningEnums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HparamTuningEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.HparamTuningEnums; + + /** + * Decodes a HparamTuningEnums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HparamTuningEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.HparamTuningEnums; + + /** + * Verifies a HparamTuningEnums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HparamTuningEnums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HparamTuningEnums + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.HparamTuningEnums; + + /** + * Creates a plain object from a HparamTuningEnums message. Also converts values to other types if specified. + * @param message HparamTuningEnums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.HparamTuningEnums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HparamTuningEnums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HparamTuningEnums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HparamTuningEnums { + + /** HparamTuningObjective enum. */ + enum HparamTuningObjective { + HPARAM_TUNING_OBJECTIVE_UNSPECIFIED = 0, + MEAN_ABSOLUTE_ERROR = 1, + MEAN_SQUARED_ERROR = 2, + MEAN_SQUARED_LOG_ERROR = 3, + MEDIAN_ABSOLUTE_ERROR = 4, + R_SQUARED = 5, + EXPLAINED_VARIANCE = 6, + PRECISION = 7, + RECALL = 8, + ACCURACY = 9, + F1_SCORE = 10, + LOG_LOSS = 11, + ROC_AUC = 12, + DAVIES_BOULDIN_INDEX = 13, + MEAN_AVERAGE_PRECISION = 14, + NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = 15, + AVERAGE_RANK = 16 + } + } + + /** LearnRateStrategy enum. */ + enum LearnRateStrategy { + LEARN_RATE_STRATEGY_UNSPECIFIED = 0, + LINE_SEARCH = 1, + CONSTANT = 2 + } + + /** OptimizationStrategy enum. */ + enum OptimizationStrategy { + OPTIMIZATION_STRATEGY_UNSPECIFIED = 0, + BATCH_GRADIENT_DESCENT = 1, + NORMAL_EQUATION = 2 + } + + /** FeedbackType enum. */ + enum FeedbackType { + FEEDBACK_TYPE_UNSPECIFIED = 0, + IMPLICIT = 1, + EXPLICIT = 2 + } + + /** Properties of a RegressionMetrics. */ + interface IRegressionMetrics { + + /** RegressionMetrics meanAbsoluteError */ + meanAbsoluteError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics meanSquaredError */ + meanSquaredError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics meanSquaredLogError */ + meanSquaredLogError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics medianAbsoluteError */ + medianAbsoluteError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics rSquared */ + rSquared?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a RegressionMetrics. */ + class RegressionMetrics implements IRegressionMetrics { + + /** + * Constructs a new RegressionMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IRegressionMetrics); + + /** RegressionMetrics meanAbsoluteError. */ + public meanAbsoluteError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics meanSquaredError. */ + public meanSquaredError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics meanSquaredLogError. */ + public meanSquaredLogError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics medianAbsoluteError. */ + public medianAbsoluteError?: (google.protobuf.IDoubleValue|null); + + /** RegressionMetrics rSquared. */ + public rSquared?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new RegressionMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns RegressionMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IRegressionMetrics): google.cloud.bigquery.v2.Model.RegressionMetrics; + + /** + * Encodes the specified RegressionMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.RegressionMetrics.verify|verify} messages. + * @param message RegressionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IRegressionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegressionMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.RegressionMetrics.verify|verify} messages. + * @param message RegressionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IRegressionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegressionMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegressionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.RegressionMetrics; + + /** + * Decodes a RegressionMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegressionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.RegressionMetrics; + + /** + * Verifies a RegressionMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegressionMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegressionMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.RegressionMetrics; + + /** + * Creates a plain object from a RegressionMetrics message. Also converts values to other types if specified. + * @param message RegressionMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.RegressionMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegressionMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegressionMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AggregateClassificationMetrics. */ + interface IAggregateClassificationMetrics { + + /** AggregateClassificationMetrics precision */ + precision?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics recall */ + recall?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics accuracy */ + accuracy?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics threshold */ + threshold?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics f1Score */ + f1Score?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics logLoss */ + logLoss?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics rocAuc */ + rocAuc?: (google.protobuf.IDoubleValue|null); + } + + /** Represents an AggregateClassificationMetrics. */ + class AggregateClassificationMetrics implements IAggregateClassificationMetrics { + + /** + * Constructs a new AggregateClassificationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics); + + /** AggregateClassificationMetrics precision. */ + public precision?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics recall. */ + public recall?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics accuracy. */ + public accuracy?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics threshold. */ + public threshold?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics f1Score. */ + public f1Score?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics logLoss. */ + public logLoss?: (google.protobuf.IDoubleValue|null); + + /** AggregateClassificationMetrics rocAuc. */ + public rocAuc?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new AggregateClassificationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregateClassificationMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics): google.cloud.bigquery.v2.Model.AggregateClassificationMetrics; + + /** + * Encodes the specified AggregateClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify|verify} messages. + * @param message AggregateClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregateClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify|verify} messages. + * @param message AggregateClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregateClassificationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregateClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.AggregateClassificationMetrics; + + /** + * Decodes an AggregateClassificationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregateClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.AggregateClassificationMetrics; + + /** + * Verifies an AggregateClassificationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregateClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregateClassificationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.AggregateClassificationMetrics; + + /** + * Creates a plain object from an AggregateClassificationMetrics message. Also converts values to other types if specified. + * @param message AggregateClassificationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.AggregateClassificationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregateClassificationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregateClassificationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BinaryClassificationMetrics. */ + interface IBinaryClassificationMetrics { + + /** BinaryClassificationMetrics aggregateClassificationMetrics */ + aggregateClassificationMetrics?: (google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null); + + /** BinaryClassificationMetrics binaryConfusionMatrixList */ + binaryConfusionMatrixList?: (google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix[]|null); + + /** BinaryClassificationMetrics positiveLabel */ + positiveLabel?: (string|null); + + /** BinaryClassificationMetrics negativeLabel */ + negativeLabel?: (string|null); + } + + /** Represents a BinaryClassificationMetrics. */ + class BinaryClassificationMetrics implements IBinaryClassificationMetrics { + + /** + * Constructs a new BinaryClassificationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics); + + /** BinaryClassificationMetrics aggregateClassificationMetrics. */ + public aggregateClassificationMetrics?: (google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null); + + /** BinaryClassificationMetrics binaryConfusionMatrixList. */ + public binaryConfusionMatrixList: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix[]; + + /** BinaryClassificationMetrics positiveLabel. */ + public positiveLabel: string; + + /** BinaryClassificationMetrics negativeLabel. */ + public negativeLabel: string; + + /** + * Creates a new BinaryClassificationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns BinaryClassificationMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics; + + /** + * Encodes the specified BinaryClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.verify|verify} messages. + * @param message BinaryClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BinaryClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.verify|verify} messages. + * @param message BinaryClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BinaryClassificationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BinaryClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics; + + /** + * Decodes a BinaryClassificationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BinaryClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics; + + /** + * Verifies a BinaryClassificationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BinaryClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BinaryClassificationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics; + + /** + * Creates a plain object from a BinaryClassificationMetrics message. Also converts values to other types if specified. + * @param message BinaryClassificationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BinaryClassificationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BinaryClassificationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BinaryClassificationMetrics { + + /** Properties of a BinaryConfusionMatrix. */ + interface IBinaryConfusionMatrix { + + /** BinaryConfusionMatrix positiveClassThreshold */ + positiveClassThreshold?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix truePositives */ + truePositives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix falsePositives */ + falsePositives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix trueNegatives */ + trueNegatives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix falseNegatives */ + falseNegatives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix precision */ + precision?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix recall */ + recall?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix f1Score */ + f1Score?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix accuracy */ + accuracy?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a BinaryConfusionMatrix. */ + class BinaryConfusionMatrix implements IBinaryConfusionMatrix { + + /** + * Constructs a new BinaryConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix); + + /** BinaryConfusionMatrix positiveClassThreshold. */ + public positiveClassThreshold?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix truePositives. */ + public truePositives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix falsePositives. */ + public falsePositives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix trueNegatives. */ + public trueNegatives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix falseNegatives. */ + public falseNegatives?: (google.protobuf.IInt64Value|null); + + /** BinaryConfusionMatrix precision. */ + public precision?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix recall. */ + public recall?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix f1Score. */ + public f1Score?: (google.protobuf.IDoubleValue|null); + + /** BinaryConfusionMatrix accuracy. */ + public accuracy?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new BinaryConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns BinaryConfusionMatrix instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix; + + /** + * Encodes the specified BinaryConfusionMatrix message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.verify|verify} messages. + * @param message BinaryConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BinaryConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.verify|verify} messages. + * @param message BinaryConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BinaryConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BinaryConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix; + + /** + * Decodes a BinaryConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BinaryConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix; + + /** + * Verifies a BinaryConfusionMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BinaryConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BinaryConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix; + + /** + * Creates a plain object from a BinaryConfusionMatrix message. Also converts values to other types if specified. + * @param message BinaryConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BinaryConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BinaryConfusionMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MultiClassClassificationMetrics. */ + interface IMultiClassClassificationMetrics { + + /** MultiClassClassificationMetrics aggregateClassificationMetrics */ + aggregateClassificationMetrics?: (google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null); + + /** MultiClassClassificationMetrics confusionMatrixList */ + confusionMatrixList?: (google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix[]|null); + } + + /** Represents a MultiClassClassificationMetrics. */ + class MultiClassClassificationMetrics implements IMultiClassClassificationMetrics { + + /** + * Constructs a new MultiClassClassificationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics); + + /** MultiClassClassificationMetrics aggregateClassificationMetrics. */ + public aggregateClassificationMetrics?: (google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null); + + /** MultiClassClassificationMetrics confusionMatrixList. */ + public confusionMatrixList: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix[]; + + /** + * Creates a new MultiClassClassificationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiClassClassificationMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics; + + /** + * Encodes the specified MultiClassClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.verify|verify} messages. + * @param message MultiClassClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiClassClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.verify|verify} messages. + * @param message MultiClassClassificationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiClassClassificationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiClassClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics; + + /** + * Decodes a MultiClassClassificationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiClassClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics; + + /** + * Verifies a MultiClassClassificationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiClassClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiClassClassificationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics; + + /** + * Creates a plain object from a MultiClassClassificationMetrics message. Also converts values to other types if specified. + * @param message MultiClassClassificationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiClassClassificationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiClassClassificationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiClassClassificationMetrics { + + /** Properties of a ConfusionMatrix. */ + interface IConfusionMatrix { + + /** ConfusionMatrix confidenceThreshold */ + confidenceThreshold?: (google.protobuf.IDoubleValue|null); + + /** ConfusionMatrix rows */ + rows?: (google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix); + + /** ConfusionMatrix confidenceThreshold. */ + public confidenceThreshold?: (google.protobuf.IDoubleValue|null); + + /** ConfusionMatrix rows. */ + public rows: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow[]; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrix instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix; + + /** + * Verifies a ConfusionMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @param message ConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfusionMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfusionMatrix { + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry predictedLabel */ + predictedLabel?: (string|null); + + /** Entry itemCount */ + itemCount?: (google.protobuf.IInt64Value|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry); + + /** Entry predictedLabel. */ + public predictedLabel: string; + + /** Entry itemCount. */ + public itemCount?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row actualLabel */ + actualLabel?: (string|null); + + /** Row entries */ + entries?: (google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow); + + /** Row actualLabel. */ + public actualLabel: string; + + /** Row entries. */ + public entries: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a ClusteringMetrics. */ + interface IClusteringMetrics { + + /** ClusteringMetrics daviesBouldinIndex */ + daviesBouldinIndex?: (google.protobuf.IDoubleValue|null); + + /** ClusteringMetrics meanSquaredDistance */ + meanSquaredDistance?: (google.protobuf.IDoubleValue|null); + + /** ClusteringMetrics clusters */ + clusters?: (google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster[]|null); + } + + /** Represents a ClusteringMetrics. */ + class ClusteringMetrics implements IClusteringMetrics { + + /** + * Constructs a new ClusteringMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IClusteringMetrics); + + /** ClusteringMetrics daviesBouldinIndex. */ + public daviesBouldinIndex?: (google.protobuf.IDoubleValue|null); + + /** ClusteringMetrics meanSquaredDistance. */ + public meanSquaredDistance?: (google.protobuf.IDoubleValue|null); + + /** ClusteringMetrics clusters. */ + public clusters: google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster[]; + + /** + * Creates a new ClusteringMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusteringMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IClusteringMetrics): google.cloud.bigquery.v2.Model.ClusteringMetrics; + + /** + * Encodes the specified ClusteringMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.verify|verify} messages. + * @param message ClusteringMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IClusteringMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusteringMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.verify|verify} messages. + * @param message ClusteringMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IClusteringMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusteringMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusteringMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ClusteringMetrics; + + /** + * Decodes a ClusteringMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusteringMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ClusteringMetrics; + + /** + * Verifies a ClusteringMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusteringMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusteringMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ClusteringMetrics; + + /** + * Creates a plain object from a ClusteringMetrics message. Also converts values to other types if specified. + * @param message ClusteringMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ClusteringMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusteringMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusteringMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusteringMetrics { + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster centroidId */ + centroidId?: (number|Long|string|null); + + /** Cluster featureValues */ + featureValues?: (google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue[]|null); + + /** Cluster count */ + count?: (google.protobuf.IInt64Value|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster); + + /** Cluster centroidId. */ + public centroidId: (number|Long|string); + + /** Cluster featureValues. */ + public featureValues: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue[]; + + /** Cluster count. */ + public count?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** Properties of a FeatureValue. */ + interface IFeatureValue { + + /** FeatureValue featureColumn */ + featureColumn?: (string|null); + + /** FeatureValue numericalValue */ + numericalValue?: (google.protobuf.IDoubleValue|null); + + /** FeatureValue categoricalValue */ + categoricalValue?: (google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue|null); + } + + /** Represents a FeatureValue. */ + class FeatureValue implements IFeatureValue { + + /** + * Constructs a new FeatureValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue); + + /** FeatureValue featureColumn. */ + public featureColumn: string; + + /** FeatureValue numericalValue. */ + public numericalValue?: (google.protobuf.IDoubleValue|null); + + /** FeatureValue categoricalValue. */ + public categoricalValue?: (google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue|null); + + /** FeatureValue value. */ + public value?: ("numericalValue"|"categoricalValue"); + + /** + * Creates a new FeatureValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureValue instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue; + + /** + * Encodes the specified FeatureValue message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.verify|verify} messages. + * @param message FeatureValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.verify|verify} messages. + * @param message FeatureValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue; + + /** + * Decodes a FeatureValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue; + + /** + * Verifies a FeatureValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue; + + /** + * Creates a plain object from a FeatureValue message. Also converts values to other types if specified. + * @param message FeatureValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureValue { + + /** Properties of a CategoricalValue. */ + interface ICategoricalValue { + + /** CategoricalValue categoryCounts */ + categoryCounts?: (google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount[]|null); + } + + /** Represents a CategoricalValue. */ + class CategoricalValue implements ICategoricalValue { + + /** + * Constructs a new CategoricalValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue); + + /** CategoricalValue categoryCounts. */ + public categoryCounts: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount[]; + + /** + * Creates a new CategoricalValue instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalValue instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue; + + /** + * Encodes the specified CategoricalValue message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.verify|verify} messages. + * @param message CategoricalValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoricalValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.verify|verify} messages. + * @param message CategoricalValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoricalValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue; + + /** + * Decodes a CategoricalValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue; + + /** + * Verifies a CategoricalValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoricalValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue; + + /** + * Creates a plain object from a CategoricalValue message. Also converts values to other types if specified. + * @param message CategoricalValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoricalValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoricalValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CategoricalValue { + + /** Properties of a CategoryCount. */ + interface ICategoryCount { + + /** CategoryCount category */ + category?: (string|null); + + /** CategoryCount count */ + count?: (google.protobuf.IInt64Value|null); + } + + /** Represents a CategoryCount. */ + class CategoryCount implements ICategoryCount { + + /** + * Constructs a new CategoryCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount); + + /** CategoryCount category. */ + public category: string; + + /** CategoryCount count. */ + public count?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new CategoryCount instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryCount instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount; + + /** + * Encodes the specified CategoryCount message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.verify|verify} messages. + * @param message CategoryCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryCount message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.verify|verify} messages. + * @param message CategoryCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount; + + /** + * Decodes a CategoryCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount; + + /** + * Verifies a CategoryCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoryCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount; + + /** + * Creates a plain object from a CategoryCount message. Also converts values to other types if specified. + * @param message CategoryCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Properties of a RankingMetrics. */ + interface IRankingMetrics { + + /** RankingMetrics meanAveragePrecision */ + meanAveragePrecision?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics meanSquaredError */ + meanSquaredError?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics normalizedDiscountedCumulativeGain */ + normalizedDiscountedCumulativeGain?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics averageRank */ + averageRank?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a RankingMetrics. */ + class RankingMetrics implements IRankingMetrics { + + /** + * Constructs a new RankingMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IRankingMetrics); + + /** RankingMetrics meanAveragePrecision. */ + public meanAveragePrecision?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics meanSquaredError. */ + public meanSquaredError?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics normalizedDiscountedCumulativeGain. */ + public normalizedDiscountedCumulativeGain?: (google.protobuf.IDoubleValue|null); + + /** RankingMetrics averageRank. */ + public averageRank?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new RankingMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns RankingMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IRankingMetrics): google.cloud.bigquery.v2.Model.RankingMetrics; + + /** + * Encodes the specified RankingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.RankingMetrics.verify|verify} messages. + * @param message RankingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IRankingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RankingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.RankingMetrics.verify|verify} messages. + * @param message RankingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IRankingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RankingMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RankingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.RankingMetrics; + + /** + * Decodes a RankingMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RankingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.RankingMetrics; + + /** + * Verifies a RankingMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RankingMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RankingMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.RankingMetrics; + + /** + * Creates a plain object from a RankingMetrics message. Also converts values to other types if specified. + * @param message RankingMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.RankingMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RankingMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RankingMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArimaForecastingMetrics. */ + interface IArimaForecastingMetrics { + + /** ArimaForecastingMetrics arimaSingleModelForecastingMetrics */ + arimaSingleModelForecastingMetrics?: (google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics[]|null); + } + + /** Represents an ArimaForecastingMetrics. */ + class ArimaForecastingMetrics implements IArimaForecastingMetrics { + + /** + * Constructs a new ArimaForecastingMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IArimaForecastingMetrics); + + /** ArimaForecastingMetrics arimaSingleModelForecastingMetrics. */ + public arimaSingleModelForecastingMetrics: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics[]; + + /** + * Creates a new ArimaForecastingMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaForecastingMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IArimaForecastingMetrics): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics; + + /** + * Encodes the specified ArimaForecastingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.verify|verify} messages. + * @param message ArimaForecastingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IArimaForecastingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaForecastingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.verify|verify} messages. + * @param message ArimaForecastingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IArimaForecastingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaForecastingMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics; + + /** + * Decodes an ArimaForecastingMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics; + + /** + * Verifies an ArimaForecastingMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaForecastingMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaForecastingMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics; + + /** + * Creates a plain object from an ArimaForecastingMetrics message. Also converts values to other types if specified. + * @param message ArimaForecastingMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaForecastingMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaForecastingMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ArimaForecastingMetrics { + + /** Properties of an ArimaSingleModelForecastingMetrics. */ + interface IArimaSingleModelForecastingMetrics { + + /** ArimaSingleModelForecastingMetrics nonSeasonalOrder */ + nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** ArimaSingleModelForecastingMetrics arimaFittingMetrics */ + arimaFittingMetrics?: (google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null); + + /** ArimaSingleModelForecastingMetrics hasDrift */ + hasDrift?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics timeSeriesId */ + timeSeriesId?: (string|null); + + /** ArimaSingleModelForecastingMetrics timeSeriesIds */ + timeSeriesIds?: (string[]|null); + + /** ArimaSingleModelForecastingMetrics seasonalPeriods */ + seasonalPeriods?: (google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]|null); + + /** ArimaSingleModelForecastingMetrics hasHolidayEffect */ + hasHolidayEffect?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics hasSpikesAndDips */ + hasSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics hasStepChanges */ + hasStepChanges?: (google.protobuf.IBoolValue|null); + } + + /** Represents an ArimaSingleModelForecastingMetrics. */ + class ArimaSingleModelForecastingMetrics implements IArimaSingleModelForecastingMetrics { + + /** + * Constructs a new ArimaSingleModelForecastingMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics); + + /** ArimaSingleModelForecastingMetrics nonSeasonalOrder. */ + public nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** ArimaSingleModelForecastingMetrics arimaFittingMetrics. */ + public arimaFittingMetrics?: (google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null); + + /** ArimaSingleModelForecastingMetrics hasDrift. */ + public hasDrift?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics timeSeriesId. */ + public timeSeriesId: string; + + /** ArimaSingleModelForecastingMetrics timeSeriesIds. */ + public timeSeriesIds: string[]; + + /** ArimaSingleModelForecastingMetrics seasonalPeriods. */ + public seasonalPeriods: google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]; + + /** ArimaSingleModelForecastingMetrics hasHolidayEffect. */ + public hasHolidayEffect?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics hasSpikesAndDips. */ + public hasSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** ArimaSingleModelForecastingMetrics hasStepChanges. */ + public hasStepChanges?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new ArimaSingleModelForecastingMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaSingleModelForecastingMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics; + + /** + * Encodes the specified ArimaSingleModelForecastingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.verify|verify} messages. + * @param message ArimaSingleModelForecastingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaSingleModelForecastingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.verify|verify} messages. + * @param message ArimaSingleModelForecastingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaSingleModelForecastingMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaSingleModelForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics; + + /** + * Decodes an ArimaSingleModelForecastingMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaSingleModelForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics; + + /** + * Verifies an ArimaSingleModelForecastingMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaSingleModelForecastingMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaSingleModelForecastingMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics; + + /** + * Creates a plain object from an ArimaSingleModelForecastingMetrics message. Also converts values to other types if specified. + * @param message ArimaSingleModelForecastingMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaSingleModelForecastingMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaSingleModelForecastingMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DimensionalityReductionMetrics. */ + interface IDimensionalityReductionMetrics { + + /** DimensionalityReductionMetrics totalExplainedVarianceRatio */ + totalExplainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a DimensionalityReductionMetrics. */ + class DimensionalityReductionMetrics implements IDimensionalityReductionMetrics { + + /** + * Constructs a new DimensionalityReductionMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics); + + /** DimensionalityReductionMetrics totalExplainedVarianceRatio. */ + public totalExplainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new DimensionalityReductionMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionalityReductionMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics): google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics; + + /** + * Encodes the specified DimensionalityReductionMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.verify|verify} messages. + * @param message DimensionalityReductionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionalityReductionMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.verify|verify} messages. + * @param message DimensionalityReductionMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionalityReductionMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionalityReductionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics; + + /** + * Decodes a DimensionalityReductionMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionalityReductionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics; + + /** + * Verifies a DimensionalityReductionMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DimensionalityReductionMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionalityReductionMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics; + + /** + * Creates a plain object from a DimensionalityReductionMetrics message. Also converts values to other types if specified. + * @param message DimensionalityReductionMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionalityReductionMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionalityReductionMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationMetrics. */ + interface IEvaluationMetrics { + + /** EvaluationMetrics regressionMetrics */ + regressionMetrics?: (google.cloud.bigquery.v2.Model.IRegressionMetrics|null); + + /** EvaluationMetrics binaryClassificationMetrics */ + binaryClassificationMetrics?: (google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics|null); + + /** EvaluationMetrics multiClassClassificationMetrics */ + multiClassClassificationMetrics?: (google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics|null); + + /** EvaluationMetrics clusteringMetrics */ + clusteringMetrics?: (google.cloud.bigquery.v2.Model.IClusteringMetrics|null); + + /** EvaluationMetrics rankingMetrics */ + rankingMetrics?: (google.cloud.bigquery.v2.Model.IRankingMetrics|null); + + /** EvaluationMetrics arimaForecastingMetrics */ + arimaForecastingMetrics?: (google.cloud.bigquery.v2.Model.IArimaForecastingMetrics|null); + + /** EvaluationMetrics dimensionalityReductionMetrics */ + dimensionalityReductionMetrics?: (google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics|null); + } + + /** Represents an EvaluationMetrics. */ + class EvaluationMetrics implements IEvaluationMetrics { + + /** + * Constructs a new EvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IEvaluationMetrics); + + /** EvaluationMetrics regressionMetrics. */ + public regressionMetrics?: (google.cloud.bigquery.v2.Model.IRegressionMetrics|null); + + /** EvaluationMetrics binaryClassificationMetrics. */ + public binaryClassificationMetrics?: (google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics|null); + + /** EvaluationMetrics multiClassClassificationMetrics. */ + public multiClassClassificationMetrics?: (google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics|null); + + /** EvaluationMetrics clusteringMetrics. */ + public clusteringMetrics?: (google.cloud.bigquery.v2.Model.IClusteringMetrics|null); + + /** EvaluationMetrics rankingMetrics. */ + public rankingMetrics?: (google.cloud.bigquery.v2.Model.IRankingMetrics|null); + + /** EvaluationMetrics arimaForecastingMetrics. */ + public arimaForecastingMetrics?: (google.cloud.bigquery.v2.Model.IArimaForecastingMetrics|null); + + /** EvaluationMetrics dimensionalityReductionMetrics. */ + public dimensionalityReductionMetrics?: (google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics|null); + + /** EvaluationMetrics metrics. */ + public metrics?: ("regressionMetrics"|"binaryClassificationMetrics"|"multiClassClassificationMetrics"|"clusteringMetrics"|"rankingMetrics"|"arimaForecastingMetrics"|"dimensionalityReductionMetrics"); + + /** + * Creates a new EvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IEvaluationMetrics): google.cloud.bigquery.v2.Model.EvaluationMetrics; + + /** + * Encodes the specified EvaluationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.EvaluationMetrics.verify|verify} messages. + * @param message EvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.EvaluationMetrics.verify|verify} messages. + * @param message EvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.EvaluationMetrics; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.EvaluationMetrics; + + /** + * Verifies an EvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.EvaluationMetrics; + + /** + * Creates a plain object from an EvaluationMetrics message. Also converts values to other types if specified. + * @param message EvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.EvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSplitResult. */ + interface IDataSplitResult { + + /** DataSplitResult trainingTable */ + trainingTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** DataSplitResult evaluationTable */ + evaluationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** DataSplitResult testTable */ + testTable?: (google.cloud.bigquery.v2.ITableReference|null); + } + + /** Represents a DataSplitResult. */ + class DataSplitResult implements IDataSplitResult { + + /** + * Constructs a new DataSplitResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IDataSplitResult); + + /** DataSplitResult trainingTable. */ + public trainingTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** DataSplitResult evaluationTable. */ + public evaluationTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** DataSplitResult testTable. */ + public testTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** + * Creates a new DataSplitResult instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSplitResult instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IDataSplitResult): google.cloud.bigquery.v2.Model.DataSplitResult; + + /** + * Encodes the specified DataSplitResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DataSplitResult.verify|verify} messages. + * @param message DataSplitResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IDataSplitResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSplitResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DataSplitResult.verify|verify} messages. + * @param message DataSplitResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IDataSplitResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSplitResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSplitResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.DataSplitResult; + + /** + * Decodes a DataSplitResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSplitResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.DataSplitResult; + + /** + * Verifies a DataSplitResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSplitResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSplitResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.DataSplitResult; + + /** + * Creates a plain object from a DataSplitResult message. Also converts values to other types if specified. + * @param message DataSplitResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.DataSplitResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSplitResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSplitResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArimaOrder. */ + interface IArimaOrder { + + /** ArimaOrder p */ + p?: (google.protobuf.IInt64Value|null); + + /** ArimaOrder d */ + d?: (google.protobuf.IInt64Value|null); + + /** ArimaOrder q */ + q?: (google.protobuf.IInt64Value|null); + } + + /** Represents an ArimaOrder. */ + class ArimaOrder implements IArimaOrder { + + /** + * Constructs a new ArimaOrder. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IArimaOrder); + + /** ArimaOrder p. */ + public p?: (google.protobuf.IInt64Value|null); + + /** ArimaOrder d. */ + public d?: (google.protobuf.IInt64Value|null); + + /** ArimaOrder q. */ + public q?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new ArimaOrder instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaOrder instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IArimaOrder): google.cloud.bigquery.v2.Model.ArimaOrder; + + /** + * Encodes the specified ArimaOrder message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaOrder.verify|verify} messages. + * @param message ArimaOrder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IArimaOrder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaOrder message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaOrder.verify|verify} messages. + * @param message ArimaOrder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IArimaOrder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaOrder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ArimaOrder; + + /** + * Decodes an ArimaOrder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ArimaOrder; + + /** + * Verifies an ArimaOrder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaOrder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaOrder + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ArimaOrder; + + /** + * Creates a plain object from an ArimaOrder message. Also converts values to other types if specified. + * @param message ArimaOrder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ArimaOrder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaOrder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaOrder + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArimaFittingMetrics. */ + interface IArimaFittingMetrics { + + /** ArimaFittingMetrics logLikelihood */ + logLikelihood?: (google.protobuf.IDoubleValue|null); + + /** ArimaFittingMetrics aic */ + aic?: (google.protobuf.IDoubleValue|null); + + /** ArimaFittingMetrics variance */ + variance?: (google.protobuf.IDoubleValue|null); + } + + /** Represents an ArimaFittingMetrics. */ + class ArimaFittingMetrics implements IArimaFittingMetrics { + + /** + * Constructs a new ArimaFittingMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IArimaFittingMetrics); + + /** ArimaFittingMetrics logLikelihood. */ + public logLikelihood?: (google.protobuf.IDoubleValue|null); + + /** ArimaFittingMetrics aic. */ + public aic?: (google.protobuf.IDoubleValue|null); + + /** ArimaFittingMetrics variance. */ + public variance?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new ArimaFittingMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaFittingMetrics instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IArimaFittingMetrics): google.cloud.bigquery.v2.Model.ArimaFittingMetrics; + + /** + * Encodes the specified ArimaFittingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify|verify} messages. + * @param message ArimaFittingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IArimaFittingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaFittingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify|verify} messages. + * @param message ArimaFittingMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IArimaFittingMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaFittingMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaFittingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ArimaFittingMetrics; + + /** + * Decodes an ArimaFittingMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaFittingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ArimaFittingMetrics; + + /** + * Verifies an ArimaFittingMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaFittingMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaFittingMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ArimaFittingMetrics; + + /** + * Creates a plain object from an ArimaFittingMetrics message. Also converts values to other types if specified. + * @param message ArimaFittingMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ArimaFittingMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaFittingMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaFittingMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GlobalExplanation. */ + interface IGlobalExplanation { + + /** GlobalExplanation explanations */ + explanations?: (google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation[]|null); + + /** GlobalExplanation classLabel */ + classLabel?: (string|null); + } + + /** Represents a GlobalExplanation. */ + class GlobalExplanation implements IGlobalExplanation { + + /** + * Constructs a new GlobalExplanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IGlobalExplanation); + + /** GlobalExplanation explanations. */ + public explanations: google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation[]; + + /** GlobalExplanation classLabel. */ + public classLabel: string; + + /** + * Creates a new GlobalExplanation instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalExplanation instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IGlobalExplanation): google.cloud.bigquery.v2.Model.GlobalExplanation; + + /** + * Encodes the specified GlobalExplanation message. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.verify|verify} messages. + * @param message GlobalExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IGlobalExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalExplanation message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.verify|verify} messages. + * @param message GlobalExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IGlobalExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalExplanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.GlobalExplanation; + + /** + * Decodes a GlobalExplanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.GlobalExplanation; + + /** + * Verifies a GlobalExplanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalExplanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalExplanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.GlobalExplanation; + + /** + * Creates a plain object from a GlobalExplanation message. Also converts values to other types if specified. + * @param message GlobalExplanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.GlobalExplanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalExplanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GlobalExplanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GlobalExplanation { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation featureName */ + featureName?: (string|null); + + /** Explanation attribution */ + attribution?: (google.protobuf.IDoubleValue|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation); + + /** Explanation featureName. */ + public featureName: string; + + /** Explanation attribution. */ + public attribution?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation): google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation; + + /** + * Verifies an Explanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CategoryEncodingMethod. */ + interface ICategoryEncodingMethod { + } + + /** Represents a CategoryEncodingMethod. */ + class CategoryEncodingMethod implements ICategoryEncodingMethod { + + /** + * Constructs a new CategoryEncodingMethod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ICategoryEncodingMethod); + + /** + * Creates a new CategoryEncodingMethod instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryEncodingMethod instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ICategoryEncodingMethod): google.cloud.bigquery.v2.Model.CategoryEncodingMethod; + + /** + * Encodes the specified CategoryEncodingMethod message. Does not implicitly {@link google.cloud.bigquery.v2.Model.CategoryEncodingMethod.verify|verify} messages. + * @param message CategoryEncodingMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ICategoryEncodingMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryEncodingMethod message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.CategoryEncodingMethod.verify|verify} messages. + * @param message CategoryEncodingMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ICategoryEncodingMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryEncodingMethod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryEncodingMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.CategoryEncodingMethod; + + /** + * Decodes a CategoryEncodingMethod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryEncodingMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.CategoryEncodingMethod; + + /** + * Verifies a CategoryEncodingMethod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoryEncodingMethod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryEncodingMethod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.CategoryEncodingMethod; + + /** + * Creates a plain object from a CategoryEncodingMethod message. Also converts values to other types if specified. + * @param message CategoryEncodingMethod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.CategoryEncodingMethod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryEncodingMethod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryEncodingMethod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CategoryEncodingMethod { + + /** EncodingMethod enum. */ + enum EncodingMethod { + ENCODING_METHOD_UNSPECIFIED = 0, + ONE_HOT_ENCODING = 1, + LABEL_ENCODING = 2, + DUMMY_ENCODING = 3 + } + } + + /** Properties of a PcaSolverOptionEnums. */ + interface IPcaSolverOptionEnums { + } + + /** Represents a PcaSolverOptionEnums. */ + class PcaSolverOptionEnums implements IPcaSolverOptionEnums { + + /** + * Constructs a new PcaSolverOptionEnums. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums); + + /** + * Creates a new PcaSolverOptionEnums instance using the specified properties. + * @param [properties] Properties to set + * @returns PcaSolverOptionEnums instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums): google.cloud.bigquery.v2.Model.PcaSolverOptionEnums; + + /** + * Encodes the specified PcaSolverOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.verify|verify} messages. + * @param message PcaSolverOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PcaSolverOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.verify|verify} messages. + * @param message PcaSolverOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PcaSolverOptionEnums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PcaSolverOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.PcaSolverOptionEnums; + + /** + * Decodes a PcaSolverOptionEnums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PcaSolverOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.PcaSolverOptionEnums; + + /** + * Verifies a PcaSolverOptionEnums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PcaSolverOptionEnums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PcaSolverOptionEnums + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.PcaSolverOptionEnums; + + /** + * Creates a plain object from a PcaSolverOptionEnums message. Also converts values to other types if specified. + * @param message PcaSolverOptionEnums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.PcaSolverOptionEnums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PcaSolverOptionEnums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PcaSolverOptionEnums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PcaSolverOptionEnums { + + /** PcaSolver enum. */ + enum PcaSolver { + UNSPECIFIED = 0, + FULL = 1, + RANDOMIZED = 2, + AUTO = 3 + } + } + + /** Properties of a ModelRegistryOptionEnums. */ + interface IModelRegistryOptionEnums { + } + + /** Represents a ModelRegistryOptionEnums. */ + class ModelRegistryOptionEnums implements IModelRegistryOptionEnums { + + /** + * Constructs a new ModelRegistryOptionEnums. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums); + + /** + * Creates a new ModelRegistryOptionEnums instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelRegistryOptionEnums instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums): google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums; + + /** + * Encodes the specified ModelRegistryOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.verify|verify} messages. + * @param message ModelRegistryOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelRegistryOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.verify|verify} messages. + * @param message ModelRegistryOptionEnums message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelRegistryOptionEnums message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelRegistryOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums; + + /** + * Decodes a ModelRegistryOptionEnums message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelRegistryOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums; + + /** + * Verifies a ModelRegistryOptionEnums message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelRegistryOptionEnums message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelRegistryOptionEnums + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums; + + /** + * Creates a plain object from a ModelRegistryOptionEnums message. Also converts values to other types if specified. + * @param message ModelRegistryOptionEnums + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelRegistryOptionEnums to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelRegistryOptionEnums + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModelRegistryOptionEnums { + + /** ModelRegistry enum. */ + enum ModelRegistry { + MODEL_REGISTRY_UNSPECIFIED = 0, + VERTEX_AI = 1 + } + } + + /** Properties of a TrainingRun. */ + interface ITrainingRun { + + /** TrainingRun trainingOptions */ + trainingOptions?: (google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null); + + /** TrainingRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TrainingRun results */ + results?: (google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult[]|null); + + /** TrainingRun evaluationMetrics */ + evaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + + /** TrainingRun dataSplitResult */ + dataSplitResult?: (google.cloud.bigquery.v2.Model.IDataSplitResult|null); + + /** TrainingRun modelLevelGlobalExplanation */ + modelLevelGlobalExplanation?: (google.cloud.bigquery.v2.Model.IGlobalExplanation|null); + + /** TrainingRun classLevelGlobalExplanations */ + classLevelGlobalExplanations?: (google.cloud.bigquery.v2.Model.IGlobalExplanation[]|null); + + /** TrainingRun vertexAiModelId */ + vertexAiModelId?: (string|null); + + /** TrainingRun vertexAiModelVersion */ + vertexAiModelVersion?: (string|null); + } + + /** Represents a TrainingRun. */ + class TrainingRun implements ITrainingRun { + + /** + * Constructs a new TrainingRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.ITrainingRun); + + /** TrainingRun trainingOptions. */ + public trainingOptions?: (google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null); + + /** TrainingRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TrainingRun results. */ + public results: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult[]; + + /** TrainingRun evaluationMetrics. */ + public evaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + + /** TrainingRun dataSplitResult. */ + public dataSplitResult?: (google.cloud.bigquery.v2.Model.IDataSplitResult|null); + + /** TrainingRun modelLevelGlobalExplanation. */ + public modelLevelGlobalExplanation?: (google.cloud.bigquery.v2.Model.IGlobalExplanation|null); + + /** TrainingRun classLevelGlobalExplanations. */ + public classLevelGlobalExplanations: google.cloud.bigquery.v2.Model.IGlobalExplanation[]; + + /** TrainingRun vertexAiModelId. */ + public vertexAiModelId: string; + + /** TrainingRun vertexAiModelVersion. */ + public vertexAiModelVersion: string; + + /** + * Creates a new TrainingRun instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingRun instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.ITrainingRun): google.cloud.bigquery.v2.Model.TrainingRun; + + /** + * Encodes the specified TrainingRun message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.verify|verify} messages. + * @param message TrainingRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.ITrainingRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.verify|verify} messages. + * @param message TrainingRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.ITrainingRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun; + + /** + * Decodes a TrainingRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun; + + /** + * Verifies a TrainingRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainingRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun; + + /** + * Creates a plain object from a TrainingRun message. Also converts values to other types if specified. + * @param message TrainingRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainingRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainingRun { + + /** Properties of a TrainingOptions. */ + interface ITrainingOptions { + + /** TrainingOptions maxIterations */ + maxIterations?: (number|Long|string|null); + + /** TrainingOptions lossType */ + lossType?: (google.cloud.bigquery.v2.Model.LossType|keyof typeof google.cloud.bigquery.v2.Model.LossType|null); + + /** TrainingOptions learnRate */ + learnRate?: (number|null); + + /** TrainingOptions l1Regularization */ + l1Regularization?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions l2Regularization */ + l2Regularization?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions minRelativeProgress */ + minRelativeProgress?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions warmStart */ + warmStart?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions earlyStop */ + earlyStop?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions inputLabelColumns */ + inputLabelColumns?: (string[]|null); + + /** TrainingOptions dataSplitMethod */ + dataSplitMethod?: (google.cloud.bigquery.v2.Model.DataSplitMethod|keyof typeof google.cloud.bigquery.v2.Model.DataSplitMethod|null); + + /** TrainingOptions dataSplitEvalFraction */ + dataSplitEvalFraction?: (number|null); + + /** TrainingOptions dataSplitColumn */ + dataSplitColumn?: (string|null); + + /** TrainingOptions learnRateStrategy */ + learnRateStrategy?: (google.cloud.bigquery.v2.Model.LearnRateStrategy|keyof typeof google.cloud.bigquery.v2.Model.LearnRateStrategy|null); + + /** TrainingOptions initialLearnRate */ + initialLearnRate?: (number|null); + + /** TrainingOptions labelClassWeights */ + labelClassWeights?: ({ [k: string]: number }|null); + + /** TrainingOptions userColumn */ + userColumn?: (string|null); + + /** TrainingOptions itemColumn */ + itemColumn?: (string|null); + + /** TrainingOptions distanceType */ + distanceType?: (google.cloud.bigquery.v2.Model.DistanceType|keyof typeof google.cloud.bigquery.v2.Model.DistanceType|null); + + /** TrainingOptions numClusters */ + numClusters?: (number|Long|string|null); + + /** TrainingOptions modelUri */ + modelUri?: (string|null); + + /** TrainingOptions optimizationStrategy */ + optimizationStrategy?: (google.cloud.bigquery.v2.Model.OptimizationStrategy|keyof typeof google.cloud.bigquery.v2.Model.OptimizationStrategy|null); + + /** TrainingOptions hiddenUnits */ + hiddenUnits?: ((number|Long|string)[]|null); + + /** TrainingOptions batchSize */ + batchSize?: (number|Long|string|null); + + /** TrainingOptions dropout */ + dropout?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions maxTreeDepth */ + maxTreeDepth?: (number|Long|string|null); + + /** TrainingOptions subsample */ + subsample?: (number|null); + + /** TrainingOptions minSplitLoss */ + minSplitLoss?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions boosterType */ + boosterType?: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType|null); + + /** TrainingOptions numParallelTree */ + numParallelTree?: (google.protobuf.IInt64Value|null); + + /** TrainingOptions dartNormalizeType */ + dartNormalizeType?: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType|null); + + /** TrainingOptions treeMethod */ + treeMethod?: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod|null); + + /** TrainingOptions minTreeChildWeight */ + minTreeChildWeight?: (google.protobuf.IInt64Value|null); + + /** TrainingOptions colsampleBytree */ + colsampleBytree?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions colsampleBylevel */ + colsampleBylevel?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions colsampleBynode */ + colsampleBynode?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions numFactors */ + numFactors?: (number|Long|string|null); + + /** TrainingOptions feedbackType */ + feedbackType?: (google.cloud.bigquery.v2.Model.FeedbackType|keyof typeof google.cloud.bigquery.v2.Model.FeedbackType|null); + + /** TrainingOptions walsAlpha */ + walsAlpha?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions kmeansInitializationMethod */ + kmeansInitializationMethod?: (google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod|keyof typeof google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod|null); + + /** TrainingOptions kmeansInitializationColumn */ + kmeansInitializationColumn?: (string|null); + + /** TrainingOptions timeSeriesTimestampColumn */ + timeSeriesTimestampColumn?: (string|null); + + /** TrainingOptions timeSeriesDataColumn */ + timeSeriesDataColumn?: (string|null); + + /** TrainingOptions autoArima */ + autoArima?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions nonSeasonalOrder */ + nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** TrainingOptions dataFrequency */ + dataFrequency?: (google.cloud.bigquery.v2.Model.DataFrequency|keyof typeof google.cloud.bigquery.v2.Model.DataFrequency|null); + + /** TrainingOptions calculatePValues */ + calculatePValues?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions includeDrift */ + includeDrift?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions holidayRegion */ + holidayRegion?: (google.cloud.bigquery.v2.Model.HolidayRegion|keyof typeof google.cloud.bigquery.v2.Model.HolidayRegion|null); + + /** TrainingOptions holidayRegions */ + holidayRegions?: (google.cloud.bigquery.v2.Model.HolidayRegion[]|null); + + /** TrainingOptions timeSeriesIdColumn */ + timeSeriesIdColumn?: (string|null); + + /** TrainingOptions timeSeriesIdColumns */ + timeSeriesIdColumns?: (string[]|null); + + /** TrainingOptions forecastLimitLowerBound */ + forecastLimitLowerBound?: (number|null); + + /** TrainingOptions forecastLimitUpperBound */ + forecastLimitUpperBound?: (number|null); + + /** TrainingOptions horizon */ + horizon?: (number|Long|string|null); + + /** TrainingOptions autoArimaMaxOrder */ + autoArimaMaxOrder?: (number|Long|string|null); + + /** TrainingOptions autoArimaMinOrder */ + autoArimaMinOrder?: (number|Long|string|null); + + /** TrainingOptions numTrials */ + numTrials?: (number|Long|string|null); + + /** TrainingOptions maxParallelTrials */ + maxParallelTrials?: (number|Long|string|null); + + /** TrainingOptions hparamTuningObjectives */ + hparamTuningObjectives?: (google.cloud.bigquery.v2.Model.HparamTuningEnums.HparamTuningObjective[]|null); + + /** TrainingOptions decomposeTimeSeries */ + decomposeTimeSeries?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions cleanSpikesAndDips */ + cleanSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions adjustStepChanges */ + adjustStepChanges?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions enableGlobalExplain */ + enableGlobalExplain?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions sampledShapleyNumPaths */ + sampledShapleyNumPaths?: (number|Long|string|null); + + /** TrainingOptions integratedGradientsNumSteps */ + integratedGradientsNumSteps?: (number|Long|string|null); + + /** TrainingOptions categoryEncodingMethod */ + categoryEncodingMethod?: (google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod|keyof typeof google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod|null); + + /** TrainingOptions tfVersion */ + tfVersion?: (string|null); + + /** TrainingOptions colorSpace */ + colorSpace?: (google.cloud.bigquery.v2.Model.ColorSpace|keyof typeof google.cloud.bigquery.v2.Model.ColorSpace|null); + + /** TrainingOptions instanceWeightColumn */ + instanceWeightColumn?: (string|null); + + /** TrainingOptions trendSmoothingWindowSize */ + trendSmoothingWindowSize?: (number|Long|string|null); + + /** TrainingOptions timeSeriesLengthFraction */ + timeSeriesLengthFraction?: (number|null); + + /** TrainingOptions minTimeSeriesLength */ + minTimeSeriesLength?: (number|Long|string|null); + + /** TrainingOptions maxTimeSeriesLength */ + maxTimeSeriesLength?: (number|Long|string|null); + + /** TrainingOptions xgboostVersion */ + xgboostVersion?: (string|null); + + /** TrainingOptions approxGlobalFeatureContrib */ + approxGlobalFeatureContrib?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions fitIntercept */ + fitIntercept?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions numPrincipalComponents */ + numPrincipalComponents?: (number|Long|string|null); + + /** TrainingOptions pcaExplainedVarianceRatio */ + pcaExplainedVarianceRatio?: (number|null); + + /** TrainingOptions scaleFeatures */ + scaleFeatures?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions pcaSolver */ + pcaSolver?: (google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver|keyof typeof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver|null); + + /** TrainingOptions autoClassWeights */ + autoClassWeights?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions activationFn */ + activationFn?: (string|null); + + /** TrainingOptions optimizer */ + optimizer?: (string|null); + + /** TrainingOptions budgetHours */ + budgetHours?: (number|null); + + /** TrainingOptions standardizeFeatures */ + standardizeFeatures?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions l1RegActivation */ + l1RegActivation?: (number|null); + + /** TrainingOptions modelRegistry */ + modelRegistry?: (google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry|keyof typeof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry|null); + + /** TrainingOptions vertexAiModelVersionAliases */ + vertexAiModelVersionAliases?: (string[]|null); + + /** TrainingOptions dimensionIdColumns */ + dimensionIdColumns?: (string[]|null); + + /** TrainingOptions contributionMetric */ + contributionMetric?: (string|null); + + /** TrainingOptions isTestColumn */ + isTestColumn?: (string|null); + + /** TrainingOptions minAprioriSupport */ + minAprioriSupport?: (number|null); + + /** TrainingOptions huggingFaceModelId */ + huggingFaceModelId?: (string|null); + + /** TrainingOptions modelGardenModelName */ + modelGardenModelName?: (string|null); + + /** TrainingOptions endpointIdleTtl */ + endpointIdleTtl?: (google.protobuf.IDuration|null); + + /** TrainingOptions machineType */ + machineType?: (string|null); + + /** TrainingOptions minReplicaCount */ + minReplicaCount?: (number|Long|string|null); + + /** TrainingOptions maxReplicaCount */ + maxReplicaCount?: (number|Long|string|null); + + /** TrainingOptions reservationAffinityType */ + reservationAffinityType?: (google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|keyof typeof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|null); + + /** TrainingOptions reservationAffinityKey */ + reservationAffinityKey?: (string|null); + + /** TrainingOptions reservationAffinityValues */ + reservationAffinityValues?: (string[]|null); + } + + /** Represents a TrainingOptions. */ + class TrainingOptions implements ITrainingOptions { + + /** + * Constructs a new TrainingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions); + + /** TrainingOptions maxIterations. */ + public maxIterations: (number|Long|string); + + /** TrainingOptions lossType. */ + public lossType: (google.cloud.bigquery.v2.Model.LossType|keyof typeof google.cloud.bigquery.v2.Model.LossType); + + /** TrainingOptions learnRate. */ + public learnRate: number; + + /** TrainingOptions l1Regularization. */ + public l1Regularization?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions l2Regularization. */ + public l2Regularization?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions minRelativeProgress. */ + public minRelativeProgress?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions warmStart. */ + public warmStart?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions earlyStop. */ + public earlyStop?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions inputLabelColumns. */ + public inputLabelColumns: string[]; + + /** TrainingOptions dataSplitMethod. */ + public dataSplitMethod: (google.cloud.bigquery.v2.Model.DataSplitMethod|keyof typeof google.cloud.bigquery.v2.Model.DataSplitMethod); + + /** TrainingOptions dataSplitEvalFraction. */ + public dataSplitEvalFraction: number; + + /** TrainingOptions dataSplitColumn. */ + public dataSplitColumn: string; + + /** TrainingOptions learnRateStrategy. */ + public learnRateStrategy: (google.cloud.bigquery.v2.Model.LearnRateStrategy|keyof typeof google.cloud.bigquery.v2.Model.LearnRateStrategy); + + /** TrainingOptions initialLearnRate. */ + public initialLearnRate: number; + + /** TrainingOptions labelClassWeights. */ + public labelClassWeights: { [k: string]: number }; + + /** TrainingOptions userColumn. */ + public userColumn: string; + + /** TrainingOptions itemColumn. */ + public itemColumn: string; + + /** TrainingOptions distanceType. */ + public distanceType: (google.cloud.bigquery.v2.Model.DistanceType|keyof typeof google.cloud.bigquery.v2.Model.DistanceType); + + /** TrainingOptions numClusters. */ + public numClusters: (number|Long|string); + + /** TrainingOptions modelUri. */ + public modelUri: string; + + /** TrainingOptions optimizationStrategy. */ + public optimizationStrategy: (google.cloud.bigquery.v2.Model.OptimizationStrategy|keyof typeof google.cloud.bigquery.v2.Model.OptimizationStrategy); + + /** TrainingOptions hiddenUnits. */ + public hiddenUnits: (number|Long|string)[]; + + /** TrainingOptions batchSize. */ + public batchSize: (number|Long|string); + + /** TrainingOptions dropout. */ + public dropout?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions maxTreeDepth. */ + public maxTreeDepth: (number|Long|string); + + /** TrainingOptions subsample. */ + public subsample: number; + + /** TrainingOptions minSplitLoss. */ + public minSplitLoss?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions boosterType. */ + public boosterType: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType); + + /** TrainingOptions numParallelTree. */ + public numParallelTree?: (google.protobuf.IInt64Value|null); + + /** TrainingOptions dartNormalizeType. */ + public dartNormalizeType: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType); + + /** TrainingOptions treeMethod. */ + public treeMethod: (google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod|keyof typeof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod); + + /** TrainingOptions minTreeChildWeight. */ + public minTreeChildWeight?: (google.protobuf.IInt64Value|null); + + /** TrainingOptions colsampleBytree. */ + public colsampleBytree?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions colsampleBylevel. */ + public colsampleBylevel?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions colsampleBynode. */ + public colsampleBynode?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions numFactors. */ + public numFactors: (number|Long|string); + + /** TrainingOptions feedbackType. */ + public feedbackType: (google.cloud.bigquery.v2.Model.FeedbackType|keyof typeof google.cloud.bigquery.v2.Model.FeedbackType); + + /** TrainingOptions walsAlpha. */ + public walsAlpha?: (google.protobuf.IDoubleValue|null); + + /** TrainingOptions kmeansInitializationMethod. */ + public kmeansInitializationMethod: (google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod|keyof typeof google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod); + + /** TrainingOptions kmeansInitializationColumn. */ + public kmeansInitializationColumn: string; + + /** TrainingOptions timeSeriesTimestampColumn. */ + public timeSeriesTimestampColumn: string; + + /** TrainingOptions timeSeriesDataColumn. */ + public timeSeriesDataColumn: string; + + /** TrainingOptions autoArima. */ + public autoArima?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions nonSeasonalOrder. */ + public nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** TrainingOptions dataFrequency. */ + public dataFrequency: (google.cloud.bigquery.v2.Model.DataFrequency|keyof typeof google.cloud.bigquery.v2.Model.DataFrequency); + + /** TrainingOptions calculatePValues. */ + public calculatePValues?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions includeDrift. */ + public includeDrift?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions holidayRegion. */ + public holidayRegion: (google.cloud.bigquery.v2.Model.HolidayRegion|keyof typeof google.cloud.bigquery.v2.Model.HolidayRegion); + + /** TrainingOptions holidayRegions. */ + public holidayRegions: google.cloud.bigquery.v2.Model.HolidayRegion[]; + + /** TrainingOptions timeSeriesIdColumn. */ + public timeSeriesIdColumn: string; + + /** TrainingOptions timeSeriesIdColumns. */ + public timeSeriesIdColumns: string[]; + + /** TrainingOptions forecastLimitLowerBound. */ + public forecastLimitLowerBound: number; + + /** TrainingOptions forecastLimitUpperBound. */ + public forecastLimitUpperBound: number; + + /** TrainingOptions horizon. */ + public horizon: (number|Long|string); + + /** TrainingOptions autoArimaMaxOrder. */ + public autoArimaMaxOrder: (number|Long|string); + + /** TrainingOptions autoArimaMinOrder. */ + public autoArimaMinOrder: (number|Long|string); + + /** TrainingOptions numTrials. */ + public numTrials: (number|Long|string); + + /** TrainingOptions maxParallelTrials. */ + public maxParallelTrials: (number|Long|string); + + /** TrainingOptions hparamTuningObjectives. */ + public hparamTuningObjectives: google.cloud.bigquery.v2.Model.HparamTuningEnums.HparamTuningObjective[]; + + /** TrainingOptions decomposeTimeSeries. */ + public decomposeTimeSeries?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions cleanSpikesAndDips. */ + public cleanSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions adjustStepChanges. */ + public adjustStepChanges?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions enableGlobalExplain. */ + public enableGlobalExplain?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions sampledShapleyNumPaths. */ + public sampledShapleyNumPaths: (number|Long|string); + + /** TrainingOptions integratedGradientsNumSteps. */ + public integratedGradientsNumSteps: (number|Long|string); + + /** TrainingOptions categoryEncodingMethod. */ + public categoryEncodingMethod: (google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod|keyof typeof google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod); + + /** TrainingOptions tfVersion. */ + public tfVersion: string; + + /** TrainingOptions colorSpace. */ + public colorSpace: (google.cloud.bigquery.v2.Model.ColorSpace|keyof typeof google.cloud.bigquery.v2.Model.ColorSpace); + + /** TrainingOptions instanceWeightColumn. */ + public instanceWeightColumn: string; + + /** TrainingOptions trendSmoothingWindowSize. */ + public trendSmoothingWindowSize: (number|Long|string); + + /** TrainingOptions timeSeriesLengthFraction. */ + public timeSeriesLengthFraction: number; + + /** TrainingOptions minTimeSeriesLength. */ + public minTimeSeriesLength: (number|Long|string); + + /** TrainingOptions maxTimeSeriesLength. */ + public maxTimeSeriesLength: (number|Long|string); + + /** TrainingOptions xgboostVersion. */ + public xgboostVersion: string; + + /** TrainingOptions approxGlobalFeatureContrib. */ + public approxGlobalFeatureContrib?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions fitIntercept. */ + public fitIntercept?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions numPrincipalComponents. */ + public numPrincipalComponents: (number|Long|string); + + /** TrainingOptions pcaExplainedVarianceRatio. */ + public pcaExplainedVarianceRatio: number; + + /** TrainingOptions scaleFeatures. */ + public scaleFeatures?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions pcaSolver. */ + public pcaSolver: (google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver|keyof typeof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver); + + /** TrainingOptions autoClassWeights. */ + public autoClassWeights?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions activationFn. */ + public activationFn: string; + + /** TrainingOptions optimizer. */ + public optimizer: string; + + /** TrainingOptions budgetHours. */ + public budgetHours: number; + + /** TrainingOptions standardizeFeatures. */ + public standardizeFeatures?: (google.protobuf.IBoolValue|null); + + /** TrainingOptions l1RegActivation. */ + public l1RegActivation: number; + + /** TrainingOptions modelRegistry. */ + public modelRegistry: (google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry|keyof typeof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry); + + /** TrainingOptions vertexAiModelVersionAliases. */ + public vertexAiModelVersionAliases: string[]; + + /** TrainingOptions dimensionIdColumns. */ + public dimensionIdColumns: string[]; + + /** TrainingOptions contributionMetric. */ + public contributionMetric?: (string|null); + + /** TrainingOptions isTestColumn. */ + public isTestColumn?: (string|null); + + /** TrainingOptions minAprioriSupport. */ + public minAprioriSupport?: (number|null); + + /** TrainingOptions huggingFaceModelId. */ + public huggingFaceModelId?: (string|null); + + /** TrainingOptions modelGardenModelName. */ + public modelGardenModelName?: (string|null); + + /** TrainingOptions endpointIdleTtl. */ + public endpointIdleTtl?: (google.protobuf.IDuration|null); + + /** TrainingOptions machineType. */ + public machineType?: (string|null); + + /** TrainingOptions minReplicaCount. */ + public minReplicaCount?: (number|Long|string|null); + + /** TrainingOptions maxReplicaCount. */ + public maxReplicaCount?: (number|Long|string|null); + + /** TrainingOptions reservationAffinityType. */ + public reservationAffinityType?: (google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|keyof typeof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|null); + + /** TrainingOptions reservationAffinityKey. */ + public reservationAffinityKey?: (string|null); + + /** TrainingOptions reservationAffinityValues. */ + public reservationAffinityValues: string[]; + + /** TrainingOptions externalModelId. */ + public externalModelId?: ("huggingFaceModelId"|"modelGardenModelName"); + + /** + * Creates a new TrainingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions): google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions; + + /** + * Encodes the specified TrainingOptions message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify|verify} messages. + * @param message TrainingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify|verify} messages. + * @param message TrainingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions; + + /** + * Decodes a TrainingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions; + + /** + * Verifies a TrainingOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions; + + /** + * Creates a plain object from a TrainingOptions message. Also converts values to other types if specified. + * @param message TrainingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainingOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainingOptions { + + /** ReservationAffinityType enum. */ + enum ReservationAffinityType { + RESERVATION_AFFINITY_TYPE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + ANY_RESERVATION = 2, + SPECIFIC_RESERVATION = 3 + } + } + + /** Properties of an IterationResult. */ + interface IIterationResult { + + /** IterationResult index */ + index?: (google.protobuf.IInt32Value|null); + + /** IterationResult durationMs */ + durationMs?: (google.protobuf.IInt64Value|null); + + /** IterationResult trainingLoss */ + trainingLoss?: (google.protobuf.IDoubleValue|null); + + /** IterationResult evalLoss */ + evalLoss?: (google.protobuf.IDoubleValue|null); + + /** IterationResult learnRate */ + learnRate?: (number|null); + + /** IterationResult clusterInfos */ + clusterInfos?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo[]|null); + + /** IterationResult arimaResult */ + arimaResult?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult|null); + + /** IterationResult principalComponentInfos */ + principalComponentInfos?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo[]|null); + } + + /** Represents an IterationResult. */ + class IterationResult implements IIterationResult { + + /** + * Constructs a new IterationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult); + + /** IterationResult index. */ + public index?: (google.protobuf.IInt32Value|null); + + /** IterationResult durationMs. */ + public durationMs?: (google.protobuf.IInt64Value|null); + + /** IterationResult trainingLoss. */ + public trainingLoss?: (google.protobuf.IDoubleValue|null); + + /** IterationResult evalLoss. */ + public evalLoss?: (google.protobuf.IDoubleValue|null); + + /** IterationResult learnRate. */ + public learnRate: number; + + /** IterationResult clusterInfos. */ + public clusterInfos: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo[]; + + /** IterationResult arimaResult. */ + public arimaResult?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult|null); + + /** IterationResult principalComponentInfos. */ + public principalComponentInfos: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo[]; + + /** + * Creates a new IterationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IterationResult instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult; + + /** + * Encodes the specified IterationResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify|verify} messages. + * @param message IterationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IterationResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify|verify} messages. + * @param message IterationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IterationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IterationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult; + + /** + * Decodes an IterationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IterationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult; + + /** + * Verifies an IterationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IterationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IterationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult; + + /** + * Creates a plain object from an IterationResult message. Also converts values to other types if specified. + * @param message IterationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IterationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IterationResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IterationResult { + + /** Properties of a ClusterInfo. */ + interface IClusterInfo { + + /** ClusterInfo centroidId */ + centroidId?: (number|Long|string|null); + + /** ClusterInfo clusterRadius */ + clusterRadius?: (google.protobuf.IDoubleValue|null); + + /** ClusterInfo clusterSize */ + clusterSize?: (google.protobuf.IInt64Value|null); + } + + /** Represents a ClusterInfo. */ + class ClusterInfo implements IClusterInfo { + + /** + * Constructs a new ClusterInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo); + + /** ClusterInfo centroidId. */ + public centroidId: (number|Long|string); + + /** ClusterInfo clusterRadius. */ + public clusterRadius?: (google.protobuf.IDoubleValue|null); + + /** ClusterInfo clusterSize. */ + public clusterSize?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new ClusterInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo; + + /** + * Encodes the specified ClusterInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.verify|verify} messages. + * @param message ClusterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.verify|verify} messages. + * @param message ClusterInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo; + + /** + * Decodes a ClusterInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo; + + /** + * Verifies a ClusterInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo; + + /** + * Creates a plain object from a ClusterInfo message. Also converts values to other types if specified. + * @param message ClusterInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArimaResult. */ + interface IArimaResult { + + /** ArimaResult arimaModelInfo */ + arimaModelInfo?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo[]|null); + + /** ArimaResult seasonalPeriods */ + seasonalPeriods?: (google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]|null); + } + + /** Represents an ArimaResult. */ + class ArimaResult implements IArimaResult { + + /** + * Constructs a new ArimaResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult); + + /** ArimaResult arimaModelInfo. */ + public arimaModelInfo: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo[]; + + /** ArimaResult seasonalPeriods. */ + public seasonalPeriods: google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]; + + /** + * Creates a new ArimaResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaResult instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult; + + /** + * Encodes the specified ArimaResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.verify|verify} messages. + * @param message ArimaResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.verify|verify} messages. + * @param message ArimaResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult; + + /** + * Decodes an ArimaResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult; + + /** + * Verifies an ArimaResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult; + + /** + * Creates a plain object from an ArimaResult message. Also converts values to other types if specified. + * @param message ArimaResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ArimaResult { + + /** Properties of an ArimaCoefficients. */ + interface IArimaCoefficients { + + /** ArimaCoefficients autoRegressiveCoefficients */ + autoRegressiveCoefficients?: (number[]|null); + + /** ArimaCoefficients movingAverageCoefficients */ + movingAverageCoefficients?: (number[]|null); + + /** ArimaCoefficients interceptCoefficient */ + interceptCoefficient?: (google.protobuf.IDoubleValue|null); + } + + /** Represents an ArimaCoefficients. */ + class ArimaCoefficients implements IArimaCoefficients { + + /** + * Constructs a new ArimaCoefficients. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients); + + /** ArimaCoefficients autoRegressiveCoefficients. */ + public autoRegressiveCoefficients: number[]; + + /** ArimaCoefficients movingAverageCoefficients. */ + public movingAverageCoefficients: number[]; + + /** ArimaCoefficients interceptCoefficient. */ + public interceptCoefficient?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new ArimaCoefficients instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaCoefficients instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients; + + /** + * Encodes the specified ArimaCoefficients message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.verify|verify} messages. + * @param message ArimaCoefficients message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaCoefficients message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.verify|verify} messages. + * @param message ArimaCoefficients message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaCoefficients message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaCoefficients + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients; + + /** + * Decodes an ArimaCoefficients message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaCoefficients + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients; + + /** + * Verifies an ArimaCoefficients message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaCoefficients message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaCoefficients + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients; + + /** + * Creates a plain object from an ArimaCoefficients message. Also converts values to other types if specified. + * @param message ArimaCoefficients + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaCoefficients to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaCoefficients + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArimaModelInfo. */ + interface IArimaModelInfo { + + /** ArimaModelInfo nonSeasonalOrder */ + nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** ArimaModelInfo arimaCoefficients */ + arimaCoefficients?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients|null); + + /** ArimaModelInfo arimaFittingMetrics */ + arimaFittingMetrics?: (google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null); + + /** ArimaModelInfo hasDrift */ + hasDrift?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo timeSeriesId */ + timeSeriesId?: (string|null); + + /** ArimaModelInfo timeSeriesIds */ + timeSeriesIds?: (string[]|null); + + /** ArimaModelInfo seasonalPeriods */ + seasonalPeriods?: (google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]|null); + + /** ArimaModelInfo hasHolidayEffect */ + hasHolidayEffect?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo hasSpikesAndDips */ + hasSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo hasStepChanges */ + hasStepChanges?: (google.protobuf.IBoolValue|null); + } + + /** Represents an ArimaModelInfo. */ + class ArimaModelInfo implements IArimaModelInfo { + + /** + * Constructs a new ArimaModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo); + + /** ArimaModelInfo nonSeasonalOrder. */ + public nonSeasonalOrder?: (google.cloud.bigquery.v2.Model.IArimaOrder|null); + + /** ArimaModelInfo arimaCoefficients. */ + public arimaCoefficients?: (google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients|null); + + /** ArimaModelInfo arimaFittingMetrics. */ + public arimaFittingMetrics?: (google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null); + + /** ArimaModelInfo hasDrift. */ + public hasDrift?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo timeSeriesId. */ + public timeSeriesId: string; + + /** ArimaModelInfo timeSeriesIds. */ + public timeSeriesIds: string[]; + + /** ArimaModelInfo seasonalPeriods. */ + public seasonalPeriods: google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[]; + + /** ArimaModelInfo hasHolidayEffect. */ + public hasHolidayEffect?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo hasSpikesAndDips. */ + public hasSpikesAndDips?: (google.protobuf.IBoolValue|null); + + /** ArimaModelInfo hasStepChanges. */ + public hasStepChanges?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new ArimaModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ArimaModelInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo; + + /** + * Encodes the specified ArimaModelInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.verify|verify} messages. + * @param message ArimaModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArimaModelInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.verify|verify} messages. + * @param message ArimaModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArimaModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArimaModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo; + + /** + * Decodes an ArimaModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArimaModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo; + + /** + * Verifies an ArimaModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArimaModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArimaModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo; + + /** + * Creates a plain object from an ArimaModelInfo message. Also converts values to other types if specified. + * @param message ArimaModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArimaModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArimaModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PrincipalComponentInfo. */ + interface IPrincipalComponentInfo { + + /** PrincipalComponentInfo principalComponentId */ + principalComponentId?: (google.protobuf.IInt64Value|null); + + /** PrincipalComponentInfo explainedVariance */ + explainedVariance?: (google.protobuf.IDoubleValue|null); + + /** PrincipalComponentInfo explainedVarianceRatio */ + explainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + + /** PrincipalComponentInfo cumulativeExplainedVarianceRatio */ + cumulativeExplainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a PrincipalComponentInfo. */ + class PrincipalComponentInfo implements IPrincipalComponentInfo { + + /** + * Constructs a new PrincipalComponentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo); + + /** PrincipalComponentInfo principalComponentId. */ + public principalComponentId?: (google.protobuf.IInt64Value|null); + + /** PrincipalComponentInfo explainedVariance. */ + public explainedVariance?: (google.protobuf.IDoubleValue|null); + + /** PrincipalComponentInfo explainedVarianceRatio. */ + public explainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + + /** PrincipalComponentInfo cumulativeExplainedVarianceRatio. */ + public cumulativeExplainedVarianceRatio?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new PrincipalComponentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PrincipalComponentInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo; + + /** + * Encodes the specified PrincipalComponentInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.verify|verify} messages. + * @param message PrincipalComponentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrincipalComponentInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.verify|verify} messages. + * @param message PrincipalComponentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrincipalComponentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrincipalComponentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo; + + /** + * Decodes a PrincipalComponentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrincipalComponentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo; + + /** + * Verifies a PrincipalComponentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrincipalComponentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrincipalComponentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo; + + /** + * Creates a plain object from a PrincipalComponentInfo message. Also converts values to other types if specified. + * @param message PrincipalComponentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrincipalComponentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrincipalComponentInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a DoubleHparamSearchSpace. */ + interface IDoubleHparamSearchSpace { + + /** DoubleHparamSearchSpace range */ + range?: (google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange|null); + + /** DoubleHparamSearchSpace candidates */ + candidates?: (google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates|null); + } + + /** Represents a DoubleHparamSearchSpace. */ + class DoubleHparamSearchSpace implements IDoubleHparamSearchSpace { + + /** + * Constructs a new DoubleHparamSearchSpace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace); + + /** DoubleHparamSearchSpace range. */ + public range?: (google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange|null); + + /** DoubleHparamSearchSpace candidates. */ + public candidates?: (google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates|null); + + /** DoubleHparamSearchSpace searchSpace. */ + public searchSpace?: ("range"|"candidates"); + + /** + * Creates a new DoubleHparamSearchSpace instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleHparamSearchSpace instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace; + + /** + * Encodes the specified DoubleHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify|verify} messages. + * @param message DoubleHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify|verify} messages. + * @param message DoubleHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleHparamSearchSpace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace; + + /** + * Decodes a DoubleHparamSearchSpace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace; + + /** + * Verifies a DoubleHparamSearchSpace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleHparamSearchSpace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace; + + /** + * Creates a plain object from a DoubleHparamSearchSpace message. Also converts values to other types if specified. + * @param message DoubleHparamSearchSpace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleHparamSearchSpace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleHparamSearchSpace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DoubleHparamSearchSpace { + + /** Properties of a DoubleRange. */ + interface IDoubleRange { + + /** DoubleRange min */ + min?: (google.protobuf.IDoubleValue|null); + + /** DoubleRange max */ + max?: (google.protobuf.IDoubleValue|null); + } + + /** Represents a DoubleRange. */ + class DoubleRange implements IDoubleRange { + + /** + * Constructs a new DoubleRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange); + + /** DoubleRange min. */ + public min?: (google.protobuf.IDoubleValue|null); + + /** DoubleRange max. */ + public max?: (google.protobuf.IDoubleValue|null); + + /** + * Creates a new DoubleRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleRange instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange; + + /** + * Verifies a DoubleRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @param message DoubleRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleCandidates. */ + interface IDoubleCandidates { + + /** DoubleCandidates candidates */ + candidates?: (google.protobuf.IDoubleValue[]|null); + } + + /** Represents a DoubleCandidates. */ + class DoubleCandidates implements IDoubleCandidates { + + /** + * Constructs a new DoubleCandidates. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates); + + /** DoubleCandidates candidates. */ + public candidates: google.protobuf.IDoubleValue[]; + + /** + * Creates a new DoubleCandidates instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleCandidates instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates; + + /** + * Encodes the specified DoubleCandidates message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.verify|verify} messages. + * @param message DoubleCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleCandidates message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.verify|verify} messages. + * @param message DoubleCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleCandidates message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates; + + /** + * Decodes a DoubleCandidates message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates; + + /** + * Verifies a DoubleCandidates message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleCandidates message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleCandidates + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates; + + /** + * Creates a plain object from a DoubleCandidates message. Also converts values to other types if specified. + * @param message DoubleCandidates + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleCandidates to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleCandidates + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IntHparamSearchSpace. */ + interface IIntHparamSearchSpace { + + /** IntHparamSearchSpace range */ + range?: (google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange|null); + + /** IntHparamSearchSpace candidates */ + candidates?: (google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates|null); + } + + /** Represents an IntHparamSearchSpace. */ + class IntHparamSearchSpace implements IIntHparamSearchSpace { + + /** + * Constructs a new IntHparamSearchSpace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IIntHparamSearchSpace); + + /** IntHparamSearchSpace range. */ + public range?: (google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange|null); + + /** IntHparamSearchSpace candidates. */ + public candidates?: (google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates|null); + + /** IntHparamSearchSpace searchSpace. */ + public searchSpace?: ("range"|"candidates"); + + /** + * Creates a new IntHparamSearchSpace instance using the specified properties. + * @param [properties] Properties to set + * @returns IntHparamSearchSpace instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IIntHparamSearchSpace): google.cloud.bigquery.v2.Model.IntHparamSearchSpace; + + /** + * Encodes the specified IntHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify|verify} messages. + * @param message IntHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IIntHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify|verify} messages. + * @param message IntHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IIntHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntHparamSearchSpace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.IntHparamSearchSpace; + + /** + * Decodes an IntHparamSearchSpace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.IntHparamSearchSpace; + + /** + * Verifies an IntHparamSearchSpace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntHparamSearchSpace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.IntHparamSearchSpace; + + /** + * Creates a plain object from an IntHparamSearchSpace message. Also converts values to other types if specified. + * @param message IntHparamSearchSpace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntHparamSearchSpace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntHparamSearchSpace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntHparamSearchSpace { + + /** Properties of an IntRange. */ + interface IIntRange { + + /** IntRange min */ + min?: (google.protobuf.IInt64Value|null); + + /** IntRange max */ + max?: (google.protobuf.IInt64Value|null); + } + + /** Represents an IntRange. */ + class IntRange implements IIntRange { + + /** + * Constructs a new IntRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange); + + /** IntRange min. */ + public min?: (google.protobuf.IInt64Value|null); + + /** IntRange max. */ + public max?: (google.protobuf.IInt64Value|null); + + /** + * Creates a new IntRange instance using the specified properties. + * @param [properties] Properties to set + * @returns IntRange instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange; + + /** + * Encodes the specified IntRange message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.verify|verify} messages. + * @param message IntRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.verify|verify} messages. + * @param message IntRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange; + + /** + * Decodes an IntRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange; + + /** + * Verifies an IntRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange; + + /** + * Creates a plain object from an IntRange message. Also converts values to other types if specified. + * @param message IntRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntCandidates. */ + interface IIntCandidates { + + /** IntCandidates candidates */ + candidates?: (google.protobuf.IInt64Value[]|null); + } + + /** Represents an IntCandidates. */ + class IntCandidates implements IIntCandidates { + + /** + * Constructs a new IntCandidates. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates); + + /** IntCandidates candidates. */ + public candidates: google.protobuf.IInt64Value[]; + + /** + * Creates a new IntCandidates instance using the specified properties. + * @param [properties] Properties to set + * @returns IntCandidates instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates; + + /** + * Encodes the specified IntCandidates message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.verify|verify} messages. + * @param message IntCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntCandidates message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.verify|verify} messages. + * @param message IntCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntCandidates message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates; + + /** + * Decodes an IntCandidates message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates; + + /** + * Verifies an IntCandidates message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntCandidates message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntCandidates + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates; + + /** + * Creates a plain object from an IntCandidates message. Also converts values to other types if specified. + * @param message IntCandidates + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntCandidates to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntCandidates + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StringHparamSearchSpace. */ + interface IStringHparamSearchSpace { + + /** StringHparamSearchSpace candidates */ + candidates?: (string[]|null); + } + + /** Represents a StringHparamSearchSpace. */ + class StringHparamSearchSpace implements IStringHparamSearchSpace { + + /** + * Constructs a new StringHparamSearchSpace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IStringHparamSearchSpace); + + /** StringHparamSearchSpace candidates. */ + public candidates: string[]; + + /** + * Creates a new StringHparamSearchSpace instance using the specified properties. + * @param [properties] Properties to set + * @returns StringHparamSearchSpace instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IStringHparamSearchSpace): google.cloud.bigquery.v2.Model.StringHparamSearchSpace; + + /** + * Encodes the specified StringHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify|verify} messages. + * @param message StringHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IStringHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify|verify} messages. + * @param message StringHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IStringHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringHparamSearchSpace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.StringHparamSearchSpace; + + /** + * Decodes a StringHparamSearchSpace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.StringHparamSearchSpace; + + /** + * Verifies a StringHparamSearchSpace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringHparamSearchSpace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.StringHparamSearchSpace; + + /** + * Creates a plain object from a StringHparamSearchSpace message. Also converts values to other types if specified. + * @param message StringHparamSearchSpace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.StringHparamSearchSpace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringHparamSearchSpace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringHparamSearchSpace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IntArrayHparamSearchSpace. */ + interface IIntArrayHparamSearchSpace { + + /** IntArrayHparamSearchSpace candidates */ + candidates?: (google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray[]|null); + } + + /** Represents an IntArrayHparamSearchSpace. */ + class IntArrayHparamSearchSpace implements IIntArrayHparamSearchSpace { + + /** + * Constructs a new IntArrayHparamSearchSpace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace); + + /** IntArrayHparamSearchSpace candidates. */ + public candidates: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray[]; + + /** + * Creates a new IntArrayHparamSearchSpace instance using the specified properties. + * @param [properties] Properties to set + * @returns IntArrayHparamSearchSpace instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace; + + /** + * Encodes the specified IntArrayHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.verify|verify} messages. + * @param message IntArrayHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntArrayHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.verify|verify} messages. + * @param message IntArrayHparamSearchSpace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntArrayHparamSearchSpace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntArrayHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace; + + /** + * Decodes an IntArrayHparamSearchSpace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntArrayHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace; + + /** + * Verifies an IntArrayHparamSearchSpace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntArrayHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntArrayHparamSearchSpace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace; + + /** + * Creates a plain object from an IntArrayHparamSearchSpace message. Also converts values to other types if specified. + * @param message IntArrayHparamSearchSpace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntArrayHparamSearchSpace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntArrayHparamSearchSpace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IntArrayHparamSearchSpace { + + /** Properties of an IntArray. */ + interface IIntArray { + + /** IntArray elements */ + elements?: ((number|Long|string)[]|null); + } + + /** Represents an IntArray. */ + class IntArray implements IIntArray { + + /** + * Constructs a new IntArray. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray); + + /** IntArray elements. */ + public elements: (number|Long|string)[]; + + /** + * Creates a new IntArray instance using the specified properties. + * @param [properties] Properties to set + * @returns IntArray instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray; + + /** + * Encodes the specified IntArray message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.verify|verify} messages. + * @param message IntArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntArray message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.verify|verify} messages. + * @param message IntArray message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntArray message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray; + + /** + * Decodes an IntArray message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray; + + /** + * Verifies an IntArray message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IntArray message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntArray + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray; + + /** + * Creates a plain object from an IntArray message. Also converts values to other types if specified. + * @param message IntArray + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntArray to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntArray + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a HparamSearchSpaces. */ + interface IHparamSearchSpaces { + + /** HparamSearchSpaces learnRate */ + learnRate?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces l1Reg */ + l1Reg?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces l2Reg */ + l2Reg?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces numClusters */ + numClusters?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces numFactors */ + numFactors?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces hiddenUnits */ + hiddenUnits?: (google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace|null); + + /** HparamSearchSpaces batchSize */ + batchSize?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces dropout */ + dropout?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces maxTreeDepth */ + maxTreeDepth?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces subsample */ + subsample?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces minSplitLoss */ + minSplitLoss?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces walsAlpha */ + walsAlpha?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces boosterType */ + boosterType?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces numParallelTree */ + numParallelTree?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces dartNormalizeType */ + dartNormalizeType?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces treeMethod */ + treeMethod?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces minTreeChildWeight */ + minTreeChildWeight?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBytree */ + colsampleBytree?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBylevel */ + colsampleBylevel?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBynode */ + colsampleBynode?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces activationFn */ + activationFn?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces optimizer */ + optimizer?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + } + + /** Represents a HparamSearchSpaces. */ + class HparamSearchSpaces implements IHparamSearchSpaces { + + /** + * Constructs a new HparamSearchSpaces. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IHparamSearchSpaces); + + /** HparamSearchSpaces learnRate. */ + public learnRate?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces l1Reg. */ + public l1Reg?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces l2Reg. */ + public l2Reg?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces numClusters. */ + public numClusters?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces numFactors. */ + public numFactors?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces hiddenUnits. */ + public hiddenUnits?: (google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace|null); + + /** HparamSearchSpaces batchSize. */ + public batchSize?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces dropout. */ + public dropout?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces maxTreeDepth. */ + public maxTreeDepth?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces subsample. */ + public subsample?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces minSplitLoss. */ + public minSplitLoss?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces walsAlpha. */ + public walsAlpha?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces boosterType. */ + public boosterType?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces numParallelTree. */ + public numParallelTree?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces dartNormalizeType. */ + public dartNormalizeType?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces treeMethod. */ + public treeMethod?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces minTreeChildWeight. */ + public minTreeChildWeight?: (google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBytree. */ + public colsampleBytree?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBylevel. */ + public colsampleBylevel?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces colsampleBynode. */ + public colsampleBynode?: (google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null); + + /** HparamSearchSpaces activationFn. */ + public activationFn?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** HparamSearchSpaces optimizer. */ + public optimizer?: (google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null); + + /** + * Creates a new HparamSearchSpaces instance using the specified properties. + * @param [properties] Properties to set + * @returns HparamSearchSpaces instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IHparamSearchSpaces): google.cloud.bigquery.v2.Model.HparamSearchSpaces; + + /** + * Encodes the specified HparamSearchSpaces message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamSearchSpaces.verify|verify} messages. + * @param message HparamSearchSpaces message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IHparamSearchSpaces, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HparamSearchSpaces message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamSearchSpaces.verify|verify} messages. + * @param message HparamSearchSpaces message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IHparamSearchSpaces, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HparamSearchSpaces message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HparamSearchSpaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.HparamSearchSpaces; + + /** + * Decodes a HparamSearchSpaces message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HparamSearchSpaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.HparamSearchSpaces; + + /** + * Verifies a HparamSearchSpaces message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HparamSearchSpaces message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HparamSearchSpaces + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.HparamSearchSpaces; + + /** + * Creates a plain object from a HparamSearchSpaces message. Also converts values to other types if specified. + * @param message HparamSearchSpaces + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.HparamSearchSpaces, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HparamSearchSpaces to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HparamSearchSpaces + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HparamTuningTrial. */ + interface IHparamTuningTrial { + + /** HparamTuningTrial trialId */ + trialId?: (number|Long|string|null); + + /** HparamTuningTrial startTimeMs */ + startTimeMs?: (number|Long|string|null); + + /** HparamTuningTrial endTimeMs */ + endTimeMs?: (number|Long|string|null); + + /** HparamTuningTrial hparams */ + hparams?: (google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null); + + /** HparamTuningTrial evaluationMetrics */ + evaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + + /** HparamTuningTrial status */ + status?: (google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus|keyof typeof google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus|null); + + /** HparamTuningTrial errorMessage */ + errorMessage?: (string|null); + + /** HparamTuningTrial trainingLoss */ + trainingLoss?: (google.protobuf.IDoubleValue|null); + + /** HparamTuningTrial evalLoss */ + evalLoss?: (google.protobuf.IDoubleValue|null); + + /** HparamTuningTrial hparamTuningEvaluationMetrics */ + hparamTuningEvaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + } + + /** Represents a HparamTuningTrial. */ + class HparamTuningTrial implements IHparamTuningTrial { + + /** + * Constructs a new HparamTuningTrial. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Model.IHparamTuningTrial); + + /** HparamTuningTrial trialId. */ + public trialId: (number|Long|string); + + /** HparamTuningTrial startTimeMs. */ + public startTimeMs: (number|Long|string); + + /** HparamTuningTrial endTimeMs. */ + public endTimeMs: (number|Long|string); + + /** HparamTuningTrial hparams. */ + public hparams?: (google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null); + + /** HparamTuningTrial evaluationMetrics. */ + public evaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + + /** HparamTuningTrial status. */ + public status: (google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus|keyof typeof google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus); + + /** HparamTuningTrial errorMessage. */ + public errorMessage: string; + + /** HparamTuningTrial trainingLoss. */ + public trainingLoss?: (google.protobuf.IDoubleValue|null); + + /** HparamTuningTrial evalLoss. */ + public evalLoss?: (google.protobuf.IDoubleValue|null); + + /** HparamTuningTrial hparamTuningEvaluationMetrics. */ + public hparamTuningEvaluationMetrics?: (google.cloud.bigquery.v2.Model.IEvaluationMetrics|null); + + /** + * Creates a new HparamTuningTrial instance using the specified properties. + * @param [properties] Properties to set + * @returns HparamTuningTrial instance + */ + public static create(properties?: google.cloud.bigquery.v2.Model.IHparamTuningTrial): google.cloud.bigquery.v2.Model.HparamTuningTrial; + + /** + * Encodes the specified HparamTuningTrial message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningTrial.verify|verify} messages. + * @param message HparamTuningTrial message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Model.IHparamTuningTrial, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HparamTuningTrial message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningTrial.verify|verify} messages. + * @param message HparamTuningTrial message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Model.IHparamTuningTrial, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HparamTuningTrial message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HparamTuningTrial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Model.HparamTuningTrial; + + /** + * Decodes a HparamTuningTrial message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HparamTuningTrial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Model.HparamTuningTrial; + + /** + * Verifies a HparamTuningTrial message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HparamTuningTrial message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HparamTuningTrial + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Model.HparamTuningTrial; + + /** + * Creates a plain object from a HparamTuningTrial message. Also converts values to other types if specified. + * @param message HparamTuningTrial + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Model.HparamTuningTrial, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HparamTuningTrial to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HparamTuningTrial + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HparamTuningTrial { + + /** TrialStatus enum. */ + enum TrialStatus { + TRIAL_STATUS_UNSPECIFIED = 0, + NOT_STARTED = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4, + INFEASIBLE = 5, + STOPPED_EARLY = 6 + } + } + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest projectId */ + projectId?: (string|null); + + /** GetModelRequest datasetId */ + datasetId?: (string|null); + + /** GetModelRequest modelId */ + modelId?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetModelRequest); + + /** GetModelRequest projectId. */ + public projectId: string; + + /** GetModelRequest datasetId. */ + public datasetId: string; + + /** GetModelRequest modelId. */ + public modelId: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetModelRequest): google.cloud.bigquery.v2.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PatchModelRequest. */ + interface IPatchModelRequest { + + /** PatchModelRequest projectId */ + projectId?: (string|null); + + /** PatchModelRequest datasetId */ + datasetId?: (string|null); + + /** PatchModelRequest modelId */ + modelId?: (string|null); + + /** PatchModelRequest model */ + model?: (google.cloud.bigquery.v2.IModel|null); + } + + /** Represents a PatchModelRequest. */ + class PatchModelRequest implements IPatchModelRequest { + + /** + * Constructs a new PatchModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPatchModelRequest); + + /** PatchModelRequest projectId. */ + public projectId: string; + + /** PatchModelRequest datasetId. */ + public datasetId: string; + + /** PatchModelRequest modelId. */ + public modelId: string; + + /** PatchModelRequest model. */ + public model?: (google.cloud.bigquery.v2.IModel|null); + + /** + * Creates a new PatchModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchModelRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPatchModelRequest): google.cloud.bigquery.v2.PatchModelRequest; + + /** + * Encodes the specified PatchModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.PatchModelRequest.verify|verify} messages. + * @param message PatchModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPatchModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PatchModelRequest.verify|verify} messages. + * @param message PatchModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPatchModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PatchModelRequest; + + /** + * Decodes a PatchModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PatchModelRequest; + + /** + * Verifies a PatchModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PatchModelRequest; + + /** + * Creates a plain object from a PatchModelRequest message. Also converts values to other types if specified. + * @param message PatchModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PatchModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { + + /** DeleteModelRequest projectId */ + projectId?: (string|null); + + /** DeleteModelRequest datasetId */ + datasetId?: (string|null); + + /** DeleteModelRequest modelId */ + modelId?: (string|null); + } + + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { + + /** + * Constructs a new DeleteModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteModelRequest); + + /** DeleteModelRequest projectId. */ + public projectId: string; + + /** DeleteModelRequest datasetId. */ + public datasetId: string; + + /** DeleteModelRequest modelId. */ + public modelId: string; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteModelRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteModelRequest): google.cloud.bigquery.v2.DeleteModelRequest; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteModelRequest; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteModelRequest; + + /** + * Verifies a DeleteModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteModelRequest; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest projectId */ + projectId?: (string|null); + + /** ListModelsRequest datasetId */ + datasetId?: (string|null); + + /** ListModelsRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListModelsRequest); + + /** ListModelsRequest projectId. */ + public projectId: string; + + /** ListModelsRequest datasetId. */ + public datasetId: string; + + /** ListModelsRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListModelsRequest): google.cloud.bigquery.v2.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse models */ + models?: (google.cloud.bigquery.v2.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListModelsResponse); + + /** ListModelsResponse models. */ + public models: google.cloud.bigquery.v2.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListModelsResponse): google.cloud.bigquery.v2.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyGraphReference. */ + interface IPropertyGraphReference { + + /** PropertyGraphReference projectId */ + projectId?: (string|null); + + /** PropertyGraphReference datasetId */ + datasetId?: (string|null); + + /** PropertyGraphReference propertyGraphId */ + propertyGraphId?: (string|null); + } + + /** Represents a PropertyGraphReference. */ + class PropertyGraphReference implements IPropertyGraphReference { + + /** + * Constructs a new PropertyGraphReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPropertyGraphReference); + + /** PropertyGraphReference projectId. */ + public projectId: string; + + /** PropertyGraphReference datasetId. */ + public datasetId: string; + + /** PropertyGraphReference propertyGraphId. */ + public propertyGraphId: string; + + /** + * Creates a new PropertyGraphReference instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyGraphReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPropertyGraphReference): google.cloud.bigquery.v2.PropertyGraphReference; + + /** + * Encodes the specified PropertyGraphReference message. Does not implicitly {@link google.cloud.bigquery.v2.PropertyGraphReference.verify|verify} messages. + * @param message PropertyGraphReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPropertyGraphReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyGraphReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PropertyGraphReference.verify|verify} messages. + * @param message PropertyGraphReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPropertyGraphReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyGraphReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyGraphReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PropertyGraphReference; + + /** + * Decodes a PropertyGraphReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyGraphReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PropertyGraphReference; + + /** + * Verifies a PropertyGraphReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PropertyGraphReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyGraphReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PropertyGraphReference; + + /** + * Creates a plain object from a PropertyGraphReference message. Also converts values to other types if specified. + * @param message PropertyGraphReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PropertyGraphReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyGraphReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyGraphReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowAccessPolicyReference. */ + interface IRowAccessPolicyReference { + + /** RowAccessPolicyReference projectId */ + projectId?: (string|null); + + /** RowAccessPolicyReference datasetId */ + datasetId?: (string|null); + + /** RowAccessPolicyReference tableId */ + tableId?: (string|null); + + /** RowAccessPolicyReference policyId */ + policyId?: (string|null); + } + + /** Represents a RowAccessPolicyReference. */ + class RowAccessPolicyReference implements IRowAccessPolicyReference { + + /** + * Constructs a new RowAccessPolicyReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRowAccessPolicyReference); + + /** RowAccessPolicyReference projectId. */ + public projectId: string; + + /** RowAccessPolicyReference datasetId. */ + public datasetId: string; + + /** RowAccessPolicyReference tableId. */ + public tableId: string; + + /** RowAccessPolicyReference policyId. */ + public policyId: string; + + /** + * Creates a new RowAccessPolicyReference instance using the specified properties. + * @param [properties] Properties to set + * @returns RowAccessPolicyReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRowAccessPolicyReference): google.cloud.bigquery.v2.RowAccessPolicyReference; + + /** + * Encodes the specified RowAccessPolicyReference message. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicyReference.verify|verify} messages. + * @param message RowAccessPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRowAccessPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowAccessPolicyReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicyReference.verify|verify} messages. + * @param message RowAccessPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRowAccessPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowAccessPolicyReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowAccessPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RowAccessPolicyReference; + + /** + * Decodes a RowAccessPolicyReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowAccessPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RowAccessPolicyReference; + + /** + * Verifies a RowAccessPolicyReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowAccessPolicyReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowAccessPolicyReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RowAccessPolicyReference; + + /** + * Creates a plain object from a RowAccessPolicyReference message. Also converts values to other types if specified. + * @param message RowAccessPolicyReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RowAccessPolicyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowAccessPolicyReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowAccessPolicyReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionInfo. */ + interface ISessionInfo { + + /** SessionInfo sessionId */ + sessionId?: (string|null); + } + + /** Represents a SessionInfo. */ + class SessionInfo implements ISessionInfo { + + /** + * Constructs a new SessionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISessionInfo); + + /** SessionInfo sessionId. */ + public sessionId: string; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISessionInfo): google.cloud.bigquery.v2.SessionInfo; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SessionInfo.verify|verify} messages. + * @param message SessionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISessionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SessionInfo; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SessionInfo; + + /** + * Verifies a SessionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SessionInfo; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @param message SessionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SessionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus errorResult */ + errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** JobStatus errors */ + errors?: (google.cloud.bigquery.v2.IErrorProto[]|null); + + /** JobStatus state */ + state?: (string|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJobStatus); + + /** JobStatus errorResult. */ + public errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** JobStatus errors. */ + public errors: google.cloud.bigquery.v2.IErrorProto[]; + + /** JobStatus state. */ + public state: string; + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJobStatus): google.cloud.bigquery.v2.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata legacyLocationId */ + legacyLocationId?: (string|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ILocationMetadata); + + /** LocationMetadata legacyLocationId. */ + public legacyLocationId: string; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.bigquery.v2.ILocationMetadata): google.cloud.bigquery.v2.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.bigquery.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ManagedTableType enum. */ + enum ManagedTableType { + MANAGED_TABLE_TYPE_UNSPECIFIED = 0, + NATIVE = 1, + BIGLAKE = 2 + } + + /** Properties of a PartitioningDefinition. */ + interface IPartitioningDefinition { + + /** PartitioningDefinition partitionedColumn */ + partitionedColumn?: (google.cloud.bigquery.v2.IPartitionedColumn[]|null); + } + + /** Represents a PartitioningDefinition. */ + class PartitioningDefinition implements IPartitioningDefinition { + + /** + * Constructs a new PartitioningDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPartitioningDefinition); + + /** PartitioningDefinition partitionedColumn. */ + public partitionedColumn: google.cloud.bigquery.v2.IPartitionedColumn[]; + + /** + * Creates a new PartitioningDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitioningDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPartitioningDefinition): google.cloud.bigquery.v2.PartitioningDefinition; + + /** + * Encodes the specified PartitioningDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.PartitioningDefinition.verify|verify} messages. + * @param message PartitioningDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPartitioningDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitioningDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitioningDefinition.verify|verify} messages. + * @param message PartitioningDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPartitioningDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitioningDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitioningDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PartitioningDefinition; + + /** + * Decodes a PartitioningDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitioningDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PartitioningDefinition; + + /** + * Verifies a PartitioningDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitioningDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitioningDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PartitioningDefinition; + + /** + * Creates a plain object from a PartitioningDefinition message. Also converts values to other types if specified. + * @param message PartitioningDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PartitioningDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitioningDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitioningDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionedColumn. */ + interface IPartitionedColumn { + + /** PartitionedColumn field */ + field?: (string|null); + } + + /** Represents a PartitionedColumn. */ + class PartitionedColumn implements IPartitionedColumn { + + /** + * Constructs a new PartitionedColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPartitionedColumn); + + /** PartitionedColumn field. */ + public field?: (string|null); + + /** + * Creates a new PartitionedColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionedColumn instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPartitionedColumn): google.cloud.bigquery.v2.PartitionedColumn; + + /** + * Encodes the specified PartitionedColumn message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionedColumn.verify|verify} messages. + * @param message PartitionedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPartitionedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionedColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionedColumn.verify|verify} messages. + * @param message PartitionedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPartitionedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionedColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PartitionedColumn; + + /** + * Decodes a PartitionedColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PartitionedColumn; + + /** + * Verifies a PartitionedColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PartitionedColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionedColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PartitionedColumn; + + /** + * Creates a plain object from a PartitionedColumn message. Also converts values to other types if specified. + * @param message PartitionedColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PartitionedColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionedColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionedColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AggregationThresholdPolicy. */ + interface IAggregationThresholdPolicy { + + /** AggregationThresholdPolicy threshold */ + threshold?: (number|Long|string|null); + + /** AggregationThresholdPolicy privacyUnitColumns */ + privacyUnitColumns?: (string[]|null); + } + + /** Represents an AggregationThresholdPolicy. */ + class AggregationThresholdPolicy implements IAggregationThresholdPolicy { + + /** + * Constructs a new AggregationThresholdPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IAggregationThresholdPolicy); + + /** AggregationThresholdPolicy threshold. */ + public threshold?: (number|Long|string|null); + + /** AggregationThresholdPolicy privacyUnitColumns. */ + public privacyUnitColumns: string[]; + + /** + * Creates a new AggregationThresholdPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregationThresholdPolicy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IAggregationThresholdPolicy): google.cloud.bigquery.v2.AggregationThresholdPolicy; + + /** + * Encodes the specified AggregationThresholdPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.AggregationThresholdPolicy.verify|verify} messages. + * @param message AggregationThresholdPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IAggregationThresholdPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregationThresholdPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.AggregationThresholdPolicy.verify|verify} messages. + * @param message AggregationThresholdPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IAggregationThresholdPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregationThresholdPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregationThresholdPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.AggregationThresholdPolicy; + + /** + * Decodes an AggregationThresholdPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregationThresholdPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.AggregationThresholdPolicy; + + /** + * Verifies an AggregationThresholdPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregationThresholdPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregationThresholdPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.AggregationThresholdPolicy; + + /** + * Creates a plain object from an AggregationThresholdPolicy message. Also converts values to other types if specified. + * @param message AggregationThresholdPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.AggregationThresholdPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregationThresholdPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregationThresholdPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DifferentialPrivacyPolicy. */ + interface IDifferentialPrivacyPolicy { + + /** DifferentialPrivacyPolicy maxEpsilonPerQuery */ + maxEpsilonPerQuery?: (number|null); + + /** DifferentialPrivacyPolicy deltaPerQuery */ + deltaPerQuery?: (number|null); + + /** DifferentialPrivacyPolicy maxGroupsContributed */ + maxGroupsContributed?: (number|Long|string|null); + + /** DifferentialPrivacyPolicy privacyUnitColumn */ + privacyUnitColumn?: (string|null); + + /** DifferentialPrivacyPolicy epsilonBudget */ + epsilonBudget?: (number|null); + + /** DifferentialPrivacyPolicy deltaBudget */ + deltaBudget?: (number|null); + + /** DifferentialPrivacyPolicy epsilonBudgetRemaining */ + epsilonBudgetRemaining?: (number|null); + + /** DifferentialPrivacyPolicy deltaBudgetRemaining */ + deltaBudgetRemaining?: (number|null); + } + + /** Represents a DifferentialPrivacyPolicy. */ + class DifferentialPrivacyPolicy implements IDifferentialPrivacyPolicy { + + /** + * Constructs a new DifferentialPrivacyPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDifferentialPrivacyPolicy); + + /** DifferentialPrivacyPolicy maxEpsilonPerQuery. */ + public maxEpsilonPerQuery?: (number|null); + + /** DifferentialPrivacyPolicy deltaPerQuery. */ + public deltaPerQuery?: (number|null); + + /** DifferentialPrivacyPolicy maxGroupsContributed. */ + public maxGroupsContributed?: (number|Long|string|null); + + /** DifferentialPrivacyPolicy privacyUnitColumn. */ + public privacyUnitColumn?: (string|null); + + /** DifferentialPrivacyPolicy epsilonBudget. */ + public epsilonBudget?: (number|null); + + /** DifferentialPrivacyPolicy deltaBudget. */ + public deltaBudget?: (number|null); + + /** DifferentialPrivacyPolicy epsilonBudgetRemaining. */ + public epsilonBudgetRemaining?: (number|null); + + /** DifferentialPrivacyPolicy deltaBudgetRemaining. */ + public deltaBudgetRemaining?: (number|null); + + /** + * Creates a new DifferentialPrivacyPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DifferentialPrivacyPolicy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDifferentialPrivacyPolicy): google.cloud.bigquery.v2.DifferentialPrivacyPolicy; + + /** + * Encodes the specified DifferentialPrivacyPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.DifferentialPrivacyPolicy.verify|verify} messages. + * @param message DifferentialPrivacyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDifferentialPrivacyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DifferentialPrivacyPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DifferentialPrivacyPolicy.verify|verify} messages. + * @param message DifferentialPrivacyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDifferentialPrivacyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DifferentialPrivacyPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DifferentialPrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DifferentialPrivacyPolicy; + + /** + * Decodes a DifferentialPrivacyPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DifferentialPrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DifferentialPrivacyPolicy; + + /** + * Verifies a DifferentialPrivacyPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DifferentialPrivacyPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DifferentialPrivacyPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DifferentialPrivacyPolicy; + + /** + * Creates a plain object from a DifferentialPrivacyPolicy message. Also converts values to other types if specified. + * @param message DifferentialPrivacyPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DifferentialPrivacyPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DifferentialPrivacyPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DifferentialPrivacyPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JoinRestrictionPolicy. */ + interface IJoinRestrictionPolicy { + + /** JoinRestrictionPolicy joinCondition */ + joinCondition?: (google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|keyof typeof google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|null); + + /** JoinRestrictionPolicy joinAllowedColumns */ + joinAllowedColumns?: (string[]|null); + } + + /** Represents a JoinRestrictionPolicy. */ + class JoinRestrictionPolicy implements IJoinRestrictionPolicy { + + /** + * Constructs a new JoinRestrictionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IJoinRestrictionPolicy); + + /** JoinRestrictionPolicy joinCondition. */ + public joinCondition?: (google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|keyof typeof google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|null); + + /** JoinRestrictionPolicy joinAllowedColumns. */ + public joinAllowedColumns: string[]; + + /** + * Creates a new JoinRestrictionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns JoinRestrictionPolicy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IJoinRestrictionPolicy): google.cloud.bigquery.v2.JoinRestrictionPolicy; + + /** + * Encodes the specified JoinRestrictionPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.JoinRestrictionPolicy.verify|verify} messages. + * @param message JoinRestrictionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IJoinRestrictionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JoinRestrictionPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JoinRestrictionPolicy.verify|verify} messages. + * @param message JoinRestrictionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IJoinRestrictionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JoinRestrictionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JoinRestrictionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.JoinRestrictionPolicy; + + /** + * Decodes a JoinRestrictionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JoinRestrictionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.JoinRestrictionPolicy; + + /** + * Verifies a JoinRestrictionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JoinRestrictionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JoinRestrictionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.JoinRestrictionPolicy; + + /** + * Creates a plain object from a JoinRestrictionPolicy message. Also converts values to other types if specified. + * @param message JoinRestrictionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.JoinRestrictionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JoinRestrictionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JoinRestrictionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JoinRestrictionPolicy { + + /** JoinCondition enum. */ + enum JoinCondition { + JOIN_CONDITION_UNSPECIFIED = 0, + JOIN_ANY = 1, + JOIN_ALL = 2, + JOIN_NOT_REQUIRED = 3, + JOIN_BLOCKED = 4 + } + } + + /** Properties of a PrivacyPolicy. */ + interface IPrivacyPolicy { + + /** PrivacyPolicy aggregationThresholdPolicy */ + aggregationThresholdPolicy?: (google.cloud.bigquery.v2.IAggregationThresholdPolicy|null); + + /** PrivacyPolicy differentialPrivacyPolicy */ + differentialPrivacyPolicy?: (google.cloud.bigquery.v2.IDifferentialPrivacyPolicy|null); + + /** PrivacyPolicy joinRestrictionPolicy */ + joinRestrictionPolicy?: (google.cloud.bigquery.v2.IJoinRestrictionPolicy|null); + } + + /** Represents a PrivacyPolicy. */ + class PrivacyPolicy implements IPrivacyPolicy { + + /** + * Constructs a new PrivacyPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPrivacyPolicy); + + /** PrivacyPolicy aggregationThresholdPolicy. */ + public aggregationThresholdPolicy?: (google.cloud.bigquery.v2.IAggregationThresholdPolicy|null); + + /** PrivacyPolicy differentialPrivacyPolicy. */ + public differentialPrivacyPolicy?: (google.cloud.bigquery.v2.IDifferentialPrivacyPolicy|null); + + /** PrivacyPolicy joinRestrictionPolicy. */ + public joinRestrictionPolicy?: (google.cloud.bigquery.v2.IJoinRestrictionPolicy|null); + + /** PrivacyPolicy privacyPolicy. */ + public privacyPolicy?: ("aggregationThresholdPolicy"|"differentialPrivacyPolicy"); + + /** + * Creates a new PrivacyPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivacyPolicy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPrivacyPolicy): google.cloud.bigquery.v2.PrivacyPolicy; + + /** + * Encodes the specified PrivacyPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.PrivacyPolicy.verify|verify} messages. + * @param message PrivacyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPrivacyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivacyPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PrivacyPolicy.verify|verify} messages. + * @param message PrivacyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPrivacyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivacyPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PrivacyPolicy; + + /** + * Decodes a PrivacyPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PrivacyPolicy; + + /** + * Verifies a PrivacyPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivacyPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivacyPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PrivacyPolicy; + + /** + * Creates a plain object from a PrivacyPolicy message. Also converts values to other types if specified. + * @param message PrivacyPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PrivacyPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivacyPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivacyPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ProjectService */ + class ProjectService extends $protobuf.rpc.Service { + + /** + * Constructs a new ProjectService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ProjectService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProjectService; + + /** + * Calls GetServiceAccount. + * @param request GetServiceAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetServiceAccountResponse + */ + public getServiceAccount(request: google.cloud.bigquery.v2.IGetServiceAccountRequest, callback: google.cloud.bigquery.v2.ProjectService.GetServiceAccountCallback): void; + + /** + * Calls GetServiceAccount. + * @param request GetServiceAccountRequest message or plain object + * @returns Promise + */ + public getServiceAccount(request: google.cloud.bigquery.v2.IGetServiceAccountRequest): Promise; + } + + namespace ProjectService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ProjectService|getServiceAccount}. + * @param error Error, if any + * @param [response] GetServiceAccountResponse + */ + type GetServiceAccountCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.GetServiceAccountResponse) => void; + } + + /** Properties of a GetServiceAccountRequest. */ + interface IGetServiceAccountRequest { + + /** GetServiceAccountRequest projectId */ + projectId?: (string|null); + } + + /** Represents a GetServiceAccountRequest. */ + class GetServiceAccountRequest implements IGetServiceAccountRequest { + + /** + * Constructs a new GetServiceAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetServiceAccountRequest); + + /** GetServiceAccountRequest projectId. */ + public projectId: string; + + /** + * Creates a new GetServiceAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceAccountRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetServiceAccountRequest): google.cloud.bigquery.v2.GetServiceAccountRequest; + + /** + * Encodes the specified GetServiceAccountRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountRequest.verify|verify} messages. + * @param message GetServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceAccountRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountRequest.verify|verify} messages. + * @param message GetServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetServiceAccountRequest; + + /** + * Decodes a GetServiceAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetServiceAccountRequest; + + /** + * Verifies a GetServiceAccountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetServiceAccountRequest; + + /** + * Creates a plain object from a GetServiceAccountRequest message. Also converts values to other types if specified. + * @param message GetServiceAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetServiceAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceAccountResponse. */ + interface IGetServiceAccountResponse { + + /** GetServiceAccountResponse kind */ + kind?: (string|null); + + /** GetServiceAccountResponse email */ + email?: (string|null); + } + + /** Represents a GetServiceAccountResponse. */ + class GetServiceAccountResponse implements IGetServiceAccountResponse { + + /** + * Constructs a new GetServiceAccountResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetServiceAccountResponse); + + /** GetServiceAccountResponse kind. */ + public kind: string; + + /** GetServiceAccountResponse email. */ + public email: string; + + /** + * Creates a new GetServiceAccountResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceAccountResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetServiceAccountResponse): google.cloud.bigquery.v2.GetServiceAccountResponse; + + /** + * Encodes the specified GetServiceAccountResponse message. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountResponse.verify|verify} messages. + * @param message GetServiceAccountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetServiceAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceAccountResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountResponse.verify|verify} messages. + * @param message GetServiceAccountResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetServiceAccountResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceAccountResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetServiceAccountResponse; + + /** + * Decodes a GetServiceAccountResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetServiceAccountResponse; + + /** + * Verifies a GetServiceAccountResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceAccountResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceAccountResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetServiceAccountResponse; + + /** + * Creates a plain object from a GetServiceAccountResponse message. Also converts values to other types if specified. + * @param message GetServiceAccountResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetServiceAccountResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceAccountResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceAccountResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RoutineService */ + class RoutineService extends $protobuf.rpc.Service { + + /** + * Constructs a new RoutineService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new RoutineService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): RoutineService; + + /** + * Calls GetRoutine. + * @param request GetRoutineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Routine + */ + public getRoutine(request: google.cloud.bigquery.v2.IGetRoutineRequest, callback: google.cloud.bigquery.v2.RoutineService.GetRoutineCallback): void; + + /** + * Calls GetRoutine. + * @param request GetRoutineRequest message or plain object + * @returns Promise + */ + public getRoutine(request: google.cloud.bigquery.v2.IGetRoutineRequest): Promise; + + /** + * Calls InsertRoutine. + * @param request InsertRoutineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Routine + */ + public insertRoutine(request: google.cloud.bigquery.v2.IInsertRoutineRequest, callback: google.cloud.bigquery.v2.RoutineService.InsertRoutineCallback): void; + + /** + * Calls InsertRoutine. + * @param request InsertRoutineRequest message or plain object + * @returns Promise + */ + public insertRoutine(request: google.cloud.bigquery.v2.IInsertRoutineRequest): Promise; + + /** + * Calls UpdateRoutine. + * @param request UpdateRoutineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Routine + */ + public updateRoutine(request: google.cloud.bigquery.v2.IUpdateRoutineRequest, callback: google.cloud.bigquery.v2.RoutineService.UpdateRoutineCallback): void; + + /** + * Calls UpdateRoutine. + * @param request UpdateRoutineRequest message or plain object + * @returns Promise + */ + public updateRoutine(request: google.cloud.bigquery.v2.IUpdateRoutineRequest): Promise; + + /** + * Calls DeleteRoutine. + * @param request DeleteRoutineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRoutine(request: google.cloud.bigquery.v2.IDeleteRoutineRequest, callback: google.cloud.bigquery.v2.RoutineService.DeleteRoutineCallback): void; + + /** + * Calls DeleteRoutine. + * @param request DeleteRoutineRequest message or plain object + * @returns Promise + */ + public deleteRoutine(request: google.cloud.bigquery.v2.IDeleteRoutineRequest): Promise; + + /** + * Calls ListRoutines. + * @param request ListRoutinesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRoutinesResponse + */ + public listRoutines(request: google.cloud.bigquery.v2.IListRoutinesRequest, callback: google.cloud.bigquery.v2.RoutineService.ListRoutinesCallback): void; + + /** + * Calls ListRoutines. + * @param request ListRoutinesRequest message or plain object + * @returns Promise + */ + public listRoutines(request: google.cloud.bigquery.v2.IListRoutinesRequest): Promise; + } + + namespace RoutineService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|getRoutine}. + * @param error Error, if any + * @param [response] Routine + */ + type GetRoutineCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Routine) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|insertRoutine}. + * @param error Error, if any + * @param [response] Routine + */ + type InsertRoutineCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Routine) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|updateRoutine}. + * @param error Error, if any + * @param [response] Routine + */ + type UpdateRoutineCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Routine) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|deleteRoutine}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRoutineCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|listRoutines}. + * @param error Error, if any + * @param [response] ListRoutinesResponse + */ + type ListRoutinesCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.ListRoutinesResponse) => void; + } + + /** Properties of a Routine. */ + interface IRoutine { + + /** Routine etag */ + etag?: (string|null); + + /** Routine routineReference */ + routineReference?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** Routine routineType */ + routineType?: (google.cloud.bigquery.v2.Routine.RoutineType|keyof typeof google.cloud.bigquery.v2.Routine.RoutineType|null); + + /** Routine creationTime */ + creationTime?: (number|Long|string|null); + + /** Routine lastModifiedTime */ + lastModifiedTime?: (number|Long|string|null); + + /** Routine language */ + language?: (google.cloud.bigquery.v2.Routine.Language|keyof typeof google.cloud.bigquery.v2.Routine.Language|null); + + /** Routine arguments */ + "arguments"?: (google.cloud.bigquery.v2.Routine.IArgument[]|null); + + /** Routine returnType */ + returnType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** Routine returnTableType */ + returnTableType?: (google.cloud.bigquery.v2.IStandardSqlTableType|null); + + /** Routine importedLibraries */ + importedLibraries?: (string[]|null); + + /** Routine definitionBody */ + definitionBody?: (string|null); + + /** Routine description */ + description?: (string|null); + + /** Routine determinismLevel */ + determinismLevel?: (google.cloud.bigquery.v2.Routine.DeterminismLevel|keyof typeof google.cloud.bigquery.v2.Routine.DeterminismLevel|null); + + /** Routine securityMode */ + securityMode?: (google.cloud.bigquery.v2.Routine.SecurityMode|keyof typeof google.cloud.bigquery.v2.Routine.SecurityMode|null); + + /** Routine strictMode */ + strictMode?: (google.protobuf.IBoolValue|null); + + /** Routine remoteFunctionOptions */ + remoteFunctionOptions?: (google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions|null); + + /** Routine sparkOptions */ + sparkOptions?: (google.cloud.bigquery.v2.ISparkOptions|null); + + /** Routine dataGovernanceType */ + dataGovernanceType?: (google.cloud.bigquery.v2.Routine.DataGovernanceType|keyof typeof google.cloud.bigquery.v2.Routine.DataGovernanceType|null); + + /** Routine pythonOptions */ + pythonOptions?: (google.cloud.bigquery.v2.IPythonOptions|null); + + /** Routine externalRuntimeOptions */ + externalRuntimeOptions?: (google.cloud.bigquery.v2.IExternalRuntimeOptions|null); + + /** Routine buildStatus */ + buildStatus?: (google.cloud.bigquery.v2.IRoutineBuildStatus|null); + } + + /** Represents a Routine. */ + class Routine implements IRoutine { + + /** + * Constructs a new Routine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRoutine); + + /** Routine etag. */ + public etag: string; + + /** Routine routineReference. */ + public routineReference?: (google.cloud.bigquery.v2.IRoutineReference|null); + + /** Routine routineType. */ + public routineType: (google.cloud.bigquery.v2.Routine.RoutineType|keyof typeof google.cloud.bigquery.v2.Routine.RoutineType); + + /** Routine creationTime. */ + public creationTime: (number|Long|string); + + /** Routine lastModifiedTime. */ + public lastModifiedTime: (number|Long|string); + + /** Routine language. */ + public language: (google.cloud.bigquery.v2.Routine.Language|keyof typeof google.cloud.bigquery.v2.Routine.Language); + + /** Routine arguments. */ + public arguments: google.cloud.bigquery.v2.Routine.IArgument[]; + + /** Routine returnType. */ + public returnType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** Routine returnTableType. */ + public returnTableType?: (google.cloud.bigquery.v2.IStandardSqlTableType|null); + + /** Routine importedLibraries. */ + public importedLibraries: string[]; + + /** Routine definitionBody. */ + public definitionBody: string; + + /** Routine description. */ + public description: string; + + /** Routine determinismLevel. */ + public determinismLevel: (google.cloud.bigquery.v2.Routine.DeterminismLevel|keyof typeof google.cloud.bigquery.v2.Routine.DeterminismLevel); + + /** Routine securityMode. */ + public securityMode: (google.cloud.bigquery.v2.Routine.SecurityMode|keyof typeof google.cloud.bigquery.v2.Routine.SecurityMode); + + /** Routine strictMode. */ + public strictMode?: (google.protobuf.IBoolValue|null); + + /** Routine remoteFunctionOptions. */ + public remoteFunctionOptions?: (google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions|null); + + /** Routine sparkOptions. */ + public sparkOptions?: (google.cloud.bigquery.v2.ISparkOptions|null); + + /** Routine dataGovernanceType. */ + public dataGovernanceType: (google.cloud.bigquery.v2.Routine.DataGovernanceType|keyof typeof google.cloud.bigquery.v2.Routine.DataGovernanceType); + + /** Routine pythonOptions. */ + public pythonOptions?: (google.cloud.bigquery.v2.IPythonOptions|null); + + /** Routine externalRuntimeOptions. */ + public externalRuntimeOptions?: (google.cloud.bigquery.v2.IExternalRuntimeOptions|null); + + /** Routine buildStatus. */ + public buildStatus?: (google.cloud.bigquery.v2.IRoutineBuildStatus|null); + + /** + * Creates a new Routine instance using the specified properties. + * @param [properties] Properties to set + * @returns Routine instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRoutine): google.cloud.bigquery.v2.Routine; + + /** + * Encodes the specified Routine message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.verify|verify} messages. + * @param message Routine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRoutine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Routine message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.verify|verify} messages. + * @param message Routine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRoutine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Routine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Routine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Routine; + + /** + * Decodes a Routine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Routine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Routine; + + /** + * Verifies a Routine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Routine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Routine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Routine; + + /** + * Creates a plain object from a Routine message. Also converts values to other types if specified. + * @param message Routine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Routine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Routine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Routine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Routine { + + /** RoutineType enum. */ + enum RoutineType { + ROUTINE_TYPE_UNSPECIFIED = 0, + SCALAR_FUNCTION = 1, + PROCEDURE = 2, + TABLE_VALUED_FUNCTION = 3, + AGGREGATE_FUNCTION = 4 + } + + /** Language enum. */ + enum Language { + LANGUAGE_UNSPECIFIED = 0, + SQL = 1, + JAVASCRIPT = 2, + PYTHON = 3, + JAVA = 4, + SCALA = 5 + } + + /** Properties of an Argument. */ + interface IArgument { + + /** Argument name */ + name?: (string|null); + + /** Argument argumentKind */ + argumentKind?: (google.cloud.bigquery.v2.Routine.Argument.ArgumentKind|keyof typeof google.cloud.bigquery.v2.Routine.Argument.ArgumentKind|null); + + /** Argument mode */ + mode?: (google.cloud.bigquery.v2.Routine.Argument.Mode|keyof typeof google.cloud.bigquery.v2.Routine.Argument.Mode|null); + + /** Argument dataType */ + dataType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** Argument isAggregate */ + isAggregate?: (google.protobuf.IBoolValue|null); + } + + /** Represents an Argument. */ + class Argument implements IArgument { + + /** + * Constructs a new Argument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Routine.IArgument); + + /** Argument name. */ + public name: string; + + /** Argument argumentKind. */ + public argumentKind: (google.cloud.bigquery.v2.Routine.Argument.ArgumentKind|keyof typeof google.cloud.bigquery.v2.Routine.Argument.ArgumentKind); + + /** Argument mode. */ + public mode: (google.cloud.bigquery.v2.Routine.Argument.Mode|keyof typeof google.cloud.bigquery.v2.Routine.Argument.Mode); + + /** Argument dataType. */ + public dataType?: (google.cloud.bigquery.v2.IStandardSqlDataType|null); + + /** Argument isAggregate. */ + public isAggregate?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new Argument instance using the specified properties. + * @param [properties] Properties to set + * @returns Argument instance + */ + public static create(properties?: google.cloud.bigquery.v2.Routine.IArgument): google.cloud.bigquery.v2.Routine.Argument; + + /** + * Encodes the specified Argument message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.Argument.verify|verify} messages. + * @param message Argument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Routine.IArgument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Argument message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.Argument.verify|verify} messages. + * @param message Argument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Routine.IArgument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Argument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Argument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Routine.Argument; + + /** + * Decodes an Argument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Argument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Routine.Argument; + + /** + * Verifies an Argument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Argument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Argument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Routine.Argument; + + /** + * Creates a plain object from an Argument message. Also converts values to other types if specified. + * @param message Argument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Routine.Argument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Argument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Argument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Argument { + + /** ArgumentKind enum. */ + enum ArgumentKind { + ARGUMENT_KIND_UNSPECIFIED = 0, + FIXED_TYPE = 1, + ANY_TYPE = 2 + } + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + IN = 1, + OUT = 2, + INOUT = 3 + } + } + + /** DeterminismLevel enum. */ + enum DeterminismLevel { + DETERMINISM_LEVEL_UNSPECIFIED = 0, + DETERMINISTIC = 1, + NOT_DETERMINISTIC = 2 + } + + /** SecurityMode enum. */ + enum SecurityMode { + SECURITY_MODE_UNSPECIFIED = 0, + DEFINER = 1, + INVOKER = 2 + } + + /** Properties of a RemoteFunctionOptions. */ + interface IRemoteFunctionOptions { + + /** RemoteFunctionOptions endpoint */ + endpoint?: (string|null); + + /** RemoteFunctionOptions connection */ + connection?: (string|null); + + /** RemoteFunctionOptions userDefinedContext */ + userDefinedContext?: ({ [k: string]: string }|null); + + /** RemoteFunctionOptions maxBatchingRows */ + maxBatchingRows?: (number|Long|string|null); + } + + /** Represents a RemoteFunctionOptions. */ + class RemoteFunctionOptions implements IRemoteFunctionOptions { + + /** + * Constructs a new RemoteFunctionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions); + + /** RemoteFunctionOptions endpoint. */ + public endpoint: string; + + /** RemoteFunctionOptions connection. */ + public connection: string; + + /** RemoteFunctionOptions userDefinedContext. */ + public userDefinedContext: { [k: string]: string }; + + /** RemoteFunctionOptions maxBatchingRows. */ + public maxBatchingRows: (number|Long|string); + + /** + * Creates a new RemoteFunctionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoteFunctionOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions): google.cloud.bigquery.v2.Routine.RemoteFunctionOptions; + + /** + * Encodes the specified RemoteFunctionOptions message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.verify|verify} messages. + * @param message RemoteFunctionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoteFunctionOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.verify|verify} messages. + * @param message RemoteFunctionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoteFunctionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoteFunctionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Routine.RemoteFunctionOptions; + + /** + * Decodes a RemoteFunctionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoteFunctionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Routine.RemoteFunctionOptions; + + /** + * Verifies a RemoteFunctionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoteFunctionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoteFunctionOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Routine.RemoteFunctionOptions; + + /** + * Creates a plain object from a RemoteFunctionOptions message. Also converts values to other types if specified. + * @param message RemoteFunctionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Routine.RemoteFunctionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoteFunctionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoteFunctionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DataGovernanceType enum. */ + enum DataGovernanceType { + DATA_GOVERNANCE_TYPE_UNSPECIFIED = 0, + DATA_MASKING = 1 + } + } + + /** Properties of a PythonOptions. */ + interface IPythonOptions { + + /** PythonOptions entryPoint */ + entryPoint?: (string|null); + + /** PythonOptions packages */ + packages?: (string[]|null); + } + + /** Represents a PythonOptions. */ + class PythonOptions implements IPythonOptions { + + /** + * Constructs a new PythonOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPythonOptions); + + /** PythonOptions entryPoint. */ + public entryPoint: string; + + /** PythonOptions packages. */ + public packages: string[]; + + /** + * Creates a new PythonOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPythonOptions): google.cloud.bigquery.v2.PythonOptions; + + /** + * Encodes the specified PythonOptions message. Does not implicitly {@link google.cloud.bigquery.v2.PythonOptions.verify|verify} messages. + * @param message PythonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPythonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PythonOptions.verify|verify} messages. + * @param message PythonOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPythonOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PythonOptions; + + /** + * Decodes a PythonOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PythonOptions; + + /** + * Verifies a PythonOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PythonOptions; + + /** + * Creates a plain object from a PythonOptions message. Also converts values to other types if specified. + * @param message PythonOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PythonOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExternalRuntimeOptions. */ + interface IExternalRuntimeOptions { + + /** ExternalRuntimeOptions containerMemory */ + containerMemory?: (string|null); + + /** ExternalRuntimeOptions containerCpu */ + containerCpu?: (number|null); + + /** ExternalRuntimeOptions runtimeConnection */ + runtimeConnection?: (string|null); + + /** ExternalRuntimeOptions maxBatchingRows */ + maxBatchingRows?: (number|Long|string|null); + + /** ExternalRuntimeOptions runtimeVersion */ + runtimeVersion?: (string|null); + + /** ExternalRuntimeOptions containerRequestConcurrency */ + containerRequestConcurrency?: (number|Long|string|null); + } + + /** Represents an ExternalRuntimeOptions. */ + class ExternalRuntimeOptions implements IExternalRuntimeOptions { + + /** + * Constructs a new ExternalRuntimeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IExternalRuntimeOptions); + + /** ExternalRuntimeOptions containerMemory. */ + public containerMemory: string; + + /** ExternalRuntimeOptions containerCpu. */ + public containerCpu: number; + + /** ExternalRuntimeOptions runtimeConnection. */ + public runtimeConnection: string; + + /** ExternalRuntimeOptions maxBatchingRows. */ + public maxBatchingRows: (number|Long|string); + + /** ExternalRuntimeOptions runtimeVersion. */ + public runtimeVersion: string; + + /** ExternalRuntimeOptions containerRequestConcurrency. */ + public containerRequestConcurrency: (number|Long|string); + + /** + * Creates a new ExternalRuntimeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalRuntimeOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.IExternalRuntimeOptions): google.cloud.bigquery.v2.ExternalRuntimeOptions; + + /** + * Encodes the specified ExternalRuntimeOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalRuntimeOptions.verify|verify} messages. + * @param message ExternalRuntimeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IExternalRuntimeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalRuntimeOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalRuntimeOptions.verify|verify} messages. + * @param message ExternalRuntimeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IExternalRuntimeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalRuntimeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalRuntimeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ExternalRuntimeOptions; + + /** + * Decodes an ExternalRuntimeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalRuntimeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ExternalRuntimeOptions; + + /** + * Verifies an ExternalRuntimeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalRuntimeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalRuntimeOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ExternalRuntimeOptions; + + /** + * Creates a plain object from an ExternalRuntimeOptions message. Also converts values to other types if specified. + * @param message ExternalRuntimeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ExternalRuntimeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalRuntimeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalRuntimeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkOptions. */ + interface ISparkOptions { + + /** SparkOptions connection */ + connection?: (string|null); + + /** SparkOptions runtimeVersion */ + runtimeVersion?: (string|null); + + /** SparkOptions containerImage */ + containerImage?: (string|null); + + /** SparkOptions properties */ + properties?: ({ [k: string]: string }|null); + + /** SparkOptions mainFileUri */ + mainFileUri?: (string|null); + + /** SparkOptions pyFileUris */ + pyFileUris?: (string[]|null); + + /** SparkOptions jarUris */ + jarUris?: (string[]|null); + + /** SparkOptions fileUris */ + fileUris?: (string[]|null); + + /** SparkOptions archiveUris */ + archiveUris?: (string[]|null); + + /** SparkOptions mainClass */ + mainClass?: (string|null); + } + + /** Represents a SparkOptions. */ + class SparkOptions implements ISparkOptions { + + /** + * Constructs a new SparkOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISparkOptions); + + /** SparkOptions connection. */ + public connection: string; + + /** SparkOptions runtimeVersion. */ + public runtimeVersion: string; + + /** SparkOptions containerImage. */ + public containerImage: string; + + /** SparkOptions properties. */ + public properties: { [k: string]: string }; + + /** SparkOptions mainFileUri. */ + public mainFileUri: string; + + /** SparkOptions pyFileUris. */ + public pyFileUris: string[]; + + /** SparkOptions jarUris. */ + public jarUris: string[]; + + /** SparkOptions fileUris. */ + public fileUris: string[]; + + /** SparkOptions archiveUris. */ + public archiveUris: string[]; + + /** SparkOptions mainClass. */ + public mainClass: string; + + /** + * Creates a new SparkOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkOptions instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISparkOptions): google.cloud.bigquery.v2.SparkOptions; + + /** + * Encodes the specified SparkOptions message. Does not implicitly {@link google.cloud.bigquery.v2.SparkOptions.verify|verify} messages. + * @param message SparkOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISparkOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkOptions.verify|verify} messages. + * @param message SparkOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISparkOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SparkOptions; + + /** + * Decodes a SparkOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SparkOptions; + + /** + * Verifies a SparkOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SparkOptions; + + /** + * Creates a plain object from a SparkOptions message. Also converts values to other types if specified. + * @param message SparkOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SparkOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutineBuildStatus. */ + interface IRoutineBuildStatus { + + /** RoutineBuildStatus buildState */ + buildState?: (google.cloud.bigquery.v2.RoutineBuildStatus.BuildState|keyof typeof google.cloud.bigquery.v2.RoutineBuildStatus.BuildState|null); + + /** RoutineBuildStatus errorResult */ + errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** RoutineBuildStatus buildStateUpdateTime */ + buildStateUpdateTime?: (google.protobuf.ITimestamp|null); + + /** RoutineBuildStatus buildDuration */ + buildDuration?: (google.protobuf.IDuration|null); + + /** RoutineBuildStatus imageSizeBytes */ + imageSizeBytes?: (number|Long|string|null); + } + + /** Represents a RoutineBuildStatus. */ + class RoutineBuildStatus implements IRoutineBuildStatus { + + /** + * Constructs a new RoutineBuildStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRoutineBuildStatus); + + /** RoutineBuildStatus buildState. */ + public buildState: (google.cloud.bigquery.v2.RoutineBuildStatus.BuildState|keyof typeof google.cloud.bigquery.v2.RoutineBuildStatus.BuildState); + + /** RoutineBuildStatus errorResult. */ + public errorResult?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** RoutineBuildStatus buildStateUpdateTime. */ + public buildStateUpdateTime?: (google.protobuf.ITimestamp|null); + + /** RoutineBuildStatus buildDuration. */ + public buildDuration?: (google.protobuf.IDuration|null); + + /** RoutineBuildStatus imageSizeBytes. */ + public imageSizeBytes: (number|Long|string); + + /** + * Creates a new RoutineBuildStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutineBuildStatus instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRoutineBuildStatus): google.cloud.bigquery.v2.RoutineBuildStatus; + + /** + * Encodes the specified RoutineBuildStatus message. Does not implicitly {@link google.cloud.bigquery.v2.RoutineBuildStatus.verify|verify} messages. + * @param message RoutineBuildStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRoutineBuildStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutineBuildStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RoutineBuildStatus.verify|verify} messages. + * @param message RoutineBuildStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRoutineBuildStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutineBuildStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutineBuildStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RoutineBuildStatus; + + /** + * Decodes a RoutineBuildStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutineBuildStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RoutineBuildStatus; + + /** + * Verifies a RoutineBuildStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutineBuildStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutineBuildStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RoutineBuildStatus; + + /** + * Creates a plain object from a RoutineBuildStatus message. Also converts values to other types if specified. + * @param message RoutineBuildStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RoutineBuildStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutineBuildStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutineBuildStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoutineBuildStatus { + + /** BuildState enum. */ + enum BuildState { + BUILD_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + SUCCEEDED = 2, + FAILED = 3 + } + } + + /** Properties of a GetRoutineRequest. */ + interface IGetRoutineRequest { + + /** GetRoutineRequest projectId */ + projectId?: (string|null); + + /** GetRoutineRequest datasetId */ + datasetId?: (string|null); + + /** GetRoutineRequest routineId */ + routineId?: (string|null); + } + + /** Represents a GetRoutineRequest. */ + class GetRoutineRequest implements IGetRoutineRequest { + + /** + * Constructs a new GetRoutineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetRoutineRequest); + + /** GetRoutineRequest projectId. */ + public projectId: string; + + /** GetRoutineRequest datasetId. */ + public datasetId: string; + + /** GetRoutineRequest routineId. */ + public routineId: string; + + /** + * Creates a new GetRoutineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRoutineRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetRoutineRequest): google.cloud.bigquery.v2.GetRoutineRequest; + + /** + * Encodes the specified GetRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetRoutineRequest.verify|verify} messages. + * @param message GetRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetRoutineRequest.verify|verify} messages. + * @param message GetRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRoutineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetRoutineRequest; + + /** + * Decodes a GetRoutineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetRoutineRequest; + + /** + * Verifies a GetRoutineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRoutineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetRoutineRequest; + + /** + * Creates a plain object from a GetRoutineRequest message. Also converts values to other types if specified. + * @param message GetRoutineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetRoutineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRoutineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRoutineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InsertRoutineRequest. */ + interface IInsertRoutineRequest { + + /** InsertRoutineRequest projectId */ + projectId?: (string|null); + + /** InsertRoutineRequest datasetId */ + datasetId?: (string|null); + + /** InsertRoutineRequest routine */ + routine?: (google.cloud.bigquery.v2.IRoutine|null); + } + + /** Represents an InsertRoutineRequest. */ + class InsertRoutineRequest implements IInsertRoutineRequest { + + /** + * Constructs a new InsertRoutineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IInsertRoutineRequest); + + /** InsertRoutineRequest projectId. */ + public projectId: string; + + /** InsertRoutineRequest datasetId. */ + public datasetId: string; + + /** InsertRoutineRequest routine. */ + public routine?: (google.cloud.bigquery.v2.IRoutine|null); + + /** + * Creates a new InsertRoutineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRoutineRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IInsertRoutineRequest): google.cloud.bigquery.v2.InsertRoutineRequest; + + /** + * Encodes the specified InsertRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertRoutineRequest.verify|verify} messages. + * @param message InsertRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IInsertRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertRoutineRequest.verify|verify} messages. + * @param message InsertRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IInsertRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRoutineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.InsertRoutineRequest; + + /** + * Decodes an InsertRoutineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.InsertRoutineRequest; + + /** + * Verifies an InsertRoutineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRoutineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.InsertRoutineRequest; + + /** + * Creates a plain object from an InsertRoutineRequest message. Also converts values to other types if specified. + * @param message InsertRoutineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.InsertRoutineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRoutineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertRoutineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRoutineRequest. */ + interface IUpdateRoutineRequest { + + /** UpdateRoutineRequest projectId */ + projectId?: (string|null); + + /** UpdateRoutineRequest datasetId */ + datasetId?: (string|null); + + /** UpdateRoutineRequest routineId */ + routineId?: (string|null); + + /** UpdateRoutineRequest routine */ + routine?: (google.cloud.bigquery.v2.IRoutine|null); + } + + /** Represents an UpdateRoutineRequest. */ + class UpdateRoutineRequest implements IUpdateRoutineRequest { + + /** + * Constructs a new UpdateRoutineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUpdateRoutineRequest); + + /** UpdateRoutineRequest projectId. */ + public projectId: string; + + /** UpdateRoutineRequest datasetId. */ + public datasetId: string; + + /** UpdateRoutineRequest routineId. */ + public routineId: string; + + /** UpdateRoutineRequest routine. */ + public routine?: (google.cloud.bigquery.v2.IRoutine|null); + + /** + * Creates a new UpdateRoutineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRoutineRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUpdateRoutineRequest): google.cloud.bigquery.v2.UpdateRoutineRequest; + + /** + * Encodes the specified UpdateRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRoutineRequest.verify|verify} messages. + * @param message UpdateRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUpdateRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRoutineRequest.verify|verify} messages. + * @param message UpdateRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUpdateRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRoutineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UpdateRoutineRequest; + + /** + * Decodes an UpdateRoutineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UpdateRoutineRequest; + + /** + * Verifies an UpdateRoutineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRoutineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UpdateRoutineRequest; + + /** + * Creates a plain object from an UpdateRoutineRequest message. Also converts values to other types if specified. + * @param message UpdateRoutineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UpdateRoutineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRoutineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRoutineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRoutineRequest. */ + interface IDeleteRoutineRequest { + + /** DeleteRoutineRequest projectId */ + projectId?: (string|null); + + /** DeleteRoutineRequest datasetId */ + datasetId?: (string|null); + + /** DeleteRoutineRequest routineId */ + routineId?: (string|null); + } + + /** Represents a DeleteRoutineRequest. */ + class DeleteRoutineRequest implements IDeleteRoutineRequest { + + /** + * Constructs a new DeleteRoutineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteRoutineRequest); + + /** DeleteRoutineRequest projectId. */ + public projectId: string; + + /** DeleteRoutineRequest datasetId. */ + public datasetId: string; + + /** DeleteRoutineRequest routineId. */ + public routineId: string; + + /** + * Creates a new DeleteRoutineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRoutineRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteRoutineRequest): google.cloud.bigquery.v2.DeleteRoutineRequest; + + /** + * Encodes the specified DeleteRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRoutineRequest.verify|verify} messages. + * @param message DeleteRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRoutineRequest.verify|verify} messages. + * @param message DeleteRoutineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteRoutineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRoutineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteRoutineRequest; + + /** + * Decodes a DeleteRoutineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteRoutineRequest; + + /** + * Verifies a DeleteRoutineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRoutineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteRoutineRequest; + + /** + * Creates a plain object from a DeleteRoutineRequest message. Also converts values to other types if specified. + * @param message DeleteRoutineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteRoutineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRoutineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRoutineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRoutinesRequest. */ + interface IListRoutinesRequest { + + /** ListRoutinesRequest projectId */ + projectId?: (string|null); + + /** ListRoutinesRequest datasetId */ + datasetId?: (string|null); + + /** ListRoutinesRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListRoutinesRequest pageToken */ + pageToken?: (string|null); + + /** ListRoutinesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRoutinesRequest. */ + class ListRoutinesRequest implements IListRoutinesRequest { + + /** + * Constructs a new ListRoutinesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListRoutinesRequest); + + /** ListRoutinesRequest projectId. */ + public projectId: string; + + /** ListRoutinesRequest datasetId. */ + public datasetId: string; + + /** ListRoutinesRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListRoutinesRequest pageToken. */ + public pageToken: string; + + /** ListRoutinesRequest filter. */ + public filter: string; + + /** + * Creates a new ListRoutinesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutinesRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListRoutinesRequest): google.cloud.bigquery.v2.ListRoutinesRequest; + + /** + * Encodes the specified ListRoutinesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesRequest.verify|verify} messages. + * @param message ListRoutinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListRoutinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutinesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesRequest.verify|verify} messages. + * @param message ListRoutinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListRoutinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutinesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListRoutinesRequest; + + /** + * Decodes a ListRoutinesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListRoutinesRequest; + + /** + * Verifies a ListRoutinesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRoutinesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutinesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListRoutinesRequest; + + /** + * Creates a plain object from a ListRoutinesRequest message. Also converts values to other types if specified. + * @param message ListRoutinesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListRoutinesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutinesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRoutinesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRoutinesResponse. */ + interface IListRoutinesResponse { + + /** ListRoutinesResponse routines */ + routines?: (google.cloud.bigquery.v2.IRoutine[]|null); + + /** ListRoutinesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRoutinesResponse. */ + class ListRoutinesResponse implements IListRoutinesResponse { + + /** + * Constructs a new ListRoutinesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListRoutinesResponse); + + /** ListRoutinesResponse routines. */ + public routines: google.cloud.bigquery.v2.IRoutine[]; + + /** ListRoutinesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRoutinesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutinesResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListRoutinesResponse): google.cloud.bigquery.v2.ListRoutinesResponse; + + /** + * Encodes the specified ListRoutinesResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesResponse.verify|verify} messages. + * @param message ListRoutinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListRoutinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutinesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesResponse.verify|verify} messages. + * @param message ListRoutinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListRoutinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutinesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListRoutinesResponse; + + /** + * Decodes a ListRoutinesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListRoutinesResponse; + + /** + * Verifies a ListRoutinesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRoutinesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutinesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListRoutinesResponse; + + /** + * Creates a plain object from a ListRoutinesResponse message. Also converts values to other types if specified. + * @param message ListRoutinesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListRoutinesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutinesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRoutinesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RowAccessPolicyService */ + class RowAccessPolicyService extends $protobuf.rpc.Service { + + /** + * Constructs a new RowAccessPolicyService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new RowAccessPolicyService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): RowAccessPolicyService; + + /** + * Calls ListRowAccessPolicies. + * @param request ListRowAccessPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRowAccessPoliciesResponse + */ + public listRowAccessPolicies(request: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.ListRowAccessPoliciesCallback): void; + + /** + * Calls ListRowAccessPolicies. + * @param request ListRowAccessPoliciesRequest message or plain object + * @returns Promise + */ + public listRowAccessPolicies(request: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest): Promise; + + /** + * Calls GetRowAccessPolicy. + * @param request GetRowAccessPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowAccessPolicy + */ + public getRowAccessPolicy(request: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.GetRowAccessPolicyCallback): void; + + /** + * Calls GetRowAccessPolicy. + * @param request GetRowAccessPolicyRequest message or plain object + * @returns Promise + */ + public getRowAccessPolicy(request: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest): Promise; + + /** + * Calls CreateRowAccessPolicy. + * @param request CreateRowAccessPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowAccessPolicy + */ + public createRowAccessPolicy(request: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.CreateRowAccessPolicyCallback): void; + + /** + * Calls CreateRowAccessPolicy. + * @param request CreateRowAccessPolicyRequest message or plain object + * @returns Promise + */ + public createRowAccessPolicy(request: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest): Promise; + + /** + * Calls UpdateRowAccessPolicy. + * @param request UpdateRowAccessPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RowAccessPolicy + */ + public updateRowAccessPolicy(request: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.UpdateRowAccessPolicyCallback): void; + + /** + * Calls UpdateRowAccessPolicy. + * @param request UpdateRowAccessPolicyRequest message or plain object + * @returns Promise + */ + public updateRowAccessPolicy(request: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest): Promise; + + /** + * Calls DeleteRowAccessPolicy. + * @param request DeleteRowAccessPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRowAccessPolicy(request: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.DeleteRowAccessPolicyCallback): void; + + /** + * Calls DeleteRowAccessPolicy. + * @param request DeleteRowAccessPolicyRequest message or plain object + * @returns Promise + */ + public deleteRowAccessPolicy(request: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest): Promise; + + /** + * Calls BatchDeleteRowAccessPolicies. + * @param request BatchDeleteRowAccessPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public batchDeleteRowAccessPolicies(request: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, callback: google.cloud.bigquery.v2.RowAccessPolicyService.BatchDeleteRowAccessPoliciesCallback): void; + + /** + * Calls BatchDeleteRowAccessPolicies. + * @param request BatchDeleteRowAccessPoliciesRequest message or plain object + * @returns Promise + */ + public batchDeleteRowAccessPolicies(request: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest): Promise; + } + + namespace RowAccessPolicyService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|listRowAccessPolicies}. + * @param error Error, if any + * @param [response] ListRowAccessPoliciesResponse + */ + type ListRowAccessPoliciesCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.ListRowAccessPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|getRowAccessPolicy}. + * @param error Error, if any + * @param [response] RowAccessPolicy + */ + type GetRowAccessPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.RowAccessPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|createRowAccessPolicy}. + * @param error Error, if any + * @param [response] RowAccessPolicy + */ + type CreateRowAccessPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.RowAccessPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|updateRowAccessPolicy}. + * @param error Error, if any + * @param [response] RowAccessPolicy + */ + type UpdateRowAccessPolicyCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.RowAccessPolicy) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|deleteRowAccessPolicy}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRowAccessPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|batchDeleteRowAccessPolicies}. + * @param error Error, if any + * @param [response] Empty + */ + type BatchDeleteRowAccessPoliciesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListRowAccessPoliciesRequest. */ + interface IListRowAccessPoliciesRequest { + + /** ListRowAccessPoliciesRequest projectId */ + projectId?: (string|null); + + /** ListRowAccessPoliciesRequest datasetId */ + datasetId?: (string|null); + + /** ListRowAccessPoliciesRequest tableId */ + tableId?: (string|null); + + /** ListRowAccessPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListRowAccessPoliciesRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListRowAccessPoliciesRequest. */ + class ListRowAccessPoliciesRequest implements IListRowAccessPoliciesRequest { + + /** + * Constructs a new ListRowAccessPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest); + + /** ListRowAccessPoliciesRequest projectId. */ + public projectId: string; + + /** ListRowAccessPoliciesRequest datasetId. */ + public datasetId: string; + + /** ListRowAccessPoliciesRequest tableId. */ + public tableId: string; + + /** ListRowAccessPoliciesRequest pageToken. */ + public pageToken: string; + + /** ListRowAccessPoliciesRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListRowAccessPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRowAccessPoliciesRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest): google.cloud.bigquery.v2.ListRowAccessPoliciesRequest; + + /** + * Encodes the specified ListRowAccessPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesRequest.verify|verify} messages. + * @param message ListRowAccessPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRowAccessPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesRequest.verify|verify} messages. + * @param message ListRowAccessPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRowAccessPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListRowAccessPoliciesRequest; + + /** + * Decodes a ListRowAccessPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListRowAccessPoliciesRequest; + + /** + * Verifies a ListRowAccessPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRowAccessPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRowAccessPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListRowAccessPoliciesRequest; + + /** + * Creates a plain object from a ListRowAccessPoliciesRequest message. Also converts values to other types if specified. + * @param message ListRowAccessPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListRowAccessPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRowAccessPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRowAccessPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRowAccessPoliciesResponse. */ + interface IListRowAccessPoliciesResponse { + + /** ListRowAccessPoliciesResponse rowAccessPolicies */ + rowAccessPolicies?: (google.cloud.bigquery.v2.IRowAccessPolicy[]|null); + + /** ListRowAccessPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRowAccessPoliciesResponse. */ + class ListRowAccessPoliciesResponse implements IListRowAccessPoliciesResponse { + + /** + * Constructs a new ListRowAccessPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListRowAccessPoliciesResponse); + + /** ListRowAccessPoliciesResponse rowAccessPolicies. */ + public rowAccessPolicies: google.cloud.bigquery.v2.IRowAccessPolicy[]; + + /** ListRowAccessPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRowAccessPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRowAccessPoliciesResponse instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListRowAccessPoliciesResponse): google.cloud.bigquery.v2.ListRowAccessPoliciesResponse; + + /** + * Encodes the specified ListRowAccessPoliciesResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.verify|verify} messages. + * @param message ListRowAccessPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListRowAccessPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRowAccessPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.verify|verify} messages. + * @param message ListRowAccessPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListRowAccessPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRowAccessPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRowAccessPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListRowAccessPoliciesResponse; + + /** + * Decodes a ListRowAccessPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRowAccessPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListRowAccessPoliciesResponse; + + /** + * Verifies a ListRowAccessPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRowAccessPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRowAccessPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListRowAccessPoliciesResponse; + + /** + * Creates a plain object from a ListRowAccessPoliciesResponse message. Also converts values to other types if specified. + * @param message ListRowAccessPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListRowAccessPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRowAccessPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRowAccessPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRowAccessPolicyRequest. */ + interface IGetRowAccessPolicyRequest { + + /** GetRowAccessPolicyRequest projectId */ + projectId?: (string|null); + + /** GetRowAccessPolicyRequest datasetId */ + datasetId?: (string|null); + + /** GetRowAccessPolicyRequest tableId */ + tableId?: (string|null); + + /** GetRowAccessPolicyRequest policyId */ + policyId?: (string|null); + } + + /** Represents a GetRowAccessPolicyRequest. */ + class GetRowAccessPolicyRequest implements IGetRowAccessPolicyRequest { + + /** + * Constructs a new GetRowAccessPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest); + + /** GetRowAccessPolicyRequest projectId. */ + public projectId: string; + + /** GetRowAccessPolicyRequest datasetId. */ + public datasetId: string; + + /** GetRowAccessPolicyRequest tableId. */ + public tableId: string; + + /** GetRowAccessPolicyRequest policyId. */ + public policyId: string; + + /** + * Creates a new GetRowAccessPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRowAccessPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest): google.cloud.bigquery.v2.GetRowAccessPolicyRequest; + + /** + * Encodes the specified GetRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetRowAccessPolicyRequest.verify|verify} messages. + * @param message GetRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetRowAccessPolicyRequest.verify|verify} messages. + * @param message GetRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRowAccessPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetRowAccessPolicyRequest; + + /** + * Decodes a GetRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetRowAccessPolicyRequest; + + /** + * Verifies a GetRowAccessPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRowAccessPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetRowAccessPolicyRequest; + + /** + * Creates a plain object from a GetRowAccessPolicyRequest message. Also converts values to other types if specified. + * @param message GetRowAccessPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetRowAccessPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRowAccessPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRowAccessPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRowAccessPolicyRequest. */ + interface ICreateRowAccessPolicyRequest { + + /** CreateRowAccessPolicyRequest projectId */ + projectId?: (string|null); + + /** CreateRowAccessPolicyRequest datasetId */ + datasetId?: (string|null); + + /** CreateRowAccessPolicyRequest tableId */ + tableId?: (string|null); + + /** CreateRowAccessPolicyRequest rowAccessPolicy */ + rowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicy|null); + } + + /** Represents a CreateRowAccessPolicyRequest. */ + class CreateRowAccessPolicyRequest implements ICreateRowAccessPolicyRequest { + + /** + * Constructs a new CreateRowAccessPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest); + + /** CreateRowAccessPolicyRequest projectId. */ + public projectId: string; + + /** CreateRowAccessPolicyRequest datasetId. */ + public datasetId: string; + + /** CreateRowAccessPolicyRequest tableId. */ + public tableId: string; + + /** CreateRowAccessPolicyRequest rowAccessPolicy. */ + public rowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicy|null); + + /** + * Creates a new CreateRowAccessPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRowAccessPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest): google.cloud.bigquery.v2.CreateRowAccessPolicyRequest; + + /** + * Encodes the specified CreateRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.CreateRowAccessPolicyRequest.verify|verify} messages. + * @param message CreateRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CreateRowAccessPolicyRequest.verify|verify} messages. + * @param message CreateRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRowAccessPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.CreateRowAccessPolicyRequest; + + /** + * Decodes a CreateRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.CreateRowAccessPolicyRequest; + + /** + * Verifies a CreateRowAccessPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRowAccessPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.CreateRowAccessPolicyRequest; + + /** + * Creates a plain object from a CreateRowAccessPolicyRequest message. Also converts values to other types if specified. + * @param message CreateRowAccessPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.CreateRowAccessPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRowAccessPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRowAccessPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRowAccessPolicyRequest. */ + interface IUpdateRowAccessPolicyRequest { + + /** UpdateRowAccessPolicyRequest projectId */ + projectId?: (string|null); + + /** UpdateRowAccessPolicyRequest datasetId */ + datasetId?: (string|null); + + /** UpdateRowAccessPolicyRequest tableId */ + tableId?: (string|null); + + /** UpdateRowAccessPolicyRequest policyId */ + policyId?: (string|null); + + /** UpdateRowAccessPolicyRequest rowAccessPolicy */ + rowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicy|null); + } + + /** Represents an UpdateRowAccessPolicyRequest. */ + class UpdateRowAccessPolicyRequest implements IUpdateRowAccessPolicyRequest { + + /** + * Constructs a new UpdateRowAccessPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest); + + /** UpdateRowAccessPolicyRequest projectId. */ + public projectId: string; + + /** UpdateRowAccessPolicyRequest datasetId. */ + public datasetId: string; + + /** UpdateRowAccessPolicyRequest tableId. */ + public tableId: string; + + /** UpdateRowAccessPolicyRequest policyId. */ + public policyId: string; + + /** UpdateRowAccessPolicyRequest rowAccessPolicy. */ + public rowAccessPolicy?: (google.cloud.bigquery.v2.IRowAccessPolicy|null); + + /** + * Creates a new UpdateRowAccessPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRowAccessPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest): google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest; + + /** + * Encodes the specified UpdateRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest.verify|verify} messages. + * @param message UpdateRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest.verify|verify} messages. + * @param message UpdateRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRowAccessPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest; + + /** + * Decodes an UpdateRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest; + + /** + * Verifies an UpdateRowAccessPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRowAccessPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest; + + /** + * Creates a plain object from an UpdateRowAccessPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateRowAccessPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRowAccessPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRowAccessPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRowAccessPolicyRequest. */ + interface IDeleteRowAccessPolicyRequest { + + /** DeleteRowAccessPolicyRequest projectId */ + projectId?: (string|null); + + /** DeleteRowAccessPolicyRequest datasetId */ + datasetId?: (string|null); + + /** DeleteRowAccessPolicyRequest tableId */ + tableId?: (string|null); + + /** DeleteRowAccessPolicyRequest policyId */ + policyId?: (string|null); + + /** DeleteRowAccessPolicyRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteRowAccessPolicyRequest. */ + class DeleteRowAccessPolicyRequest implements IDeleteRowAccessPolicyRequest { + + /** + * Constructs a new DeleteRowAccessPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest); + + /** DeleteRowAccessPolicyRequest projectId. */ + public projectId: string; + + /** DeleteRowAccessPolicyRequest datasetId. */ + public datasetId: string; + + /** DeleteRowAccessPolicyRequest tableId. */ + public tableId: string; + + /** DeleteRowAccessPolicyRequest policyId. */ + public policyId: string; + + /** DeleteRowAccessPolicyRequest force. */ + public force?: (boolean|null); + + /** + * Creates a new DeleteRowAccessPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRowAccessPolicyRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest): google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest; + + /** + * Encodes the specified DeleteRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest.verify|verify} messages. + * @param message DeleteRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest.verify|verify} messages. + * @param message DeleteRowAccessPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRowAccessPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest; + + /** + * Decodes a DeleteRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest; + + /** + * Verifies a DeleteRowAccessPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRowAccessPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest; + + /** + * Creates a plain object from a DeleteRowAccessPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteRowAccessPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRowAccessPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRowAccessPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteRowAccessPoliciesRequest. */ + interface IBatchDeleteRowAccessPoliciesRequest { + + /** BatchDeleteRowAccessPoliciesRequest projectId */ + projectId?: (string|null); + + /** BatchDeleteRowAccessPoliciesRequest datasetId */ + datasetId?: (string|null); + + /** BatchDeleteRowAccessPoliciesRequest tableId */ + tableId?: (string|null); + + /** BatchDeleteRowAccessPoliciesRequest policyIds */ + policyIds?: (string[]|null); + + /** BatchDeleteRowAccessPoliciesRequest force */ + force?: (boolean|null); + } + + /** Represents a BatchDeleteRowAccessPoliciesRequest. */ + class BatchDeleteRowAccessPoliciesRequest implements IBatchDeleteRowAccessPoliciesRequest { + + /** + * Constructs a new BatchDeleteRowAccessPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest); + + /** BatchDeleteRowAccessPoliciesRequest projectId. */ + public projectId: string; + + /** BatchDeleteRowAccessPoliciesRequest datasetId. */ + public datasetId: string; + + /** BatchDeleteRowAccessPoliciesRequest tableId. */ + public tableId: string; + + /** BatchDeleteRowAccessPoliciesRequest policyIds. */ + public policyIds: string[]; + + /** BatchDeleteRowAccessPoliciesRequest force. */ + public force?: (boolean|null); + + /** + * Creates a new BatchDeleteRowAccessPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteRowAccessPoliciesRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest): google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest; + + /** + * Encodes the specified BatchDeleteRowAccessPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest.verify|verify} messages. + * @param message BatchDeleteRowAccessPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteRowAccessPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest.verify|verify} messages. + * @param message BatchDeleteRowAccessPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteRowAccessPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest; + + /** + * Decodes a BatchDeleteRowAccessPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest; + + /** + * Verifies a BatchDeleteRowAccessPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteRowAccessPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteRowAccessPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest; + + /** + * Creates a plain object from a BatchDeleteRowAccessPoliciesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteRowAccessPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteRowAccessPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteRowAccessPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RowAccessPolicy. */ + interface IRowAccessPolicy { + + /** RowAccessPolicy etag */ + etag?: (string|null); + + /** RowAccessPolicy rowAccessPolicyReference */ + rowAccessPolicyReference?: (google.cloud.bigquery.v2.IRowAccessPolicyReference|null); + + /** RowAccessPolicy filterPredicate */ + filterPredicate?: (string|null); + + /** RowAccessPolicy creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** RowAccessPolicy lastModifiedTime */ + lastModifiedTime?: (google.protobuf.ITimestamp|null); + + /** RowAccessPolicy grantees */ + grantees?: (string[]|null); + } + + /** Represents a RowAccessPolicy. */ + class RowAccessPolicy implements IRowAccessPolicy { + + /** + * Constructs a new RowAccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IRowAccessPolicy); + + /** RowAccessPolicy etag. */ + public etag: string; + + /** RowAccessPolicy rowAccessPolicyReference. */ + public rowAccessPolicyReference?: (google.cloud.bigquery.v2.IRowAccessPolicyReference|null); + + /** RowAccessPolicy filterPredicate. */ + public filterPredicate: string; + + /** RowAccessPolicy creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** RowAccessPolicy lastModifiedTime. */ + public lastModifiedTime?: (google.protobuf.ITimestamp|null); + + /** RowAccessPolicy grantees. */ + public grantees: string[]; + + /** + * Creates a new RowAccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RowAccessPolicy instance + */ + public static create(properties?: google.cloud.bigquery.v2.IRowAccessPolicy): google.cloud.bigquery.v2.RowAccessPolicy; + + /** + * Encodes the specified RowAccessPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicy.verify|verify} messages. + * @param message RowAccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IRowAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowAccessPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicy.verify|verify} messages. + * @param message RowAccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IRowAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowAccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowAccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.RowAccessPolicy; + + /** + * Decodes a RowAccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowAccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.RowAccessPolicy; + + /** + * Verifies a RowAccessPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowAccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowAccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.RowAccessPolicy; + + /** + * Creates a plain object from a RowAccessPolicy message. Also converts values to other types if specified. + * @param message RowAccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.RowAccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowAccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowAccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TableService */ + class TableService extends $protobuf.rpc.Service { + + /** + * Constructs a new TableService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TableService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TableService; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public getTable(request: google.cloud.bigquery.v2.IGetTableRequest, callback: google.cloud.bigquery.v2.TableService.GetTableCallback): void; + + /** + * Calls GetTable. + * @param request GetTableRequest message or plain object + * @returns Promise + */ + public getTable(request: google.cloud.bigquery.v2.IGetTableRequest): Promise; + + /** + * Calls InsertTable. + * @param request InsertTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public insertTable(request: google.cloud.bigquery.v2.IInsertTableRequest, callback: google.cloud.bigquery.v2.TableService.InsertTableCallback): void; + + /** + * Calls InsertTable. + * @param request InsertTableRequest message or plain object + * @returns Promise + */ + public insertTable(request: google.cloud.bigquery.v2.IInsertTableRequest): Promise; + + /** + * Calls PatchTable. + * @param request UpdateOrPatchTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public patchTable(request: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, callback: google.cloud.bigquery.v2.TableService.PatchTableCallback): void; + + /** + * Calls PatchTable. + * @param request UpdateOrPatchTableRequest message or plain object + * @returns Promise + */ + public patchTable(request: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest): Promise; + + /** + * Calls UpdateTable. + * @param request UpdateOrPatchTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Table + */ + public updateTable(request: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, callback: google.cloud.bigquery.v2.TableService.UpdateTableCallback): void; + + /** + * Calls UpdateTable. + * @param request UpdateOrPatchTableRequest message or plain object + * @returns Promise + */ + public updateTable(request: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest): Promise; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTable(request: google.cloud.bigquery.v2.IDeleteTableRequest, callback: google.cloud.bigquery.v2.TableService.DeleteTableCallback): void; + + /** + * Calls DeleteTable. + * @param request DeleteTableRequest message or plain object + * @returns Promise + */ + public deleteTable(request: google.cloud.bigquery.v2.IDeleteTableRequest): Promise; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TableList + */ + public listTables(request: google.cloud.bigquery.v2.IListTablesRequest, callback: google.cloud.bigquery.v2.TableService.ListTablesCallback): void; + + /** + * Calls ListTables. + * @param request ListTablesRequest message or plain object + * @returns Promise + */ + public listTables(request: google.cloud.bigquery.v2.IListTablesRequest): Promise; + } + + namespace TableService { + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|getTable}. + * @param error Error, if any + * @param [response] Table + */ + type GetTableCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Table) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|insertTable}. + * @param error Error, if any + * @param [response] Table + */ + type InsertTableCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Table) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|patchTable}. + * @param error Error, if any + * @param [response] Table + */ + type PatchTableCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Table) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|updateTable}. + * @param error Error, if any + * @param [response] Table + */ + type UpdateTableCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.Table) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|deleteTable}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTableCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|listTables}. + * @param error Error, if any + * @param [response] TableList + */ + type ListTablesCallback = (error: (Error|null), response?: google.cloud.bigquery.v2.TableList) => void; + } + + /** Properties of a TableReplicationInfo. */ + interface ITableReplicationInfo { + + /** TableReplicationInfo sourceTable */ + sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableReplicationInfo replicationIntervalMs */ + replicationIntervalMs?: (number|Long|string|null); + + /** TableReplicationInfo replicatedSourceLastRefreshTime */ + replicatedSourceLastRefreshTime?: (number|Long|string|null); + + /** TableReplicationInfo replicationStatus */ + replicationStatus?: (google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus|keyof typeof google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus|null); + + /** TableReplicationInfo replicationError */ + replicationError?: (google.cloud.bigquery.v2.IErrorProto|null); + } + + /** Represents a TableReplicationInfo. */ + class TableReplicationInfo implements ITableReplicationInfo { + + /** + * Constructs a new TableReplicationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableReplicationInfo); + + /** TableReplicationInfo sourceTable. */ + public sourceTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** TableReplicationInfo replicationIntervalMs. */ + public replicationIntervalMs: (number|Long|string); + + /** TableReplicationInfo replicatedSourceLastRefreshTime. */ + public replicatedSourceLastRefreshTime: (number|Long|string); + + /** TableReplicationInfo replicationStatus. */ + public replicationStatus: (google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus|keyof typeof google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus); + + /** TableReplicationInfo replicationError. */ + public replicationError?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** + * Creates a new TableReplicationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReplicationInfo instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableReplicationInfo): google.cloud.bigquery.v2.TableReplicationInfo; + + /** + * Encodes the specified TableReplicationInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableReplicationInfo.verify|verify} messages. + * @param message TableReplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableReplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReplicationInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableReplicationInfo.verify|verify} messages. + * @param message TableReplicationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableReplicationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReplicationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableReplicationInfo; + + /** + * Decodes a TableReplicationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableReplicationInfo; + + /** + * Verifies a TableReplicationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReplicationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReplicationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableReplicationInfo; + + /** + * Creates a plain object from a TableReplicationInfo message. Also converts values to other types if specified. + * @param message TableReplicationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableReplicationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReplicationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReplicationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TableReplicationInfo { + + /** ReplicationStatus enum. */ + enum ReplicationStatus { + REPLICATION_STATUS_UNSPECIFIED = 0, + ACTIVE = 1, + SOURCE_DELETED = 2, + PERMISSION_DENIED = 3, + UNSUPPORTED_CONFIGURATION = 4 + } + } + + /** Properties of a ViewDefinition. */ + interface IViewDefinition { + + /** ViewDefinition query */ + query?: (string|null); + + /** ViewDefinition userDefinedFunctionResources */ + userDefinedFunctionResources?: (google.cloud.bigquery.v2.IUserDefinedFunctionResource[]|null); + + /** ViewDefinition useLegacySql */ + useLegacySql?: (google.protobuf.IBoolValue|null); + + /** ViewDefinition useExplicitColumnNames */ + useExplicitColumnNames?: (boolean|null); + + /** ViewDefinition privacyPolicy */ + privacyPolicy?: (google.cloud.bigquery.v2.IPrivacyPolicy|null); + + /** ViewDefinition foreignDefinitions */ + foreignDefinitions?: (google.cloud.bigquery.v2.IForeignViewDefinition[]|null); + } + + /** Represents a ViewDefinition. */ + class ViewDefinition implements IViewDefinition { + + /** + * Constructs a new ViewDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IViewDefinition); + + /** ViewDefinition query. */ + public query: string; + + /** ViewDefinition userDefinedFunctionResources. */ + public userDefinedFunctionResources: google.cloud.bigquery.v2.IUserDefinedFunctionResource[]; + + /** ViewDefinition useLegacySql. */ + public useLegacySql?: (google.protobuf.IBoolValue|null); + + /** ViewDefinition useExplicitColumnNames. */ + public useExplicitColumnNames: boolean; + + /** ViewDefinition privacyPolicy. */ + public privacyPolicy?: (google.cloud.bigquery.v2.IPrivacyPolicy|null); + + /** ViewDefinition foreignDefinitions. */ + public foreignDefinitions: google.cloud.bigquery.v2.IForeignViewDefinition[]; + + /** + * Creates a new ViewDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns ViewDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.IViewDefinition): google.cloud.bigquery.v2.ViewDefinition; + + /** + * Encodes the specified ViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.ViewDefinition.verify|verify} messages. + * @param message ViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ViewDefinition.verify|verify} messages. + * @param message ViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViewDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ViewDefinition; + + /** + * Decodes a ViewDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ViewDefinition; + + /** + * Verifies a ViewDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ViewDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViewDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ViewDefinition; + + /** + * Creates a plain object from a ViewDefinition message. Also converts values to other types if specified. + * @param message ViewDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ViewDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViewDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViewDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForeignViewDefinition. */ + interface IForeignViewDefinition { + + /** ForeignViewDefinition query */ + query?: (string|null); + + /** ForeignViewDefinition dialect */ + dialect?: (string|null); + } + + /** Represents a ForeignViewDefinition. */ + class ForeignViewDefinition implements IForeignViewDefinition { + + /** + * Constructs a new ForeignViewDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IForeignViewDefinition); + + /** ForeignViewDefinition query. */ + public query: string; + + /** ForeignViewDefinition dialect. */ + public dialect: string; + + /** + * Creates a new ForeignViewDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns ForeignViewDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.IForeignViewDefinition): google.cloud.bigquery.v2.ForeignViewDefinition; + + /** + * Encodes the specified ForeignViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignViewDefinition.verify|verify} messages. + * @param message ForeignViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IForeignViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForeignViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignViewDefinition.verify|verify} messages. + * @param message ForeignViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IForeignViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForeignViewDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForeignViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ForeignViewDefinition; + + /** + * Decodes a ForeignViewDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForeignViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ForeignViewDefinition; + + /** + * Verifies a ForeignViewDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForeignViewDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForeignViewDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ForeignViewDefinition; + + /** + * Creates a plain object from a ForeignViewDefinition message. Also converts values to other types if specified. + * @param message ForeignViewDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ForeignViewDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForeignViewDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForeignViewDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializedViewDefinition. */ + interface IMaterializedViewDefinition { + + /** MaterializedViewDefinition query */ + query?: (string|null); + + /** MaterializedViewDefinition lastRefreshTime */ + lastRefreshTime?: (number|Long|string|null); + + /** MaterializedViewDefinition enableRefresh */ + enableRefresh?: (google.protobuf.IBoolValue|null); + + /** MaterializedViewDefinition refreshIntervalMs */ + refreshIntervalMs?: (google.protobuf.IUInt64Value|null); + + /** MaterializedViewDefinition allowNonIncrementalDefinition */ + allowNonIncrementalDefinition?: (google.protobuf.IBoolValue|null); + } + + /** Represents a MaterializedViewDefinition. */ + class MaterializedViewDefinition implements IMaterializedViewDefinition { + + /** + * Constructs a new MaterializedViewDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMaterializedViewDefinition); + + /** MaterializedViewDefinition query. */ + public query: string; + + /** MaterializedViewDefinition lastRefreshTime. */ + public lastRefreshTime: (number|Long|string); + + /** MaterializedViewDefinition enableRefresh. */ + public enableRefresh?: (google.protobuf.IBoolValue|null); + + /** MaterializedViewDefinition refreshIntervalMs. */ + public refreshIntervalMs?: (google.protobuf.IUInt64Value|null); + + /** MaterializedViewDefinition allowNonIncrementalDefinition. */ + public allowNonIncrementalDefinition?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new MaterializedViewDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedViewDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMaterializedViewDefinition): google.cloud.bigquery.v2.MaterializedViewDefinition; + + /** + * Encodes the specified MaterializedViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewDefinition.verify|verify} messages. + * @param message MaterializedViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMaterializedViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewDefinition.verify|verify} messages. + * @param message MaterializedViewDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMaterializedViewDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedViewDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MaterializedViewDefinition; + + /** + * Decodes a MaterializedViewDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MaterializedViewDefinition; + + /** + * Verifies a MaterializedViewDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedViewDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedViewDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MaterializedViewDefinition; + + /** + * Creates a plain object from a MaterializedViewDefinition message. Also converts values to other types if specified. + * @param message MaterializedViewDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MaterializedViewDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedViewDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedViewDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaterializedViewStatus. */ + interface IMaterializedViewStatus { + + /** MaterializedViewStatus refreshWatermark */ + refreshWatermark?: (google.protobuf.ITimestamp|null); + + /** MaterializedViewStatus lastRefreshStatus */ + lastRefreshStatus?: (google.cloud.bigquery.v2.IErrorProto|null); + } + + /** Represents a MaterializedViewStatus. */ + class MaterializedViewStatus implements IMaterializedViewStatus { + + /** + * Constructs a new MaterializedViewStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IMaterializedViewStatus); + + /** MaterializedViewStatus refreshWatermark. */ + public refreshWatermark?: (google.protobuf.ITimestamp|null); + + /** MaterializedViewStatus lastRefreshStatus. */ + public lastRefreshStatus?: (google.cloud.bigquery.v2.IErrorProto|null); + + /** + * Creates a new MaterializedViewStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns MaterializedViewStatus instance + */ + public static create(properties?: google.cloud.bigquery.v2.IMaterializedViewStatus): google.cloud.bigquery.v2.MaterializedViewStatus; + + /** + * Encodes the specified MaterializedViewStatus message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatus.verify|verify} messages. + * @param message MaterializedViewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IMaterializedViewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaterializedViewStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatus.verify|verify} messages. + * @param message MaterializedViewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IMaterializedViewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaterializedViewStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaterializedViewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.MaterializedViewStatus; + + /** + * Decodes a MaterializedViewStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaterializedViewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.MaterializedViewStatus; + + /** + * Verifies a MaterializedViewStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaterializedViewStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaterializedViewStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.MaterializedViewStatus; + + /** + * Creates a plain object from a MaterializedViewStatus message. Also converts values to other types if specified. + * @param message MaterializedViewStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.MaterializedViewStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaterializedViewStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaterializedViewStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotDefinition. */ + interface ISnapshotDefinition { + + /** SnapshotDefinition baseTableReference */ + baseTableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** SnapshotDefinition snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SnapshotDefinition. */ + class SnapshotDefinition implements ISnapshotDefinition { + + /** + * Constructs a new SnapshotDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ISnapshotDefinition); + + /** SnapshotDefinition baseTableReference. */ + public baseTableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** SnapshotDefinition snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SnapshotDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.ISnapshotDefinition): google.cloud.bigquery.v2.SnapshotDefinition; + + /** + * Encodes the specified SnapshotDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.SnapshotDefinition.verify|verify} messages. + * @param message SnapshotDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ISnapshotDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SnapshotDefinition.verify|verify} messages. + * @param message SnapshotDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ISnapshotDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.SnapshotDefinition; + + /** + * Decodes a SnapshotDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.SnapshotDefinition; + + /** + * Verifies a SnapshotDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.SnapshotDefinition; + + /** + * Creates a plain object from a SnapshotDefinition message. Also converts values to other types if specified. + * @param message SnapshotDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.SnapshotDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloneDefinition. */ + interface ICloneDefinition { + + /** CloneDefinition baseTableReference */ + baseTableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** CloneDefinition cloneTime */ + cloneTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloneDefinition. */ + class CloneDefinition implements ICloneDefinition { + + /** + * Constructs a new CloneDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ICloneDefinition); + + /** CloneDefinition baseTableReference. */ + public baseTableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** CloneDefinition cloneTime. */ + public cloneTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CloneDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns CloneDefinition instance + */ + public static create(properties?: google.cloud.bigquery.v2.ICloneDefinition): google.cloud.bigquery.v2.CloneDefinition; + + /** + * Encodes the specified CloneDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.CloneDefinition.verify|verify} messages. + * @param message CloneDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ICloneDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloneDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CloneDefinition.verify|verify} messages. + * @param message CloneDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ICloneDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloneDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloneDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.CloneDefinition; + + /** + * Decodes a CloneDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloneDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.CloneDefinition; + + /** + * Verifies a CloneDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloneDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloneDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.CloneDefinition; + + /** + * Creates a plain object from a CloneDefinition message. Also converts values to other types if specified. + * @param message CloneDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.CloneDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloneDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloneDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Streamingbuffer. */ + interface IStreamingbuffer { + + /** Streamingbuffer estimatedBytes */ + estimatedBytes?: (number|Long|string|null); + + /** Streamingbuffer estimatedRows */ + estimatedRows?: (number|Long|string|null); + + /** Streamingbuffer oldestEntryTime */ + oldestEntryTime?: (number|Long|string|null); + } + + /** Represents a Streamingbuffer. */ + class Streamingbuffer implements IStreamingbuffer { + + /** + * Constructs a new Streamingbuffer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IStreamingbuffer); + + /** Streamingbuffer estimatedBytes. */ + public estimatedBytes: (number|Long|string); + + /** Streamingbuffer estimatedRows. */ + public estimatedRows: (number|Long|string); + + /** Streamingbuffer oldestEntryTime. */ + public oldestEntryTime: (number|Long|string); + + /** + * Creates a new Streamingbuffer instance using the specified properties. + * @param [properties] Properties to set + * @returns Streamingbuffer instance + */ + public static create(properties?: google.cloud.bigquery.v2.IStreamingbuffer): google.cloud.bigquery.v2.Streamingbuffer; + + /** + * Encodes the specified Streamingbuffer message. Does not implicitly {@link google.cloud.bigquery.v2.Streamingbuffer.verify|verify} messages. + * @param message Streamingbuffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IStreamingbuffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Streamingbuffer message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Streamingbuffer.verify|verify} messages. + * @param message Streamingbuffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IStreamingbuffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Streamingbuffer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Streamingbuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Streamingbuffer; + + /** + * Decodes a Streamingbuffer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Streamingbuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Streamingbuffer; + + /** + * Verifies a Streamingbuffer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Streamingbuffer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Streamingbuffer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Streamingbuffer; + + /** + * Creates a plain object from a Streamingbuffer message. Also converts values to other types if specified. + * @param message Streamingbuffer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Streamingbuffer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Streamingbuffer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Streamingbuffer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table kind */ + kind?: (string|null); + + /** Table etag */ + etag?: (string|null); + + /** Table id */ + id?: (string|null); + + /** Table selfLink */ + selfLink?: (string|null); + + /** Table tableReference */ + tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** Table friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** Table description */ + description?: (google.protobuf.IStringValue|null); + + /** Table labels */ + labels?: ({ [k: string]: string }|null); + + /** Table schema */ + schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** Table timePartitioning */ + timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** Table rangePartitioning */ + rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** Table clustering */ + clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** Table requirePartitionFilter */ + requirePartitionFilter?: (google.protobuf.IBoolValue|null); + + /** Table partitionDefinition */ + partitionDefinition?: (google.cloud.bigquery.v2.IPartitioningDefinition|null); + + /** Table numBytes */ + numBytes?: (google.protobuf.IInt64Value|null); + + /** Table numPhysicalBytes */ + numPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermBytes */ + numLongTermBytes?: (google.protobuf.IInt64Value|null); + + /** Table numRows */ + numRows?: (google.protobuf.IUInt64Value|null); + + /** Table creationTime */ + creationTime?: (number|Long|string|null); + + /** Table expirationTime */ + expirationTime?: (google.protobuf.IInt64Value|null); + + /** Table lastModifiedTime */ + lastModifiedTime?: (number|Long|string|null); + + /** Table type */ + type?: (string|null); + + /** Table view */ + view?: (google.cloud.bigquery.v2.IViewDefinition|null); + + /** Table materializedView */ + materializedView?: (google.cloud.bigquery.v2.IMaterializedViewDefinition|null); + + /** Table materializedViewStatus */ + materializedViewStatus?: (google.cloud.bigquery.v2.IMaterializedViewStatus|null); + + /** Table externalDataConfiguration */ + externalDataConfiguration?: (google.cloud.bigquery.v2.IExternalDataConfiguration|null); + + /** Table biglakeConfiguration */ + biglakeConfiguration?: (google.cloud.bigquery.v2.IBigLakeConfiguration|null); + + /** Table managedTableType */ + managedTableType?: (google.cloud.bigquery.v2.ManagedTableType|keyof typeof google.cloud.bigquery.v2.ManagedTableType|null); + + /** Table location */ + location?: (string|null); + + /** Table streamingBuffer */ + streamingBuffer?: (google.cloud.bigquery.v2.IStreamingbuffer|null); + + /** Table encryptionConfiguration */ + encryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Table snapshotDefinition */ + snapshotDefinition?: (google.cloud.bigquery.v2.ISnapshotDefinition|null); + + /** Table defaultCollation */ + defaultCollation?: (google.protobuf.IStringValue|null); + + /** Table defaultRoundingMode */ + defaultRoundingMode?: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null); + + /** Table cloneDefinition */ + cloneDefinition?: (google.cloud.bigquery.v2.ICloneDefinition|null); + + /** Table numTimeTravelPhysicalBytes */ + numTimeTravelPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numTotalLogicalBytes */ + numTotalLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numActiveLogicalBytes */ + numActiveLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermLogicalBytes */ + numLongTermLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numCurrentPhysicalBytes */ + numCurrentPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numTotalPhysicalBytes */ + numTotalPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numActivePhysicalBytes */ + numActivePhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermPhysicalBytes */ + numLongTermPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numPartitions */ + numPartitions?: (google.protobuf.IInt64Value|null); + + /** Table maxStaleness */ + maxStaleness?: (string|null); + + /** Table restrictions */ + restrictions?: (google.cloud.bigquery.v2.IRestrictionConfig|null); + + /** Table tableConstraints */ + tableConstraints?: (google.cloud.bigquery.v2.ITableConstraints|null); + + /** Table resourceTags */ + resourceTags?: ({ [k: string]: string }|null); + + /** Table tableReplicationInfo */ + tableReplicationInfo?: (google.cloud.bigquery.v2.ITableReplicationInfo|null); + + /** Table replicas */ + replicas?: (google.cloud.bigquery.v2.ITableReference[]|null); + + /** Table externalCatalogTableOptions */ + externalCatalogTableOptions?: (google.cloud.bigquery.v2.IExternalCatalogTableOptions|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITable); + + /** Table kind. */ + public kind: string; + + /** Table etag. */ + public etag: string; + + /** Table id. */ + public id: string; + + /** Table selfLink. */ + public selfLink: string; + + /** Table tableReference. */ + public tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** Table friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** Table description. */ + public description?: (google.protobuf.IStringValue|null); + + /** Table labels. */ + public labels: { [k: string]: string }; + + /** Table schema. */ + public schema?: (google.cloud.bigquery.v2.ITableSchema|null); + + /** Table timePartitioning. */ + public timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** Table rangePartitioning. */ + public rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** Table clustering. */ + public clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** Table requirePartitionFilter. */ + public requirePartitionFilter?: (google.protobuf.IBoolValue|null); + + /** Table partitionDefinition. */ + public partitionDefinition?: (google.cloud.bigquery.v2.IPartitioningDefinition|null); + + /** Table numBytes. */ + public numBytes?: (google.protobuf.IInt64Value|null); + + /** Table numPhysicalBytes. */ + public numPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermBytes. */ + public numLongTermBytes?: (google.protobuf.IInt64Value|null); + + /** Table numRows. */ + public numRows?: (google.protobuf.IUInt64Value|null); + + /** Table creationTime. */ + public creationTime: (number|Long|string); + + /** Table expirationTime. */ + public expirationTime?: (google.protobuf.IInt64Value|null); + + /** Table lastModifiedTime. */ + public lastModifiedTime: (number|Long|string); + + /** Table type. */ + public type: string; + + /** Table view. */ + public view?: (google.cloud.bigquery.v2.IViewDefinition|null); + + /** Table materializedView. */ + public materializedView?: (google.cloud.bigquery.v2.IMaterializedViewDefinition|null); + + /** Table materializedViewStatus. */ + public materializedViewStatus?: (google.cloud.bigquery.v2.IMaterializedViewStatus|null); + + /** Table externalDataConfiguration. */ + public externalDataConfiguration?: (google.cloud.bigquery.v2.IExternalDataConfiguration|null); + + /** Table biglakeConfiguration. */ + public biglakeConfiguration?: (google.cloud.bigquery.v2.IBigLakeConfiguration|null); + + /** Table managedTableType. */ + public managedTableType: (google.cloud.bigquery.v2.ManagedTableType|keyof typeof google.cloud.bigquery.v2.ManagedTableType); + + /** Table location. */ + public location: string; + + /** Table streamingBuffer. */ + public streamingBuffer?: (google.cloud.bigquery.v2.IStreamingbuffer|null); + + /** Table encryptionConfiguration. */ + public encryptionConfiguration?: (google.cloud.bigquery.v2.IEncryptionConfiguration|null); + + /** Table snapshotDefinition. */ + public snapshotDefinition?: (google.cloud.bigquery.v2.ISnapshotDefinition|null); + + /** Table defaultCollation. */ + public defaultCollation?: (google.protobuf.IStringValue|null); + + /** Table defaultRoundingMode. */ + public defaultRoundingMode: (google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|keyof typeof google.cloud.bigquery.v2.TableFieldSchema.RoundingMode); + + /** Table cloneDefinition. */ + public cloneDefinition?: (google.cloud.bigquery.v2.ICloneDefinition|null); + + /** Table numTimeTravelPhysicalBytes. */ + public numTimeTravelPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numTotalLogicalBytes. */ + public numTotalLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numActiveLogicalBytes. */ + public numActiveLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermLogicalBytes. */ + public numLongTermLogicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numCurrentPhysicalBytes. */ + public numCurrentPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numTotalPhysicalBytes. */ + public numTotalPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numActivePhysicalBytes. */ + public numActivePhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numLongTermPhysicalBytes. */ + public numLongTermPhysicalBytes?: (google.protobuf.IInt64Value|null); + + /** Table numPartitions. */ + public numPartitions?: (google.protobuf.IInt64Value|null); + + /** Table maxStaleness. */ + public maxStaleness: string; + + /** Table restrictions. */ + public restrictions?: (google.cloud.bigquery.v2.IRestrictionConfig|null); + + /** Table tableConstraints. */ + public tableConstraints?: (google.cloud.bigquery.v2.ITableConstraints|null); + + /** Table resourceTags. */ + public resourceTags: { [k: string]: string }; + + /** Table tableReplicationInfo. */ + public tableReplicationInfo?: (google.cloud.bigquery.v2.ITableReplicationInfo|null); + + /** Table replicas. */ + public replicas: google.cloud.bigquery.v2.ITableReference[]; + + /** Table externalCatalogTableOptions. */ + public externalCatalogTableOptions?: (google.cloud.bigquery.v2.IExternalCatalogTableOptions|null); + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITable): google.cloud.bigquery.v2.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.cloud.bigquery.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Table message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.Table; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.Table; + + /** + * Verifies a Table message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Table + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.Table; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @param message Table + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Table + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTableRequest. */ + interface IGetTableRequest { + + /** GetTableRequest projectId */ + projectId?: (string|null); + + /** GetTableRequest datasetId */ + datasetId?: (string|null); + + /** GetTableRequest tableId */ + tableId?: (string|null); + + /** GetTableRequest selectedFields */ + selectedFields?: (string|null); + + /** GetTableRequest view */ + view?: (google.cloud.bigquery.v2.GetTableRequest.TableMetadataView|keyof typeof google.cloud.bigquery.v2.GetTableRequest.TableMetadataView|null); + } + + /** Represents a GetTableRequest. */ + class GetTableRequest implements IGetTableRequest { + + /** + * Constructs a new GetTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IGetTableRequest); + + /** GetTableRequest projectId. */ + public projectId: string; + + /** GetTableRequest datasetId. */ + public datasetId: string; + + /** GetTableRequest tableId. */ + public tableId: string; + + /** GetTableRequest selectedFields. */ + public selectedFields: string; + + /** GetTableRequest view. */ + public view: (google.cloud.bigquery.v2.GetTableRequest.TableMetadataView|keyof typeof google.cloud.bigquery.v2.GetTableRequest.TableMetadataView); + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTableRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IGetTableRequest): google.cloud.bigquery.v2.GetTableRequest; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetTableRequest.verify|verify} messages. + * @param message GetTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IGetTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.GetTableRequest; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.GetTableRequest; + + /** + * Verifies a GetTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.GetTableRequest; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @param message GetTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.GetTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetTableRequest { + + /** TableMetadataView enum. */ + enum TableMetadataView { + TABLE_METADATA_VIEW_UNSPECIFIED = 0, + BASIC = 1, + STORAGE_STATS = 2, + FULL = 3 + } + } + + /** Properties of an InsertTableRequest. */ + interface IInsertTableRequest { + + /** InsertTableRequest projectId */ + projectId?: (string|null); + + /** InsertTableRequest datasetId */ + datasetId?: (string|null); + + /** InsertTableRequest table */ + table?: (google.cloud.bigquery.v2.ITable|null); + } + + /** Represents an InsertTableRequest. */ + class InsertTableRequest implements IInsertTableRequest { + + /** + * Constructs a new InsertTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IInsertTableRequest); + + /** InsertTableRequest projectId. */ + public projectId: string; + + /** InsertTableRequest datasetId. */ + public datasetId: string; + + /** InsertTableRequest table. */ + public table?: (google.cloud.bigquery.v2.ITable|null); + + /** + * Creates a new InsertTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTableRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IInsertTableRequest): google.cloud.bigquery.v2.InsertTableRequest; + + /** + * Encodes the specified InsertTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertTableRequest.verify|verify} messages. + * @param message InsertTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IInsertTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertTableRequest.verify|verify} messages. + * @param message InsertTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IInsertTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.InsertTableRequest; + + /** + * Decodes an InsertTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.InsertTableRequest; + + /** + * Verifies an InsertTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.InsertTableRequest; + + /** + * Creates a plain object from an InsertTableRequest message. Also converts values to other types if specified. + * @param message InsertTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.InsertTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateOrPatchTableRequest. */ + interface IUpdateOrPatchTableRequest { + + /** UpdateOrPatchTableRequest projectId */ + projectId?: (string|null); + + /** UpdateOrPatchTableRequest datasetId */ + datasetId?: (string|null); + + /** UpdateOrPatchTableRequest tableId */ + tableId?: (string|null); + + /** UpdateOrPatchTableRequest table */ + table?: (google.cloud.bigquery.v2.ITable|null); + + /** UpdateOrPatchTableRequest autodetectSchema */ + autodetectSchema?: (boolean|null); + } + + /** Represents an UpdateOrPatchTableRequest. */ + class UpdateOrPatchTableRequest implements IUpdateOrPatchTableRequest { + + /** + * Constructs a new UpdateOrPatchTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest); + + /** UpdateOrPatchTableRequest projectId. */ + public projectId: string; + + /** UpdateOrPatchTableRequest datasetId. */ + public datasetId: string; + + /** UpdateOrPatchTableRequest tableId. */ + public tableId: string; + + /** UpdateOrPatchTableRequest table. */ + public table?: (google.cloud.bigquery.v2.ITable|null); + + /** UpdateOrPatchTableRequest autodetectSchema. */ + public autodetectSchema: boolean; + + /** + * Creates a new UpdateOrPatchTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateOrPatchTableRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest): google.cloud.bigquery.v2.UpdateOrPatchTableRequest; + + /** + * Encodes the specified UpdateOrPatchTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchTableRequest.verify|verify} messages. + * @param message UpdateOrPatchTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateOrPatchTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchTableRequest.verify|verify} messages. + * @param message UpdateOrPatchTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateOrPatchTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateOrPatchTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.UpdateOrPatchTableRequest; + + /** + * Decodes an UpdateOrPatchTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateOrPatchTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.UpdateOrPatchTableRequest; + + /** + * Verifies an UpdateOrPatchTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateOrPatchTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateOrPatchTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.UpdateOrPatchTableRequest; + + /** + * Creates a plain object from an UpdateOrPatchTableRequest message. Also converts values to other types if specified. + * @param message UpdateOrPatchTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.UpdateOrPatchTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateOrPatchTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateOrPatchTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTableRequest. */ + interface IDeleteTableRequest { + + /** DeleteTableRequest projectId */ + projectId?: (string|null); + + /** DeleteTableRequest datasetId */ + datasetId?: (string|null); + + /** DeleteTableRequest tableId */ + tableId?: (string|null); + } + + /** Represents a DeleteTableRequest. */ + class DeleteTableRequest implements IDeleteTableRequest { + + /** + * Constructs a new DeleteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IDeleteTableRequest); + + /** DeleteTableRequest projectId. */ + public projectId: string; + + /** DeleteTableRequest datasetId. */ + public datasetId: string; + + /** DeleteTableRequest tableId. */ + public tableId: string; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTableRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IDeleteTableRequest): google.cloud.bigquery.v2.DeleteTableRequest; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteTableRequest.verify|verify} messages. + * @param message DeleteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IDeleteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.DeleteTableRequest; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.DeleteTableRequest; + + /** + * Verifies a DeleteTableRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.DeleteTableRequest; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @param message DeleteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.DeleteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTablesRequest. */ + interface IListTablesRequest { + + /** ListTablesRequest projectId */ + projectId?: (string|null); + + /** ListTablesRequest datasetId */ + datasetId?: (string|null); + + /** ListTablesRequest maxResults */ + maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListTablesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTablesRequest. */ + class ListTablesRequest implements IListTablesRequest { + + /** + * Constructs a new ListTablesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListTablesRequest); + + /** ListTablesRequest projectId. */ + public projectId: string; + + /** ListTablesRequest datasetId. */ + public datasetId: string; + + /** ListTablesRequest maxResults. */ + public maxResults?: (google.protobuf.IUInt32Value|null); + + /** ListTablesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTablesRequest instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListTablesRequest): google.cloud.bigquery.v2.ListTablesRequest; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListTablesRequest.verify|verify} messages. + * @param message ListTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListTablesRequest; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListTablesRequest; + + /** + * Verifies a ListTablesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTablesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListTablesRequest; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @param message ListTablesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTablesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTablesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFormatView. */ + interface IListFormatView { + + /** ListFormatView useLegacySql */ + useLegacySql?: (google.protobuf.IBoolValue|null); + + /** ListFormatView privacyPolicy */ + privacyPolicy?: (google.cloud.bigquery.v2.IPrivacyPolicy|null); + } + + /** Represents a ListFormatView. */ + class ListFormatView implements IListFormatView { + + /** + * Constructs a new ListFormatView. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListFormatView); + + /** ListFormatView useLegacySql. */ + public useLegacySql?: (google.protobuf.IBoolValue|null); + + /** ListFormatView privacyPolicy. */ + public privacyPolicy?: (google.cloud.bigquery.v2.IPrivacyPolicy|null); + + /** + * Creates a new ListFormatView instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFormatView instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListFormatView): google.cloud.bigquery.v2.ListFormatView; + + /** + * Encodes the specified ListFormatView message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatView.verify|verify} messages. + * @param message ListFormatView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListFormatView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFormatView message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatView.verify|verify} messages. + * @param message ListFormatView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListFormatView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFormatView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFormatView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListFormatView; + + /** + * Decodes a ListFormatView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFormatView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListFormatView; + + /** + * Verifies a ListFormatView message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFormatView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFormatView + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListFormatView; + + /** + * Creates a plain object from a ListFormatView message. Also converts values to other types if specified. + * @param message ListFormatView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListFormatView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFormatView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFormatView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFormatTable. */ + interface IListFormatTable { + + /** ListFormatTable kind */ + kind?: (string|null); + + /** ListFormatTable id */ + id?: (string|null); + + /** ListFormatTable tableReference */ + tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** ListFormatTable friendlyName */ + friendlyName?: (google.protobuf.IStringValue|null); + + /** ListFormatTable type */ + type?: (string|null); + + /** ListFormatTable timePartitioning */ + timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** ListFormatTable rangePartitioning */ + rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** ListFormatTable clustering */ + clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** ListFormatTable labels */ + labels?: ({ [k: string]: string }|null); + + /** ListFormatTable view */ + view?: (google.cloud.bigquery.v2.IListFormatView|null); + + /** ListFormatTable creationTime */ + creationTime?: (number|Long|string|null); + + /** ListFormatTable expirationTime */ + expirationTime?: (number|Long|string|null); + + /** ListFormatTable requirePartitionFilter */ + requirePartitionFilter?: (google.protobuf.IBoolValue|null); + } + + /** Represents a ListFormatTable. */ + class ListFormatTable implements IListFormatTable { + + /** + * Constructs a new ListFormatTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IListFormatTable); + + /** ListFormatTable kind. */ + public kind: string; + + /** ListFormatTable id. */ + public id: string; + + /** ListFormatTable tableReference. */ + public tableReference?: (google.cloud.bigquery.v2.ITableReference|null); + + /** ListFormatTable friendlyName. */ + public friendlyName?: (google.protobuf.IStringValue|null); + + /** ListFormatTable type. */ + public type: string; + + /** ListFormatTable timePartitioning. */ + public timePartitioning?: (google.cloud.bigquery.v2.ITimePartitioning|null); + + /** ListFormatTable rangePartitioning. */ + public rangePartitioning?: (google.cloud.bigquery.v2.IRangePartitioning|null); + + /** ListFormatTable clustering. */ + public clustering?: (google.cloud.bigquery.v2.IClustering|null); + + /** ListFormatTable labels. */ + public labels: { [k: string]: string }; + + /** ListFormatTable view. */ + public view?: (google.cloud.bigquery.v2.IListFormatView|null); + + /** ListFormatTable creationTime. */ + public creationTime: (number|Long|string); + + /** ListFormatTable expirationTime. */ + public expirationTime: (number|Long|string); + + /** ListFormatTable requirePartitionFilter. */ + public requirePartitionFilter?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new ListFormatTable instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFormatTable instance + */ + public static create(properties?: google.cloud.bigquery.v2.IListFormatTable): google.cloud.bigquery.v2.ListFormatTable; + + /** + * Encodes the specified ListFormatTable message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatTable.verify|verify} messages. + * @param message ListFormatTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IListFormatTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFormatTable message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatTable.verify|verify} messages. + * @param message ListFormatTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IListFormatTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFormatTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFormatTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ListFormatTable; + + /** + * Decodes a ListFormatTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFormatTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ListFormatTable; + + /** + * Verifies a ListFormatTable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFormatTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFormatTable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ListFormatTable; + + /** + * Creates a plain object from a ListFormatTable message. Also converts values to other types if specified. + * @param message ListFormatTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ListFormatTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFormatTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFormatTable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableList. */ + interface ITableList { + + /** TableList kind */ + kind?: (string|null); + + /** TableList etag */ + etag?: (string|null); + + /** TableList nextPageToken */ + nextPageToken?: (string|null); + + /** TableList tables */ + tables?: (google.cloud.bigquery.v2.IListFormatTable[]|null); + + /** TableList totalItems */ + totalItems?: (google.protobuf.IInt32Value|null); + } + + /** Represents a TableList. */ + class TableList implements ITableList { + + /** + * Constructs a new TableList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableList); + + /** TableList kind. */ + public kind: string; + + /** TableList etag. */ + public etag: string; + + /** TableList nextPageToken. */ + public nextPageToken: string; + + /** TableList tables. */ + public tables: google.cloud.bigquery.v2.IListFormatTable[]; + + /** TableList totalItems. */ + public totalItems?: (google.protobuf.IInt32Value|null); + + /** + * Creates a new TableList instance using the specified properties. + * @param [properties] Properties to set + * @returns TableList instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableList): google.cloud.bigquery.v2.TableList; + + /** + * Encodes the specified TableList message. Does not implicitly {@link google.cloud.bigquery.v2.TableList.verify|verify} messages. + * @param message TableList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableList.verify|verify} messages. + * @param message TableList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableList; + + /** + * Decodes a TableList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableList; + + /** + * Verifies a TableList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableList; + + /** + * Creates a plain object from a TableList message. Also converts values to other types if specified. + * @param message TableList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrimaryKey. */ + interface IPrimaryKey { + + /** PrimaryKey columns */ + columns?: (string[]|null); + } + + /** Represents a PrimaryKey. */ + class PrimaryKey implements IPrimaryKey { + + /** + * Constructs a new PrimaryKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IPrimaryKey); + + /** PrimaryKey columns. */ + public columns: string[]; + + /** + * Creates a new PrimaryKey instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryKey instance + */ + public static create(properties?: google.cloud.bigquery.v2.IPrimaryKey): google.cloud.bigquery.v2.PrimaryKey; + + /** + * Encodes the specified PrimaryKey message. Does not implicitly {@link google.cloud.bigquery.v2.PrimaryKey.verify|verify} messages. + * @param message PrimaryKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IPrimaryKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimaryKey message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PrimaryKey.verify|verify} messages. + * @param message PrimaryKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IPrimaryKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimaryKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.PrimaryKey; + + /** + * Decodes a PrimaryKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.PrimaryKey; + + /** + * Verifies a PrimaryKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrimaryKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.PrimaryKey; + + /** + * Creates a plain object from a PrimaryKey message. Also converts values to other types if specified. + * @param message PrimaryKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.PrimaryKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimaryKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrimaryKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnReference. */ + interface IColumnReference { + + /** ColumnReference referencingColumn */ + referencingColumn?: (string|null); + + /** ColumnReference referencedColumn */ + referencedColumn?: (string|null); + } + + /** Represents a ColumnReference. */ + class ColumnReference implements IColumnReference { + + /** + * Constructs a new ColumnReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IColumnReference); + + /** ColumnReference referencingColumn. */ + public referencingColumn: string; + + /** ColumnReference referencedColumn. */ + public referencedColumn: string; + + /** + * Creates a new ColumnReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnReference instance + */ + public static create(properties?: google.cloud.bigquery.v2.IColumnReference): google.cloud.bigquery.v2.ColumnReference; + + /** + * Encodes the specified ColumnReference message. Does not implicitly {@link google.cloud.bigquery.v2.ColumnReference.verify|verify} messages. + * @param message ColumnReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IColumnReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ColumnReference.verify|verify} messages. + * @param message ColumnReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IColumnReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ColumnReference; + + /** + * Decodes a ColumnReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ColumnReference; + + /** + * Verifies a ColumnReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ColumnReference; + + /** + * Creates a plain object from a ColumnReference message. Also converts values to other types if specified. + * @param message ColumnReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ColumnReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForeignKey. */ + interface IForeignKey { + + /** ForeignKey name */ + name?: (string|null); + + /** ForeignKey referencedTable */ + referencedTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** ForeignKey columnReferences */ + columnReferences?: (google.cloud.bigquery.v2.IColumnReference[]|null); + } + + /** Represents a ForeignKey. */ + class ForeignKey implements IForeignKey { + + /** + * Constructs a new ForeignKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.IForeignKey); + + /** ForeignKey name. */ + public name: string; + + /** ForeignKey referencedTable. */ + public referencedTable?: (google.cloud.bigquery.v2.ITableReference|null); + + /** ForeignKey columnReferences. */ + public columnReferences: google.cloud.bigquery.v2.IColumnReference[]; + + /** + * Creates a new ForeignKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ForeignKey instance + */ + public static create(properties?: google.cloud.bigquery.v2.IForeignKey): google.cloud.bigquery.v2.ForeignKey; + + /** + * Encodes the specified ForeignKey message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignKey.verify|verify} messages. + * @param message ForeignKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.IForeignKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForeignKey message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignKey.verify|verify} messages. + * @param message ForeignKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.IForeignKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForeignKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForeignKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.ForeignKey; + + /** + * Decodes a ForeignKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForeignKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.ForeignKey; + + /** + * Verifies a ForeignKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForeignKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForeignKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.ForeignKey; + + /** + * Creates a plain object from a ForeignKey message. Also converts values to other types if specified. + * @param message ForeignKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.ForeignKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForeignKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForeignKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableConstraints. */ + interface ITableConstraints { + + /** TableConstraints primaryKey */ + primaryKey?: (google.cloud.bigquery.v2.IPrimaryKey|null); + + /** TableConstraints foreignKeys */ + foreignKeys?: (google.cloud.bigquery.v2.IForeignKey[]|null); + } + + /** Represents a TableConstraints. */ + class TableConstraints implements ITableConstraints { + + /** + * Constructs a new TableConstraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.v2.ITableConstraints); + + /** TableConstraints primaryKey. */ + public primaryKey?: (google.cloud.bigquery.v2.IPrimaryKey|null); + + /** TableConstraints foreignKeys. */ + public foreignKeys: google.cloud.bigquery.v2.IForeignKey[]; + + /** + * Creates a new TableConstraints instance using the specified properties. + * @param [properties] Properties to set + * @returns TableConstraints instance + */ + public static create(properties?: google.cloud.bigquery.v2.ITableConstraints): google.cloud.bigquery.v2.TableConstraints; + + /** + * Encodes the specified TableConstraints message. Does not implicitly {@link google.cloud.bigquery.v2.TableConstraints.verify|verify} messages. + * @param message TableConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.v2.ITableConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableConstraints message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableConstraints.verify|verify} messages. + * @param message TableConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.v2.ITableConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableConstraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.v2.TableConstraints; + + /** + * Decodes a TableConstraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.v2.TableConstraints; + + /** + * Verifies a TableConstraints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableConstraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableConstraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.v2.TableConstraints; + + /** + * Creates a plain object from a TableConstraints message. Also converts values to other types if specified. + * @param message TableConstraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.v2.TableConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableConstraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableConstraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-bigquery-api/protos/protos.js b/packages/google-cloud-bigquery-api/protos/protos.js new file mode 100644 index 000000000000..d2f58f2159f8 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/protos.js @@ -0,0 +1,122228 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["_google_cloud_bigquery_api_protos"] || ($protobuf.roots["_google_cloud_bigquery_api_protos"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.bigquery + * @namespace + */ + var v2 = {}; + + v2.BigLakeConfiguration = (function() { + + /** + * Properties of a BigLakeConfiguration. + * @memberof google.cloud.bigquery.v2 + * @interface IBigLakeConfiguration + * @property {string|null} [connectionId] BigLakeConfiguration connectionId + * @property {string|null} [storageUri] BigLakeConfiguration storageUri + * @property {google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat|null} [fileFormat] BigLakeConfiguration fileFormat + * @property {google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat|null} [tableFormat] BigLakeConfiguration tableFormat + */ + + /** + * Constructs a new BigLakeConfiguration. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BigLakeConfiguration. + * @implements IBigLakeConfiguration + * @constructor + * @param {google.cloud.bigquery.v2.IBigLakeConfiguration=} [properties] Properties to set + */ + function BigLakeConfiguration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigLakeConfiguration connectionId. + * @member {string} connectionId + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @instance + */ + BigLakeConfiguration.prototype.connectionId = ""; + + /** + * BigLakeConfiguration storageUri. + * @member {string} storageUri + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @instance + */ + BigLakeConfiguration.prototype.storageUri = ""; + + /** + * BigLakeConfiguration fileFormat. + * @member {google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat} fileFormat + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @instance + */ + BigLakeConfiguration.prototype.fileFormat = 0; + + /** + * BigLakeConfiguration tableFormat. + * @member {google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat} tableFormat + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @instance + */ + BigLakeConfiguration.prototype.tableFormat = 0; + + /** + * Creates a new BigLakeConfiguration instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {google.cloud.bigquery.v2.IBigLakeConfiguration=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BigLakeConfiguration} BigLakeConfiguration instance + */ + BigLakeConfiguration.create = function create(properties) { + return new BigLakeConfiguration(properties); + }; + + /** + * Encodes the specified BigLakeConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.BigLakeConfiguration.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {google.cloud.bigquery.v2.IBigLakeConfiguration} message BigLakeConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigLakeConfiguration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionId); + if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.storageUri); + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.fileFormat); + if (message.tableFormat != null && Object.hasOwnProperty.call(message, "tableFormat")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.tableFormat); + return writer; + }; + + /** + * Encodes the specified BigLakeConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigLakeConfiguration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {google.cloud.bigquery.v2.IBigLakeConfiguration} message BigLakeConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigLakeConfiguration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigLakeConfiguration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BigLakeConfiguration} BigLakeConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigLakeConfiguration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BigLakeConfiguration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connectionId = reader.string(); + break; + } + case 2: { + message.storageUri = reader.string(); + break; + } + case 3: { + message.fileFormat = reader.int32(); + break; + } + case 4: { + message.tableFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigLakeConfiguration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BigLakeConfiguration} BigLakeConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigLakeConfiguration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigLakeConfiguration message. + * @function verify + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigLakeConfiguration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri")) + if (!$util.isString(message.storageUri)) + return "storageUri: string expected"; + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + switch (message.fileFormat) { + default: + return "fileFormat: enum value expected"; + case 0: + case 1: + break; + } + if (message.tableFormat != null && Object.hasOwnProperty.call(message, "tableFormat")) + switch (message.tableFormat) { + default: + return "tableFormat: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BigLakeConfiguration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BigLakeConfiguration} BigLakeConfiguration + */ + BigLakeConfiguration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BigLakeConfiguration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BigLakeConfiguration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BigLakeConfiguration(); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.storageUri != null) + message.storageUri = String(object.storageUri); + switch (object.fileFormat) { + default: + if (typeof object.fileFormat === "number") { + message.fileFormat = object.fileFormat; + break; + } + break; + case "FILE_FORMAT_UNSPECIFIED": + case 0: + message.fileFormat = 0; + break; + case "PARQUET": + case 1: + message.fileFormat = 1; + break; + } + switch (object.tableFormat) { + default: + if (typeof object.tableFormat === "number") { + message.tableFormat = object.tableFormat; + break; + } + break; + case "TABLE_FORMAT_UNSPECIFIED": + case 0: + message.tableFormat = 0; + break; + case "ICEBERG": + case 1: + message.tableFormat = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BigLakeConfiguration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {google.cloud.bigquery.v2.BigLakeConfiguration} message BigLakeConfiguration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigLakeConfiguration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.connectionId = ""; + object.storageUri = ""; + object.fileFormat = options.enums === String ? "FILE_FORMAT_UNSPECIFIED" : 0; + object.tableFormat = options.enums === String ? "TABLE_FORMAT_UNSPECIFIED" : 0; + } + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + object.connectionId = message.connectionId; + if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri")) + object.storageUri = message.storageUri; + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + object.fileFormat = options.enums === String ? $root.google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat[message.fileFormat] === undefined ? message.fileFormat : $root.google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat[message.fileFormat] : message.fileFormat; + if (message.tableFormat != null && Object.hasOwnProperty.call(message, "tableFormat")) + object.tableFormat = options.enums === String ? $root.google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat[message.tableFormat] === undefined ? message.tableFormat : $root.google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat[message.tableFormat] : message.tableFormat; + return object; + }; + + /** + * Converts this BigLakeConfiguration to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @instance + * @returns {Object.} JSON object + */ + BigLakeConfiguration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigLakeConfiguration + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BigLakeConfiguration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigLakeConfiguration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BigLakeConfiguration"; + }; + + /** + * FileFormat enum. + * @name google.cloud.bigquery.v2.BigLakeConfiguration.FileFormat + * @enum {number} + * @property {number} FILE_FORMAT_UNSPECIFIED=0 FILE_FORMAT_UNSPECIFIED value + * @property {number} PARQUET=1 PARQUET value + */ + BigLakeConfiguration.FileFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARQUET"] = 1; + return values; + })(); + + /** + * TableFormat enum. + * @name google.cloud.bigquery.v2.BigLakeConfiguration.TableFormat + * @enum {number} + * @property {number} TABLE_FORMAT_UNSPECIFIED=0 TABLE_FORMAT_UNSPECIFIED value + * @property {number} ICEBERG=1 ICEBERG value + */ + BigLakeConfiguration.TableFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TABLE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "ICEBERG"] = 1; + return values; + })(); + + return BigLakeConfiguration; + })(); + + v2.Clustering = (function() { + + /** + * Properties of a Clustering. + * @memberof google.cloud.bigquery.v2 + * @interface IClustering + * @property {Array.|null} [fields] Clustering fields + */ + + /** + * Constructs a new Clustering. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Clustering. + * @implements IClustering + * @constructor + * @param {google.cloud.bigquery.v2.IClustering=} [properties] Properties to set + */ + function Clustering(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Clustering fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.v2.Clustering + * @instance + */ + Clustering.prototype.fields = $util.emptyArray; + + /** + * Creates a new Clustering instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {google.cloud.bigquery.v2.IClustering=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Clustering} Clustering instance + */ + Clustering.create = function create(properties) { + return new Clustering(properties); + }; + + /** + * Encodes the specified Clustering message. Does not implicitly {@link google.cloud.bigquery.v2.Clustering.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {google.cloud.bigquery.v2.IClustering} message Clustering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Clustering.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fields[i]); + return writer; + }; + + /** + * Encodes the specified Clustering message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Clustering.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {google.cloud.bigquery.v2.IClustering} message Clustering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Clustering.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Clustering message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Clustering} Clustering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Clustering.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Clustering(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Clustering message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Clustering} Clustering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Clustering.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Clustering message. + * @function verify + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Clustering.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) + if (!$util.isString(message.fields[i])) + return "fields: string[] expected"; + } + return null; + }; + + /** + * Creates a Clustering message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Clustering} Clustering + */ + Clustering.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Clustering) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Clustering: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Clustering(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.v2.Clustering.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) + message.fields[i] = String(object.fields[i]); + } + return message; + }; + + /** + * Creates a plain object from a Clustering message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {google.cloud.bigquery.v2.Clustering} message Clustering + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Clustering.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = message.fields[j]; + } + return object; + }; + + /** + * Converts this Clustering to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Clustering + * @instance + * @returns {Object.} JSON object + */ + Clustering.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Clustering + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Clustering + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Clustering.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Clustering"; + }; + + return Clustering; + })(); + + v2.DataFormatOptions = (function() { + + /** + * Properties of a DataFormatOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IDataFormatOptions + * @property {boolean|null} [useInt64Timestamp] DataFormatOptions useInt64Timestamp + * @property {google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat|null} [timestampOutputFormat] DataFormatOptions timestampOutputFormat + */ + + /** + * Constructs a new DataFormatOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DataFormatOptions. + * @implements IDataFormatOptions + * @constructor + * @param {google.cloud.bigquery.v2.IDataFormatOptions=} [properties] Properties to set + */ + function DataFormatOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataFormatOptions useInt64Timestamp. + * @member {boolean} useInt64Timestamp + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @instance + */ + DataFormatOptions.prototype.useInt64Timestamp = false; + + /** + * DataFormatOptions timestampOutputFormat. + * @member {google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat} timestampOutputFormat + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @instance + */ + DataFormatOptions.prototype.timestampOutputFormat = 0; + + /** + * Creates a new DataFormatOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {google.cloud.bigquery.v2.IDataFormatOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DataFormatOptions} DataFormatOptions instance + */ + DataFormatOptions.create = function create(properties) { + return new DataFormatOptions(properties); + }; + + /** + * Encodes the specified DataFormatOptions message. Does not implicitly {@link google.cloud.bigquery.v2.DataFormatOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {google.cloud.bigquery.v2.IDataFormatOptions} message DataFormatOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataFormatOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.useInt64Timestamp != null && Object.hasOwnProperty.call(message, "useInt64Timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useInt64Timestamp); + if (message.timestampOutputFormat != null && Object.hasOwnProperty.call(message, "timestampOutputFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.timestampOutputFormat); + return writer; + }; + + /** + * Encodes the specified DataFormatOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataFormatOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {google.cloud.bigquery.v2.IDataFormatOptions} message DataFormatOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataFormatOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataFormatOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DataFormatOptions} DataFormatOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataFormatOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DataFormatOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.useInt64Timestamp = reader.bool(); + break; + } + case 3: { + message.timestampOutputFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataFormatOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DataFormatOptions} DataFormatOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataFormatOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataFormatOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataFormatOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.useInt64Timestamp != null && Object.hasOwnProperty.call(message, "useInt64Timestamp")) + if (typeof message.useInt64Timestamp !== "boolean") + return "useInt64Timestamp: boolean expected"; + if (message.timestampOutputFormat != null && Object.hasOwnProperty.call(message, "timestampOutputFormat")) + switch (message.timestampOutputFormat) { + default: + return "timestampOutputFormat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DataFormatOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DataFormatOptions} DataFormatOptions + */ + DataFormatOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DataFormatOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DataFormatOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DataFormatOptions(); + if (object.useInt64Timestamp != null) + message.useInt64Timestamp = Boolean(object.useInt64Timestamp); + switch (object.timestampOutputFormat) { + default: + if (typeof object.timestampOutputFormat === "number") { + message.timestampOutputFormat = object.timestampOutputFormat; + break; + } + break; + case "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED": + case 0: + message.timestampOutputFormat = 0; + break; + case "FLOAT64": + case 1: + message.timestampOutputFormat = 1; + break; + case "INT64": + case 2: + message.timestampOutputFormat = 2; + break; + case "ISO8601_STRING": + case 3: + message.timestampOutputFormat = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DataFormatOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {google.cloud.bigquery.v2.DataFormatOptions} message DataFormatOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataFormatOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.useInt64Timestamp = false; + object.timestampOutputFormat = options.enums === String ? "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED" : 0; + } + if (message.useInt64Timestamp != null && Object.hasOwnProperty.call(message, "useInt64Timestamp")) + object.useInt64Timestamp = message.useInt64Timestamp; + if (message.timestampOutputFormat != null && Object.hasOwnProperty.call(message, "timestampOutputFormat")) + object.timestampOutputFormat = options.enums === String ? $root.google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat[message.timestampOutputFormat] === undefined ? message.timestampOutputFormat : $root.google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat[message.timestampOutputFormat] : message.timestampOutputFormat; + return object; + }; + + /** + * Converts this DataFormatOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @instance + * @returns {Object.} JSON object + */ + DataFormatOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataFormatOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DataFormatOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataFormatOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DataFormatOptions"; + }; + + /** + * TimestampOutputFormat enum. + * @name google.cloud.bigquery.v2.DataFormatOptions.TimestampOutputFormat + * @enum {number} + * @property {number} TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED=0 TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED value + * @property {number} FLOAT64=1 FLOAT64 value + * @property {number} INT64=2 INT64 value + * @property {number} ISO8601_STRING=3 ISO8601_STRING value + */ + DataFormatOptions.TimestampOutputFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "FLOAT64"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "ISO8601_STRING"] = 3; + return values; + })(); + + return DataFormatOptions; + })(); + + v2.DatasetService = (function() { + + /** + * Constructs a new DatasetService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DatasetService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DatasetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DatasetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatasetService; + + /** + * Creates new DatasetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.DatasetService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DatasetService} RPC service. Useful where requests and/or responses are streamed. + */ + DatasetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|getDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.getDataset = function getDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getDataset, $root.google.cloud.bigquery.v2.GetDatasetRequest, $root.google.cloud.bigquery.v2.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|insertDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef InsertDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Dataset} [response] Dataset + */ + + /** + * Calls InsertDataset. + * @function insertDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest} request InsertDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.InsertDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.insertDataset = function insertDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insertDataset, $root.google.cloud.bigquery.v2.InsertDatasetRequest, $root.google.cloud.bigquery.v2.Dataset, request, callback); + }, "name", { value: "InsertDataset" }); + + /** + * Calls InsertDataset. + * @function insertDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest} request InsertDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|patchDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef PatchDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Dataset} [response] Dataset + */ + + /** + * Calls PatchDataset. + * @function patchDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} request UpdateOrPatchDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.PatchDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.patchDataset = function patchDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patchDataset, $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest, $root.google.cloud.bigquery.v2.Dataset, request, callback); + }, "name", { value: "PatchDataset" }); + + /** + * Calls PatchDataset. + * @function patchDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} request UpdateOrPatchDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|updateDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} request UpdateOrPatchDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.updateDataset = function updateDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateDataset, $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest, $root.google.cloud.bigquery.v2.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} request UpdateOrPatchDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|deleteDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.deleteDataset = function deleteDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteDataset, $root.google.cloud.bigquery.v2.DeleteDatasetRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|listDatasets}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.DatasetList} [response] DatasetList + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.ListDatasetsCallback} callback Node-style callback called with the error, if any, and DatasetList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.listDatasets = function listDatasets(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listDatasets, $root.google.cloud.bigquery.v2.ListDatasetsRequest, $root.google.cloud.bigquery.v2.DatasetList, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.DatasetService|undeleteDataset}. + * @memberof google.cloud.bigquery.v2.DatasetService + * @typedef UndeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Dataset} [response] Dataset + */ + + /** + * Calls UndeleteDataset. + * @function undeleteDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest} request UndeleteDatasetRequest message or plain object + * @param {google.cloud.bigquery.v2.DatasetService.UndeleteDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatasetService.prototype.undeleteDataset = function undeleteDataset(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, undeleteDataset, $root.google.cloud.bigquery.v2.UndeleteDatasetRequest, $root.google.cloud.bigquery.v2.Dataset, request, callback); + }, "name", { value: "UndeleteDataset" }); + + /** + * Calls UndeleteDataset. + * @function undeleteDataset + * @memberof google.cloud.bigquery.v2.DatasetService + * @instance + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest} request UndeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DatasetService; + })(); + + v2.DatasetAccessEntry = (function() { + + /** + * Properties of a DatasetAccessEntry. + * @memberof google.cloud.bigquery.v2 + * @interface IDatasetAccessEntry + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [dataset] DatasetAccessEntry dataset + * @property {Array.|null} [targetTypes] DatasetAccessEntry targetTypes + */ + + /** + * Constructs a new DatasetAccessEntry. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DatasetAccessEntry. + * @implements IDatasetAccessEntry + * @constructor + * @param {google.cloud.bigquery.v2.IDatasetAccessEntry=} [properties] Properties to set + */ + function DatasetAccessEntry(properties) { + this.targetTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetAccessEntry dataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} dataset + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @instance + */ + DatasetAccessEntry.prototype.dataset = null; + + /** + * DatasetAccessEntry targetTypes. + * @member {Array.} targetTypes + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @instance + */ + DatasetAccessEntry.prototype.targetTypes = $util.emptyArray; + + /** + * Creates a new DatasetAccessEntry instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {google.cloud.bigquery.v2.IDatasetAccessEntry=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DatasetAccessEntry} DatasetAccessEntry instance + */ + DatasetAccessEntry.create = function create(properties) { + return new DatasetAccessEntry(properties); + }; + + /** + * Encodes the specified DatasetAccessEntry message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetAccessEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {google.cloud.bigquery.v2.IDatasetAccessEntry} message DatasetAccessEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetAccessEntry.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.targetTypes != null && message.targetTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.targetTypes.length; ++i) + writer.int32(message.targetTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified DatasetAccessEntry message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetAccessEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {google.cloud.bigquery.v2.IDatasetAccessEntry} message DatasetAccessEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetAccessEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DatasetAccessEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DatasetAccessEntry} DatasetAccessEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetAccessEntry.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DatasetAccessEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.targetTypes && message.targetTypes.length)) + message.targetTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targetTypes.push(reader.int32()); + } else + message.targetTypes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetAccessEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DatasetAccessEntry} DatasetAccessEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetAccessEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetAccessEntry message. + * @function verify + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetAccessEntry.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.dataset, long + 1); + if (error) + return "dataset." + error; + } + if (message.targetTypes != null && Object.hasOwnProperty.call(message, "targetTypes")) { + if (!Array.isArray(message.targetTypes)) + return "targetTypes: array expected"; + for (var i = 0; i < message.targetTypes.length; ++i) + switch (message.targetTypes[i]) { + default: + return "targetTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a DatasetAccessEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DatasetAccessEntry} DatasetAccessEntry + */ + DatasetAccessEntry.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DatasetAccessEntry) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DatasetAccessEntry: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DatasetAccessEntry(); + if (object.dataset != null) { + if (!$util.isObject(object.dataset)) + throw TypeError(".google.cloud.bigquery.v2.DatasetAccessEntry.dataset: object expected"); + message.dataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.dataset, long + 1); + } + if (object.targetTypes) { + if (!Array.isArray(object.targetTypes)) + throw TypeError(".google.cloud.bigquery.v2.DatasetAccessEntry.targetTypes: array expected"); + message.targetTypes = []; + for (var i = 0; i < object.targetTypes.length; ++i) + switch (object.targetTypes[i]) { + default: + if (typeof object.targetTypes[i] === "number") { + message.targetTypes[i] = object.targetTypes[i]; + break; + } + case "TARGET_TYPE_UNSPECIFIED": + case 0: + message.targetTypes[i] = 0; + break; + case "VIEWS": + case 1: + message.targetTypes[i] = 1; + break; + case "ROUTINES": + case 2: + message.targetTypes[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a DatasetAccessEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {google.cloud.bigquery.v2.DatasetAccessEntry} message DatasetAccessEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetAccessEntry.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.targetTypes = []; + if (options.defaults) + object.dataset = null; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + object.dataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.dataset, options, q + 1); + if (message.targetTypes && message.targetTypes.length) { + object.targetTypes = []; + for (var j = 0; j < message.targetTypes.length; ++j) + object.targetTypes[j] = options.enums === String ? $root.google.cloud.bigquery.v2.DatasetAccessEntry.TargetType[message.targetTypes[j]] === undefined ? message.targetTypes[j] : $root.google.cloud.bigquery.v2.DatasetAccessEntry.TargetType[message.targetTypes[j]] : message.targetTypes[j]; + } + return object; + }; + + /** + * Converts this DatasetAccessEntry to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @instance + * @returns {Object.} JSON object + */ + DatasetAccessEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetAccessEntry + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DatasetAccessEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetAccessEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DatasetAccessEntry"; + }; + + /** + * TargetType enum. + * @name google.cloud.bigquery.v2.DatasetAccessEntry.TargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNSPECIFIED=0 TARGET_TYPE_UNSPECIFIED value + * @property {number} VIEWS=1 VIEWS value + * @property {number} ROUTINES=2 ROUTINES value + */ + DatasetAccessEntry.TargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIEWS"] = 1; + values[valuesById[2] = "ROUTINES"] = 2; + return values; + })(); + + return DatasetAccessEntry; + })(); + + v2.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.bigquery.v2 + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [userByEmail] Access userByEmail + * @property {string|null} [groupByEmail] Access groupByEmail + * @property {string|null} [domain] Access domain + * @property {string|null} [specialGroup] Access specialGroup + * @property {string|null} [iamMember] Access iamMember + * @property {google.cloud.bigquery.v2.ITableReference|null} [view] Access view + * @property {google.cloud.bigquery.v2.IRoutineReference|null} [routine] Access routine + * @property {google.cloud.bigquery.v2.IDatasetAccessEntry|null} [dataset] Access dataset + * @property {google.type.IExpr|null} [condition] Access condition + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.bigquery.v2.IAccess=} [properties] Properties to set + */ + function Access(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Access role. + * @member {string} role + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.role = ""; + + /** + * Access userByEmail. + * @member {string} userByEmail + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.userByEmail = ""; + + /** + * Access groupByEmail. + * @member {string} groupByEmail + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.groupByEmail = ""; + + /** + * Access domain. + * @member {string} domain + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.domain = ""; + + /** + * Access specialGroup. + * @member {string} specialGroup + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.specialGroup = ""; + + /** + * Access iamMember. + * @member {string} iamMember + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.iamMember = ""; + + /** + * Access view. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} view + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.view = null; + + /** + * Access routine. + * @member {google.cloud.bigquery.v2.IRoutineReference|null|undefined} routine + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.routine = null; + + /** + * Access dataset. + * @member {google.cloud.bigquery.v2.IDatasetAccessEntry|null|undefined} dataset + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.dataset = null; + + /** + * Access condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.bigquery.v2.Access + * @instance + */ + Access.prototype.condition = null; + + /** + * Creates a new Access instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {google.cloud.bigquery.v2.IAccess=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Access} Access instance + */ + Access.create = function create(properties) { + return new Access(properties); + }; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.bigquery.v2.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {google.cloud.bigquery.v2.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.userByEmail != null && Object.hasOwnProperty.call(message, "userByEmail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userByEmail); + if (message.groupByEmail != null && Object.hasOwnProperty.call(message, "groupByEmail")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupByEmail); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.domain); + if (message.specialGroup != null && Object.hasOwnProperty.call(message, "specialGroup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.specialGroup); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.view, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.iamMember != null && Object.hasOwnProperty.call(message, "iamMember")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.iamMember); + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + $root.google.cloud.bigquery.v2.RoutineReference.encode(message.routine, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.bigquery.v2.DatasetAccessEntry.encode(message.dataset, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {google.cloud.bigquery.v2.IAccess} message Access message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Access.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Access message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Access(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + message.userByEmail = reader.string(); + break; + } + case 3: { + message.groupByEmail = reader.string(); + break; + } + case 4: { + message.domain = reader.string(); + break; + } + case 5: { + message.specialGroup = reader.string(); + break; + } + case 7: { + message.iamMember = reader.string(); + break; + } + case 6: { + message.view = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.routine = $root.google.cloud.bigquery.v2.RoutineReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.dataset = $root.google.cloud.bigquery.v2.DatasetAccessEntry.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Access message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Access} Access + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Access.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Access message. + * @function verify + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Access.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.userByEmail != null && Object.hasOwnProperty.call(message, "userByEmail")) + if (!$util.isString(message.userByEmail)) + return "userByEmail: string expected"; + if (message.groupByEmail != null && Object.hasOwnProperty.call(message, "groupByEmail")) + if (!$util.isString(message.groupByEmail)) + return "groupByEmail: string expected"; + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.specialGroup != null && Object.hasOwnProperty.call(message, "specialGroup")) + if (!$util.isString(message.specialGroup)) + return "specialGroup: string expected"; + if (message.iamMember != null && Object.hasOwnProperty.call(message, "iamMember")) + if (!$util.isString(message.iamMember)) + return "iamMember: string expected"; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.view, long + 1); + if (error) + return "view." + error; + } + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) { + var error = $root.google.cloud.bigquery.v2.RoutineReference.verify(message.routine, long + 1); + if (error) + return "routine." + error; + } + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetAccessEntry.verify(message.dataset, long + 1); + if (error) + return "dataset." + error; + } + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) { + var error = $root.google.type.Expr.verify(message.condition, long + 1); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates an Access message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Access} Access + */ + Access.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Access) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Access: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Access(); + if (object.role != null) + message.role = String(object.role); + if (object.userByEmail != null) + message.userByEmail = String(object.userByEmail); + if (object.groupByEmail != null) + message.groupByEmail = String(object.groupByEmail); + if (object.domain != null) + message.domain = String(object.domain); + if (object.specialGroup != null) + message.specialGroup = String(object.specialGroup); + if (object.iamMember != null) + message.iamMember = String(object.iamMember); + if (object.view != null) { + if (!$util.isObject(object.view)) + throw TypeError(".google.cloud.bigquery.v2.Access.view: object expected"); + message.view = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.view, long + 1); + } + if (object.routine != null) { + if (!$util.isObject(object.routine)) + throw TypeError(".google.cloud.bigquery.v2.Access.routine: object expected"); + message.routine = $root.google.cloud.bigquery.v2.RoutineReference.fromObject(object.routine, long + 1); + } + if (object.dataset != null) { + if (!$util.isObject(object.dataset)) + throw TypeError(".google.cloud.bigquery.v2.Access.dataset: object expected"); + message.dataset = $root.google.cloud.bigquery.v2.DatasetAccessEntry.fromObject(object.dataset, long + 1); + } + if (object.condition != null) { + if (!$util.isObject(object.condition)) + throw TypeError(".google.cloud.bigquery.v2.Access.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Access message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {google.cloud.bigquery.v2.Access} message Access + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Access.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.role = ""; + object.userByEmail = ""; + object.groupByEmail = ""; + object.domain = ""; + object.specialGroup = ""; + object.view = null; + object.iamMember = ""; + object.routine = null; + object.dataset = null; + object.condition = null; + } + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + object.role = message.role; + if (message.userByEmail != null && Object.hasOwnProperty.call(message, "userByEmail")) + object.userByEmail = message.userByEmail; + if (message.groupByEmail != null && Object.hasOwnProperty.call(message, "groupByEmail")) + object.groupByEmail = message.groupByEmail; + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + object.domain = message.domain; + if (message.specialGroup != null && Object.hasOwnProperty.call(message, "specialGroup")) + object.specialGroup = message.specialGroup; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = $root.google.cloud.bigquery.v2.TableReference.toObject(message.view, options, q + 1); + if (message.iamMember != null && Object.hasOwnProperty.call(message, "iamMember")) + object.iamMember = message.iamMember; + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + object.routine = $root.google.cloud.bigquery.v2.RoutineReference.toObject(message.routine, options, q + 1); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + object.dataset = $root.google.cloud.bigquery.v2.DatasetAccessEntry.toObject(message.dataset, options, q + 1); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options, q + 1); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Access"; + }; + + return Access; + })(); + + v2.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.bigquery.v2 + * @interface IDataset + * @property {string|null} [kind] Dataset kind + * @property {string|null} [etag] Dataset etag + * @property {string|null} [id] Dataset id + * @property {string|null} [selfLink] Dataset selfLink + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [datasetReference] Dataset datasetReference + * @property {google.protobuf.IStringValue|null} [friendlyName] Dataset friendlyName + * @property {google.protobuf.IStringValue|null} [description] Dataset description + * @property {google.protobuf.IInt64Value|null} [defaultTableExpirationMs] Dataset defaultTableExpirationMs + * @property {google.protobuf.IInt64Value|null} [defaultPartitionExpirationMs] Dataset defaultPartitionExpirationMs + * @property {Object.|null} [labels] Dataset labels + * @property {Array.|null} [access] Dataset access + * @property {number|Long|null} [creationTime] Dataset creationTime + * @property {number|Long|null} [lastModifiedTime] Dataset lastModifiedTime + * @property {string|null} [location] Dataset location + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [defaultEncryptionConfiguration] Dataset defaultEncryptionConfiguration + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Dataset satisfiesPzs + * @property {google.protobuf.IBoolValue|null} [satisfiesPzi] Dataset satisfiesPzi + * @property {string|null} [type] Dataset type + * @property {string|null} [catalogSource] Dataset catalogSource + * @property {google.cloud.bigquery.v2.ILinkedDatasetSource|null} [linkedDatasetSource] Dataset linkedDatasetSource + * @property {google.cloud.bigquery.v2.ILinkedDatasetMetadata|null} [linkedDatasetMetadata] Dataset linkedDatasetMetadata + * @property {google.cloud.bigquery.v2.IExternalDatasetReference|null} [externalDatasetReference] Dataset externalDatasetReference + * @property {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions|null} [externalCatalogDatasetOptions] Dataset externalCatalogDatasetOptions + * @property {google.protobuf.IBoolValue|null} [isCaseInsensitive] Dataset isCaseInsensitive + * @property {google.protobuf.IStringValue|null} [defaultCollation] Dataset defaultCollation + * @property {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null} [defaultRoundingMode] Dataset defaultRoundingMode + * @property {google.protobuf.IInt64Value|null} [maxTimeTravelHours] Dataset maxTimeTravelHours + * @property {Array.|null} [tags] Dataset tags + * @property {google.cloud.bigquery.v2.Dataset.StorageBillingModel|null} [storageBillingModel] Dataset storageBillingModel + * @property {google.cloud.bigquery.v2.IRestrictionConfig|null} [restrictions] Dataset restrictions + * @property {Object.|null} [resourceTags] Dataset resourceTags + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.bigquery.v2.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + this.labels = {}; + this.access = []; + this.tags = []; + this.resourceTags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.kind = ""; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + /** + * Dataset id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.id = ""; + + /** + * Dataset selfLink. + * @member {string} selfLink + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.selfLink = ""; + + /** + * Dataset datasetReference. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} datasetReference + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.datasetReference = null; + + /** + * Dataset friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.friendlyName = null; + + /** + * Dataset description. + * @member {google.protobuf.IStringValue|null|undefined} description + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.description = null; + + /** + * Dataset defaultTableExpirationMs. + * @member {google.protobuf.IInt64Value|null|undefined} defaultTableExpirationMs + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.defaultTableExpirationMs = null; + + /** + * Dataset defaultPartitionExpirationMs. + * @member {google.protobuf.IInt64Value|null|undefined} defaultPartitionExpirationMs + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.defaultPartitionExpirationMs = null; + + /** + * Dataset labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.labels = $util.emptyObject; + + /** + * Dataset access. + * @member {Array.} access + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.access = $util.emptyArray; + + /** + * Dataset creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Dataset lastModifiedTime. + * @member {number|Long} lastModifiedTime + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.lastModifiedTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Dataset location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.location = ""; + + /** + * Dataset defaultEncryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} defaultEncryptionConfiguration + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.defaultEncryptionConfiguration = null; + + /** + * Dataset satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.satisfiesPzs = null; + + /** + * Dataset satisfiesPzi. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzi + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.satisfiesPzi = null; + + /** + * Dataset type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.type = ""; + + /** + * Dataset catalogSource. + * @member {string|null|undefined} catalogSource + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.catalogSource = null; + + /** + * Dataset linkedDatasetSource. + * @member {google.cloud.bigquery.v2.ILinkedDatasetSource|null|undefined} linkedDatasetSource + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.linkedDatasetSource = null; + + /** + * Dataset linkedDatasetMetadata. + * @member {google.cloud.bigquery.v2.ILinkedDatasetMetadata|null|undefined} linkedDatasetMetadata + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.linkedDatasetMetadata = null; + + /** + * Dataset externalDatasetReference. + * @member {google.cloud.bigquery.v2.IExternalDatasetReference|null|undefined} externalDatasetReference + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.externalDatasetReference = null; + + /** + * Dataset externalCatalogDatasetOptions. + * @member {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions|null|undefined} externalCatalogDatasetOptions + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.externalCatalogDatasetOptions = null; + + /** + * Dataset isCaseInsensitive. + * @member {google.protobuf.IBoolValue|null|undefined} isCaseInsensitive + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.isCaseInsensitive = null; + + /** + * Dataset defaultCollation. + * @member {google.protobuf.IStringValue|null|undefined} defaultCollation + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.defaultCollation = null; + + /** + * Dataset defaultRoundingMode. + * @member {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode} defaultRoundingMode + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.defaultRoundingMode = 0; + + /** + * Dataset maxTimeTravelHours. + * @member {google.protobuf.IInt64Value|null|undefined} maxTimeTravelHours + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.maxTimeTravelHours = null; + + /** + * Dataset tags. + * @member {Array.} tags + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.tags = $util.emptyArray; + + /** + * Dataset storageBillingModel. + * @member {google.cloud.bigquery.v2.Dataset.StorageBillingModel} storageBillingModel + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.storageBillingModel = 0; + + /** + * Dataset restrictions. + * @member {google.cloud.bigquery.v2.IRestrictionConfig|null|undefined} restrictions + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.restrictions = null; + + /** + * Dataset resourceTags. + * @member {Object.} resourceTags + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + */ + Dataset.prototype.resourceTags = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Dataset.prototype, "_catalogSource", { + get: $util.oneOfGetter($oneOfFields = ["catalogSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {google.cloud.bigquery.v2.IDataset=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.bigquery.v2.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {google.cloud.bigquery.v2.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.selfLink); + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.datasetReference, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.protobuf.StringValue.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.defaultTableExpirationMs != null && Object.hasOwnProperty.call(message, "defaultTableExpirationMs")) + $root.google.protobuf.Int64Value.encode(message.defaultTableExpirationMs, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.access != null && message.access.length) + for (var i = 0; i < message.access.length; ++i) + $root.google.cloud.bigquery.v2.Access.encode(message.access[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.creationTime); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.lastModifiedTime); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.location); + if (message.defaultPartitionExpirationMs != null && Object.hasOwnProperty.call(message, "defaultPartitionExpirationMs")) + $root.google.protobuf.Int64Value.encode(message.defaultPartitionExpirationMs, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.defaultEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "defaultEncryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.defaultEncryptionConfiguration, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.type); + if (message.linkedDatasetSource != null && Object.hasOwnProperty.call(message, "linkedDatasetSource")) + $root.google.cloud.bigquery.v2.LinkedDatasetSource.encode(message.linkedDatasetSource, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) + $root.google.cloud.bigquery.v2.ExternalDatasetReference.encode(message.externalDatasetReference, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.isCaseInsensitive != null && Object.hasOwnProperty.call(message, "isCaseInsensitive")) + $root.google.protobuf.BoolValue.encode(message.isCaseInsensitive, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) + $root.google.protobuf.StringValue.encode(message.defaultCollation, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.maxTimeTravelHours != null && Object.hasOwnProperty.call(message, "maxTimeTravelHours")) + $root.google.protobuf.Int64Value.encode(message.maxTimeTravelHours, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + $root.google.cloud.bigquery.v2.GcpTag.encode(message.tags[i], writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.storageBillingModel != null && Object.hasOwnProperty.call(message, "storageBillingModel")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.storageBillingModel); + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.defaultRoundingMode); + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) + $root.google.cloud.bigquery.v2.RestrictionConfig.encode(message.restrictions, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.linkedDatasetMetadata != null && Object.hasOwnProperty.call(message, "linkedDatasetMetadata")) + $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.encode(message.linkedDatasetMetadata, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.resourceTags != null && Object.hasOwnProperty.call(message, "resourceTags")) + for (var keys = Object.keys(message.resourceTags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 30, wireType 2 =*/242).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceTags[keys[i]]).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 31, wireType 2 =*/250).fork(), q + 1).ldelim(); + if (message.externalCatalogDatasetOptions != null && Object.hasOwnProperty.call(message, "externalCatalogDatasetOptions")) + $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.encode(message.externalCatalogDatasetOptions, writer.uint32(/* id 32, wireType 2 =*/258).fork(), q + 1).ldelim(); + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.catalogSource); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {google.cloud.bigquery.v2.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Dataset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.selfLink = reader.string(); + break; + } + case 5: { + message.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.description = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.defaultTableExpirationMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.defaultPartitionExpirationMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 10: { + if (!(message.access && message.access.length)) + message.access = []; + message.access.push($root.google.cloud.bigquery.v2.Access.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + message.creationTime = reader.int64(); + break; + } + case 12: { + message.lastModifiedTime = reader.int64(); + break; + } + case 13: { + message.location = reader.string(); + break; + } + case 16: { + message.defaultEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.satisfiesPzi = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.type = reader.string(); + break; + } + case 40: { + message.catalogSource = reader.string(); + break; + } + case 19: { + message.linkedDatasetSource = $root.google.cloud.bigquery.v2.LinkedDatasetSource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 29: { + message.linkedDatasetMetadata = $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 32: { + message.externalCatalogDatasetOptions = $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.isCaseInsensitive = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.defaultCollation = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.defaultRoundingMode = reader.int32(); + break; + } + case 23: { + message.maxTimeTravelHours = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push($root.google.cloud.bigquery.v2.GcpTag.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 25: { + message.storageBillingModel = reader.int32(); + break; + } + case 27: { + message.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + if (message.resourceTags === $util.emptyObject) + message.resourceTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.resourceTags, key); + message.resourceTags[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.datasetReference, long + 1); + if (error) + return "datasetReference." + error; + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName, long + 1); + if (error) + return "friendlyName." + error; + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) { + var error = $root.google.protobuf.StringValue.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.defaultTableExpirationMs != null && Object.hasOwnProperty.call(message, "defaultTableExpirationMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.defaultTableExpirationMs, long + 1); + if (error) + return "defaultTableExpirationMs." + error; + } + if (message.defaultPartitionExpirationMs != null && Object.hasOwnProperty.call(message, "defaultPartitionExpirationMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.defaultPartitionExpirationMs, long + 1); + if (error) + return "defaultPartitionExpirationMs." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.access != null && Object.hasOwnProperty.call(message, "access")) { + if (!Array.isArray(message.access)) + return "access: array expected"; + for (var i = 0; i < message.access.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Access.verify(message.access[i], long + 1); + if (error) + return "access." + error; + } + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (!$util.isInteger(message.lastModifiedTime) && !(message.lastModifiedTime && $util.isInteger(message.lastModifiedTime.low) && $util.isInteger(message.lastModifiedTime.high))) + return "lastModifiedTime: integer|Long expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.defaultEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "defaultEncryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.defaultEncryptionConfiguration, long + 1); + if (error) + return "defaultEncryptionConfiguration." + error; + } + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs, long + 1); + if (error) + return "satisfiesPzs." + error; + } + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi, long + 1); + if (error) + return "satisfiesPzi." + error; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) { + properties._catalogSource = 1; + if (!$util.isString(message.catalogSource)) + return "catalogSource: string expected"; + } + if (message.linkedDatasetSource != null && Object.hasOwnProperty.call(message, "linkedDatasetSource")) { + var error = $root.google.cloud.bigquery.v2.LinkedDatasetSource.verify(message.linkedDatasetSource, long + 1); + if (error) + return "linkedDatasetSource." + error; + } + if (message.linkedDatasetMetadata != null && Object.hasOwnProperty.call(message, "linkedDatasetMetadata")) { + var error = $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.verify(message.linkedDatasetMetadata, long + 1); + if (error) + return "linkedDatasetMetadata." + error; + } + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) { + var error = $root.google.cloud.bigquery.v2.ExternalDatasetReference.verify(message.externalDatasetReference, long + 1); + if (error) + return "externalDatasetReference." + error; + } + if (message.externalCatalogDatasetOptions != null && Object.hasOwnProperty.call(message, "externalCatalogDatasetOptions")) { + var error = $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.verify(message.externalCatalogDatasetOptions, long + 1); + if (error) + return "externalCatalogDatasetOptions." + error; + } + if (message.isCaseInsensitive != null && Object.hasOwnProperty.call(message, "isCaseInsensitive")) { + var error = $root.google.protobuf.BoolValue.verify(message.isCaseInsensitive, long + 1); + if (error) + return "isCaseInsensitive." + error; + } + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) { + var error = $root.google.protobuf.StringValue.verify(message.defaultCollation, long + 1); + if (error) + return "defaultCollation." + error; + } + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + switch (message.defaultRoundingMode) { + default: + return "defaultRoundingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maxTimeTravelHours != null && Object.hasOwnProperty.call(message, "maxTimeTravelHours")) { + var error = $root.google.protobuf.Int64Value.verify(message.maxTimeTravelHours, long + 1); + if (error) + return "maxTimeTravelHours." + error; + } + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) { + var error = $root.google.cloud.bigquery.v2.GcpTag.verify(message.tags[i], long + 1); + if (error) + return "tags." + error; + } + } + if (message.storageBillingModel != null && Object.hasOwnProperty.call(message, "storageBillingModel")) + switch (message.storageBillingModel) { + default: + return "storageBillingModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) { + var error = $root.google.cloud.bigquery.v2.RestrictionConfig.verify(message.restrictions, long + 1); + if (error) + return "restrictions." + error; + } + if (message.resourceTags != null && Object.hasOwnProperty.call(message, "resourceTags")) { + if (!$util.isObject(message.resourceTags)) + return "resourceTags: object expected"; + var key = Object.keys(message.resourceTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceTags[key[i]])) + return "resourceTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Dataset) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Dataset: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Dataset(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.datasetReference != null) { + if (!$util.isObject(object.datasetReference)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.datasetReference: object expected"); + message.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.datasetReference, long + 1); + } + if (object.friendlyName != null) { + if (!$util.isObject(object.friendlyName)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName, long + 1); + } + if (object.description != null) { + if (!$util.isObject(object.description)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.description: object expected"); + message.description = $root.google.protobuf.StringValue.fromObject(object.description, long + 1); + } + if (object.defaultTableExpirationMs != null) { + if (!$util.isObject(object.defaultTableExpirationMs)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.defaultTableExpirationMs: object expected"); + message.defaultTableExpirationMs = $root.google.protobuf.Int64Value.fromObject(object.defaultTableExpirationMs, long + 1); + } + if (object.defaultPartitionExpirationMs != null) { + if (!$util.isObject(object.defaultPartitionExpirationMs)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.defaultPartitionExpirationMs: object expected"); + message.defaultPartitionExpirationMs = $root.google.protobuf.Int64Value.fromObject(object.defaultPartitionExpirationMs, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.access) { + if (!Array.isArray(object.access)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.access: array expected"); + message.access = []; + for (var i = 0; i < object.access.length; ++i) { + if (!$util.isObject(object.access[i])) + throw TypeError(".google.cloud.bigquery.v2.Dataset.access: object expected"); + message.access[i] = $root.google.cloud.bigquery.v2.Access.fromObject(object.access[i], long + 1); + } + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.lastModifiedTime != null) + if ($util.Long) + message.lastModifiedTime = $util.Long.fromValue(object.lastModifiedTime, false); + else if (typeof object.lastModifiedTime === "string") + message.lastModifiedTime = parseInt(object.lastModifiedTime, 10); + else if (typeof object.lastModifiedTime === "number") + message.lastModifiedTime = object.lastModifiedTime; + else if (typeof object.lastModifiedTime === "object") + message.lastModifiedTime = new $util.LongBits(object.lastModifiedTime.low >>> 0, object.lastModifiedTime.high >>> 0).toNumber(); + if (object.location != null) + message.location = String(object.location); + if (object.defaultEncryptionConfiguration != null) { + if (!$util.isObject(object.defaultEncryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.defaultEncryptionConfiguration: object expected"); + message.defaultEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.defaultEncryptionConfiguration, long + 1); + } + if (object.satisfiesPzs != null) { + if (!$util.isObject(object.satisfiesPzs)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs, long + 1); + } + if (object.satisfiesPzi != null) { + if (!$util.isObject(object.satisfiesPzi)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.satisfiesPzi: object expected"); + message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi, long + 1); + } + if (object.type != null) + message.type = String(object.type); + if (object.catalogSource != null) + message.catalogSource = String(object.catalogSource); + if (object.linkedDatasetSource != null) { + if (!$util.isObject(object.linkedDatasetSource)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.linkedDatasetSource: object expected"); + message.linkedDatasetSource = $root.google.cloud.bigquery.v2.LinkedDatasetSource.fromObject(object.linkedDatasetSource, long + 1); + } + if (object.linkedDatasetMetadata != null) { + if (!$util.isObject(object.linkedDatasetMetadata)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.linkedDatasetMetadata: object expected"); + message.linkedDatasetMetadata = $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.fromObject(object.linkedDatasetMetadata, long + 1); + } + if (object.externalDatasetReference != null) { + if (!$util.isObject(object.externalDatasetReference)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.externalDatasetReference: object expected"); + message.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.fromObject(object.externalDatasetReference, long + 1); + } + if (object.externalCatalogDatasetOptions != null) { + if (!$util.isObject(object.externalCatalogDatasetOptions)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.externalCatalogDatasetOptions: object expected"); + message.externalCatalogDatasetOptions = $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.fromObject(object.externalCatalogDatasetOptions, long + 1); + } + if (object.isCaseInsensitive != null) { + if (!$util.isObject(object.isCaseInsensitive)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.isCaseInsensitive: object expected"); + message.isCaseInsensitive = $root.google.protobuf.BoolValue.fromObject(object.isCaseInsensitive, long + 1); + } + if (object.defaultCollation != null) { + if (!$util.isObject(object.defaultCollation)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.defaultCollation: object expected"); + message.defaultCollation = $root.google.protobuf.StringValue.fromObject(object.defaultCollation, long + 1); + } + switch (object.defaultRoundingMode) { + default: + if (typeof object.defaultRoundingMode === "number") { + message.defaultRoundingMode = object.defaultRoundingMode; + break; + } + break; + case "ROUNDING_MODE_UNSPECIFIED": + case 0: + message.defaultRoundingMode = 0; + break; + case "ROUND_HALF_AWAY_FROM_ZERO": + case 1: + message.defaultRoundingMode = 1; + break; + case "ROUND_HALF_EVEN": + case 2: + message.defaultRoundingMode = 2; + break; + } + if (object.maxTimeTravelHours != null) { + if (!$util.isObject(object.maxTimeTravelHours)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.maxTimeTravelHours: object expected"); + message.maxTimeTravelHours = $root.google.protobuf.Int64Value.fromObject(object.maxTimeTravelHours, long + 1); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) { + if (!$util.isObject(object.tags[i])) + throw TypeError(".google.cloud.bigquery.v2.Dataset.tags: object expected"); + message.tags[i] = $root.google.cloud.bigquery.v2.GcpTag.fromObject(object.tags[i], long + 1); + } + } + switch (object.storageBillingModel) { + default: + if (typeof object.storageBillingModel === "number") { + message.storageBillingModel = object.storageBillingModel; + break; + } + break; + case "STORAGE_BILLING_MODEL_UNSPECIFIED": + case 0: + message.storageBillingModel = 0; + break; + case "LOGICAL": + case 1: + message.storageBillingModel = 1; + break; + case "PHYSICAL": + case 2: + message.storageBillingModel = 2; + break; + } + if (object.restrictions != null) { + if (!$util.isObject(object.restrictions)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.restrictions: object expected"); + message.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.fromObject(object.restrictions, long + 1); + } + if (object.resourceTags) { + if (!$util.isObject(object.resourceTags)) + throw TypeError(".google.cloud.bigquery.v2.Dataset.resourceTags: object expected"); + message.resourceTags = {}; + for (var keys = Object.keys(object.resourceTags), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.resourceTags, keys[i]); + message.resourceTags[keys[i]] = String(object.resourceTags[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {google.cloud.bigquery.v2.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.access = []; + object.tags = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.resourceTags = {}; + } + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.id = ""; + object.selfLink = ""; + object.datasetReference = null; + object.friendlyName = null; + object.description = null; + object.defaultTableExpirationMs = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastModifiedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.lastModifiedTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.location = ""; + object.defaultPartitionExpirationMs = null; + object.defaultEncryptionConfiguration = null; + object.satisfiesPzs = null; + object.type = ""; + object.linkedDatasetSource = null; + object.externalDatasetReference = null; + object.isCaseInsensitive = null; + object.defaultCollation = null; + object.maxTimeTravelHours = null; + object.storageBillingModel = options.enums === String ? "STORAGE_BILLING_MODEL_UNSPECIFIED" : 0; + object.defaultRoundingMode = options.enums === String ? "ROUNDING_MODE_UNSPECIFIED" : 0; + object.restrictions = null; + object.linkedDatasetMetadata = null; + object.satisfiesPzi = null; + object.externalCatalogDatasetOptions = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + object.selfLink = message.selfLink; + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) + object.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.datasetReference, options, q + 1); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options, q + 1); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = $root.google.protobuf.StringValue.toObject(message.description, options, q + 1); + if (message.defaultTableExpirationMs != null && Object.hasOwnProperty.call(message, "defaultTableExpirationMs")) + object.defaultTableExpirationMs = $root.google.protobuf.Int64Value.toObject(message.defaultTableExpirationMs, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.access && message.access.length) { + object.access = []; + for (var j = 0; j < message.access.length; ++j) + object.access[j] = $root.google.cloud.bigquery.v2.Access.toObject(message.access[j], options, q + 1); + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.lastModifiedTime = typeof message.lastModifiedTime === "number" ? BigInt(message.lastModifiedTime) : $util.Long.fromBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0, false).toBigInt(); + else if (typeof message.lastModifiedTime === "number") + object.lastModifiedTime = options.longs === String ? String(message.lastModifiedTime) : message.lastModifiedTime; + else + object.lastModifiedTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastModifiedTime) : options.longs === Number ? new $util.LongBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0).toNumber() : message.lastModifiedTime; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.defaultPartitionExpirationMs != null && Object.hasOwnProperty.call(message, "defaultPartitionExpirationMs")) + object.defaultPartitionExpirationMs = $root.google.protobuf.Int64Value.toObject(message.defaultPartitionExpirationMs, options, q + 1); + if (message.defaultEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "defaultEncryptionConfiguration")) + object.defaultEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.defaultEncryptionConfiguration, options, q + 1); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options, q + 1); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.linkedDatasetSource != null && Object.hasOwnProperty.call(message, "linkedDatasetSource")) + object.linkedDatasetSource = $root.google.cloud.bigquery.v2.LinkedDatasetSource.toObject(message.linkedDatasetSource, options, q + 1); + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) + object.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.toObject(message.externalDatasetReference, options, q + 1); + if (message.isCaseInsensitive != null && Object.hasOwnProperty.call(message, "isCaseInsensitive")) + object.isCaseInsensitive = $root.google.protobuf.BoolValue.toObject(message.isCaseInsensitive, options, q + 1); + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) + object.defaultCollation = $root.google.protobuf.StringValue.toObject(message.defaultCollation, options, q + 1); + if (message.maxTimeTravelHours != null && Object.hasOwnProperty.call(message, "maxTimeTravelHours")) + object.maxTimeTravelHours = $root.google.protobuf.Int64Value.toObject(message.maxTimeTravelHours, options, q + 1); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = $root.google.cloud.bigquery.v2.GcpTag.toObject(message.tags[j], options, q + 1); + } + if (message.storageBillingModel != null && Object.hasOwnProperty.call(message, "storageBillingModel")) + object.storageBillingModel = options.enums === String ? $root.google.cloud.bigquery.v2.Dataset.StorageBillingModel[message.storageBillingModel] === undefined ? message.storageBillingModel : $root.google.cloud.bigquery.v2.Dataset.StorageBillingModel[message.storageBillingModel] : message.storageBillingModel; + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + object.defaultRoundingMode = options.enums === String ? $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.defaultRoundingMode] === undefined ? message.defaultRoundingMode : $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.defaultRoundingMode] : message.defaultRoundingMode; + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) + object.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.toObject(message.restrictions, options, q + 1); + if (message.linkedDatasetMetadata != null && Object.hasOwnProperty.call(message, "linkedDatasetMetadata")) + object.linkedDatasetMetadata = $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.toObject(message.linkedDatasetMetadata, options, q + 1); + if (message.resourceTags && (keys2 = Object.keys(message.resourceTags)).length) { + object.resourceTags = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.resourceTags, keys2[j]); + object.resourceTags[keys2[j]] = message.resourceTags[keys2[j]]; + } + } + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options, q + 1); + if (message.externalCatalogDatasetOptions != null && Object.hasOwnProperty.call(message, "externalCatalogDatasetOptions")) + object.externalCatalogDatasetOptions = $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.toObject(message.externalCatalogDatasetOptions, options, q + 1); + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) { + object.catalogSource = message.catalogSource; + if (options.oneofs) + object._catalogSource = "catalogSource"; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Dataset"; + }; + + /** + * StorageBillingModel enum. + * @name google.cloud.bigquery.v2.Dataset.StorageBillingModel + * @enum {number} + * @property {number} STORAGE_BILLING_MODEL_UNSPECIFIED=0 STORAGE_BILLING_MODEL_UNSPECIFIED value + * @property {number} LOGICAL=1 LOGICAL value + * @property {number} PHYSICAL=2 PHYSICAL value + */ + Dataset.StorageBillingModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_BILLING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOGICAL"] = 1; + values[valuesById[2] = "PHYSICAL"] = 2; + return values; + })(); + + return Dataset; + })(); + + v2.GcpTag = (function() { + + /** + * Properties of a GcpTag. + * @memberof google.cloud.bigquery.v2 + * @interface IGcpTag + * @property {string|null} [tagKey] GcpTag tagKey + * @property {string|null} [tagValue] GcpTag tagValue + */ + + /** + * Constructs a new GcpTag. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GcpTag. + * @implements IGcpTag + * @constructor + * @param {google.cloud.bigquery.v2.IGcpTag=} [properties] Properties to set + */ + function GcpTag(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcpTag tagKey. + * @member {string} tagKey + * @memberof google.cloud.bigquery.v2.GcpTag + * @instance + */ + GcpTag.prototype.tagKey = ""; + + /** + * GcpTag tagValue. + * @member {string} tagValue + * @memberof google.cloud.bigquery.v2.GcpTag + * @instance + */ + GcpTag.prototype.tagValue = ""; + + /** + * Creates a new GcpTag instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {google.cloud.bigquery.v2.IGcpTag=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GcpTag} GcpTag instance + */ + GcpTag.create = function create(properties) { + return new GcpTag(properties); + }; + + /** + * Encodes the specified GcpTag message. Does not implicitly {@link google.cloud.bigquery.v2.GcpTag.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {google.cloud.bigquery.v2.IGcpTag} message GcpTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpTag.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tagKey); + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagValue); + return writer; + }; + + /** + * Encodes the specified GcpTag message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GcpTag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {google.cloud.bigquery.v2.IGcpTag} message GcpTag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpTag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GcpTag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GcpTag} GcpTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpTag.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GcpTag(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tagKey = reader.string(); + break; + } + case 2: { + message.tagValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GcpTag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GcpTag} GcpTag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpTag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpTag message. + * @function verify + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpTag.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + if (!$util.isString(message.tagKey)) + return "tagKey: string expected"; + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + if (!$util.isString(message.tagValue)) + return "tagValue: string expected"; + return null; + }; + + /** + * Creates a GcpTag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GcpTag} GcpTag + */ + GcpTag.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GcpTag) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GcpTag: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GcpTag(); + if (object.tagKey != null) + message.tagKey = String(object.tagKey); + if (object.tagValue != null) + message.tagValue = String(object.tagValue); + return message; + }; + + /** + * Creates a plain object from a GcpTag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {google.cloud.bigquery.v2.GcpTag} message GcpTag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpTag.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.tagKey = ""; + object.tagValue = ""; + } + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + object.tagKey = message.tagKey; + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + object.tagValue = message.tagValue; + return object; + }; + + /** + * Converts this GcpTag to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GcpTag + * @instance + * @returns {Object.} JSON object + */ + GcpTag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpTag + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GcpTag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpTag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GcpTag"; + }; + + return GcpTag; + })(); + + v2.LinkedDatasetSource = (function() { + + /** + * Properties of a LinkedDatasetSource. + * @memberof google.cloud.bigquery.v2 + * @interface ILinkedDatasetSource + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [sourceDataset] LinkedDatasetSource sourceDataset + */ + + /** + * Constructs a new LinkedDatasetSource. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a LinkedDatasetSource. + * @implements ILinkedDatasetSource + * @constructor + * @param {google.cloud.bigquery.v2.ILinkedDatasetSource=} [properties] Properties to set + */ + function LinkedDatasetSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LinkedDatasetSource sourceDataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} sourceDataset + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @instance + */ + LinkedDatasetSource.prototype.sourceDataset = null; + + /** + * Creates a new LinkedDatasetSource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetSource=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.LinkedDatasetSource} LinkedDatasetSource instance + */ + LinkedDatasetSource.create = function create(properties) { + return new LinkedDatasetSource(properties); + }; + + /** + * Encodes the specified LinkedDatasetSource message. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetSource} message LinkedDatasetSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedDatasetSource.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceDataset != null && Object.hasOwnProperty.call(message, "sourceDataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.sourceDataset, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LinkedDatasetSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetSource} message LinkedDatasetSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedDatasetSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LinkedDatasetSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.LinkedDatasetSource} LinkedDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedDatasetSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.LinkedDatasetSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceDataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedDatasetSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.LinkedDatasetSource} LinkedDatasetSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedDatasetSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedDatasetSource message. + * @function verify + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedDatasetSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sourceDataset != null && Object.hasOwnProperty.call(message, "sourceDataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.sourceDataset, long + 1); + if (error) + return "sourceDataset." + error; + } + return null; + }; + + /** + * Creates a LinkedDatasetSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.LinkedDatasetSource} LinkedDatasetSource + */ + LinkedDatasetSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.LinkedDatasetSource) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.LinkedDatasetSource: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.LinkedDatasetSource(); + if (object.sourceDataset != null) { + if (!$util.isObject(object.sourceDataset)) + throw TypeError(".google.cloud.bigquery.v2.LinkedDatasetSource.sourceDataset: object expected"); + message.sourceDataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.sourceDataset, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LinkedDatasetSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {google.cloud.bigquery.v2.LinkedDatasetSource} message LinkedDatasetSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedDatasetSource.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.sourceDataset = null; + if (message.sourceDataset != null && Object.hasOwnProperty.call(message, "sourceDataset")) + object.sourceDataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.sourceDataset, options, q + 1); + return object; + }; + + /** + * Converts this LinkedDatasetSource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @instance + * @returns {Object.} JSON object + */ + LinkedDatasetSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedDatasetSource + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.LinkedDatasetSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedDatasetSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.LinkedDatasetSource"; + }; + + return LinkedDatasetSource; + })(); + + v2.LinkedDatasetMetadata = (function() { + + /** + * Properties of a LinkedDatasetMetadata. + * @memberof google.cloud.bigquery.v2 + * @interface ILinkedDatasetMetadata + * @property {google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState|null} [linkState] LinkedDatasetMetadata linkState + */ + + /** + * Constructs a new LinkedDatasetMetadata. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a LinkedDatasetMetadata. + * @implements ILinkedDatasetMetadata + * @constructor + * @param {google.cloud.bigquery.v2.ILinkedDatasetMetadata=} [properties] Properties to set + */ + function LinkedDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LinkedDatasetMetadata linkState. + * @member {google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState} linkState + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @instance + */ + LinkedDatasetMetadata.prototype.linkState = 0; + + /** + * Creates a new LinkedDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.LinkedDatasetMetadata} LinkedDatasetMetadata instance + */ + LinkedDatasetMetadata.create = function create(properties) { + return new LinkedDatasetMetadata(properties); + }; + + /** + * Encodes the specified LinkedDatasetMetadata message. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetMetadata} message LinkedDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedDatasetMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.linkState != null && Object.hasOwnProperty.call(message, "linkState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.linkState); + return writer; + }; + + /** + * Encodes the specified LinkedDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LinkedDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {google.cloud.bigquery.v2.ILinkedDatasetMetadata} message LinkedDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LinkedDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.LinkedDatasetMetadata} LinkedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedDatasetMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.LinkedDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.linkState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.LinkedDatasetMetadata} LinkedDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedDatasetMetadata message. + * @function verify + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedDatasetMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.linkState != null && Object.hasOwnProperty.call(message, "linkState")) + switch (message.linkState) { + default: + return "linkState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a LinkedDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.LinkedDatasetMetadata} LinkedDatasetMetadata + */ + LinkedDatasetMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.LinkedDatasetMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.LinkedDatasetMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.LinkedDatasetMetadata(); + switch (object.linkState) { + default: + if (typeof object.linkState === "number") { + message.linkState = object.linkState; + break; + } + break; + case "LINK_STATE_UNSPECIFIED": + case 0: + message.linkState = 0; + break; + case "LINKED": + case 1: + message.linkState = 1; + break; + case "UNLINKED": + case 2: + message.linkState = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a LinkedDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {google.cloud.bigquery.v2.LinkedDatasetMetadata} message LinkedDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedDatasetMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.linkState = options.enums === String ? "LINK_STATE_UNSPECIFIED" : 0; + if (message.linkState != null && Object.hasOwnProperty.call(message, "linkState")) + object.linkState = options.enums === String ? $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState[message.linkState] === undefined ? message.linkState : $root.google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState[message.linkState] : message.linkState; + return object; + }; + + /** + * Converts this LinkedDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + LinkedDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.LinkedDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.LinkedDatasetMetadata"; + }; + + /** + * LinkState enum. + * @name google.cloud.bigquery.v2.LinkedDatasetMetadata.LinkState + * @enum {number} + * @property {number} LINK_STATE_UNSPECIFIED=0 LINK_STATE_UNSPECIFIED value + * @property {number} LINKED=1 LINKED value + * @property {number} UNLINKED=2 UNLINKED value + */ + LinkedDatasetMetadata.LinkState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LINK_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINKED"] = 1; + values[valuesById[2] = "UNLINKED"] = 2; + return values; + })(); + + return LinkedDatasetMetadata; + })(); + + v2.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetDatasetRequest + * @property {string|null} [projectId] GetDatasetRequest projectId + * @property {string|null} [datasetId] GetDatasetRequest datasetId + * @property {google.cloud.bigquery.v2.GetDatasetRequest.DatasetView|null} [datasetView] GetDatasetRequest datasetView + * @property {number|null} [accessPolicyVersion] GetDatasetRequest accessPolicyVersion + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetDatasetRequest=} [properties] Properties to set + */ + function GetDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.projectId = ""; + + /** + * GetDatasetRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.datasetId = ""; + + /** + * GetDatasetRequest datasetView. + * @member {google.cloud.bigquery.v2.GetDatasetRequest.DatasetView} datasetView + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.datasetView = 0; + + /** + * GetDatasetRequest accessPolicyVersion. + * @member {number} accessPolicyVersion + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.accessPolicyVersion = 0; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.datasetView != null && Object.hasOwnProperty.call(message, "datasetView")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.datasetView); + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.accessPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.datasetView = reader.int32(); + break; + } + case 4: { + message.accessPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.datasetView != null && Object.hasOwnProperty.call(message, "datasetView")) + switch (message.datasetView) { + default: + return "datasetView: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + if (!$util.isInteger(message.accessPolicyVersion)) + return "accessPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetDatasetRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetDatasetRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetDatasetRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + switch (object.datasetView) { + default: + if (typeof object.datasetView === "number") { + message.datasetView = object.datasetView; + break; + } + break; + case "DATASET_VIEW_UNSPECIFIED": + case 0: + message.datasetView = 0; + break; + case "METADATA": + case 1: + message.datasetView = 1; + break; + case "ACL": + case 2: + message.datasetView = 2; + break; + case "FULL": + case 3: + message.datasetView = 3; + break; + } + if (object.accessPolicyVersion != null) + message.accessPolicyVersion = object.accessPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.GetDatasetRequest} message GetDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.datasetView = options.enums === String ? "DATASET_VIEW_UNSPECIFIED" : 0; + object.accessPolicyVersion = 0; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.datasetView != null && Object.hasOwnProperty.call(message, "datasetView")) + object.datasetView = options.enums === String ? $root.google.cloud.bigquery.v2.GetDatasetRequest.DatasetView[message.datasetView] === undefined ? message.datasetView : $root.google.cloud.bigquery.v2.GetDatasetRequest.DatasetView[message.datasetView] : message.datasetView; + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + object.accessPolicyVersion = message.accessPolicyVersion; + return object; + }; + + /** + * Converts this GetDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetDatasetRequest"; + }; + + /** + * DatasetView enum. + * @name google.cloud.bigquery.v2.GetDatasetRequest.DatasetView + * @enum {number} + * @property {number} DATASET_VIEW_UNSPECIFIED=0 DATASET_VIEW_UNSPECIFIED value + * @property {number} METADATA=1 METADATA value + * @property {number} ACL=2 ACL value + * @property {number} FULL=3 FULL value + */ + GetDatasetRequest.DatasetView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATASET_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "METADATA"] = 1; + values[valuesById[2] = "ACL"] = 2; + values[valuesById[3] = "FULL"] = 3; + return values; + })(); + + return GetDatasetRequest; + })(); + + v2.InsertDatasetRequest = (function() { + + /** + * Properties of an InsertDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IInsertDatasetRequest + * @property {string|null} [projectId] InsertDatasetRequest projectId + * @property {google.cloud.bigquery.v2.IDataset|null} [dataset] InsertDatasetRequest dataset + * @property {number|null} [accessPolicyVersion] InsertDatasetRequest accessPolicyVersion + */ + + /** + * Constructs a new InsertDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an InsertDatasetRequest. + * @implements IInsertDatasetRequest + * @constructor + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest=} [properties] Properties to set + */ + function InsertDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertDatasetRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @instance + */ + InsertDatasetRequest.prototype.projectId = ""; + + /** + * InsertDatasetRequest dataset. + * @member {google.cloud.bigquery.v2.IDataset|null|undefined} dataset + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @instance + */ + InsertDatasetRequest.prototype.dataset = null; + + /** + * InsertDatasetRequest accessPolicyVersion. + * @member {number} accessPolicyVersion + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @instance + */ + InsertDatasetRequest.prototype.accessPolicyVersion = 0; + + /** + * Creates a new InsertDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.InsertDatasetRequest} InsertDatasetRequest instance + */ + InsertDatasetRequest.create = function create(properties) { + return new InsertDatasetRequest(properties); + }; + + /** + * Encodes the specified InsertDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest} message InsertDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertDatasetRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.bigquery.v2.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.accessPolicyVersion); + return writer; + }; + + /** + * Encodes the specified InsertDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertDatasetRequest} message InsertDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an InsertDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.InsertDatasetRequest} InsertDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertDatasetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.InsertDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.cloud.bigquery.v2.Dataset.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.accessPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsertDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.InsertDatasetRequest} InsertDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertDatasetRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertDatasetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) { + var error = $root.google.cloud.bigquery.v2.Dataset.verify(message.dataset, long + 1); + if (error) + return "dataset." + error; + } + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + if (!$util.isInteger(message.accessPolicyVersion)) + return "accessPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates an InsertDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.InsertDatasetRequest} InsertDatasetRequest + */ + InsertDatasetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.InsertDatasetRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.InsertDatasetRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.InsertDatasetRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.dataset != null) { + if (!$util.isObject(object.dataset)) + throw TypeError(".google.cloud.bigquery.v2.InsertDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.bigquery.v2.Dataset.fromObject(object.dataset, long + 1); + } + if (object.accessPolicyVersion != null) + message.accessPolicyVersion = object.accessPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from an InsertDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.InsertDatasetRequest} message InsertDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertDatasetRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.dataset = null; + object.accessPolicyVersion = 0; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + object.dataset = $root.google.cloud.bigquery.v2.Dataset.toObject(message.dataset, options, q + 1); + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + object.accessPolicyVersion = message.accessPolicyVersion; + return object; + }; + + /** + * Converts this InsertDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + InsertDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.InsertDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.InsertDatasetRequest"; + }; + + return InsertDatasetRequest; + })(); + + v2.UpdateOrPatchDatasetRequest = (function() { + + /** + * Properties of an UpdateOrPatchDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IUpdateOrPatchDatasetRequest + * @property {string|null} [projectId] UpdateOrPatchDatasetRequest projectId + * @property {string|null} [datasetId] UpdateOrPatchDatasetRequest datasetId + * @property {google.cloud.bigquery.v2.IDataset|null} [dataset] UpdateOrPatchDatasetRequest dataset + * @property {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode|null} [updateMode] UpdateOrPatchDatasetRequest updateMode + * @property {number|null} [accessPolicyVersion] UpdateOrPatchDatasetRequest accessPolicyVersion + */ + + /** + * Constructs a new UpdateOrPatchDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an UpdateOrPatchDatasetRequest. + * @implements IUpdateOrPatchDatasetRequest + * @constructor + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest=} [properties] Properties to set + */ + function UpdateOrPatchDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrPatchDatasetRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + */ + UpdateOrPatchDatasetRequest.prototype.projectId = ""; + + /** + * UpdateOrPatchDatasetRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + */ + UpdateOrPatchDatasetRequest.prototype.datasetId = ""; + + /** + * UpdateOrPatchDatasetRequest dataset. + * @member {google.cloud.bigquery.v2.IDataset|null|undefined} dataset + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + */ + UpdateOrPatchDatasetRequest.prototype.dataset = null; + + /** + * UpdateOrPatchDatasetRequest updateMode. + * @member {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode} updateMode + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + */ + UpdateOrPatchDatasetRequest.prototype.updateMode = 0; + + /** + * UpdateOrPatchDatasetRequest accessPolicyVersion. + * @member {number} accessPolicyVersion + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + */ + UpdateOrPatchDatasetRequest.prototype.accessPolicyVersion = 0; + + /** + * Creates a new UpdateOrPatchDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest} UpdateOrPatchDatasetRequest instance + */ + UpdateOrPatchDatasetRequest.create = function create(properties) { + return new UpdateOrPatchDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateOrPatchDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} message UpdateOrPatchDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrPatchDatasetRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.bigquery.v2.Dataset.encode(message.dataset, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.updateMode != null && Object.hasOwnProperty.call(message, "updateMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.updateMode); + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.accessPolicyVersion); + return writer; + }; + + /** + * Encodes the specified UpdateOrPatchDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest} message UpdateOrPatchDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrPatchDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateOrPatchDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest} UpdateOrPatchDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrPatchDatasetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.dataset = $root.google.cloud.bigquery.v2.Dataset.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.updateMode = reader.int32(); + break; + } + case 5: { + message.accessPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrPatchDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest} UpdateOrPatchDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrPatchDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrPatchDatasetRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrPatchDatasetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) { + var error = $root.google.cloud.bigquery.v2.Dataset.verify(message.dataset, long + 1); + if (error) + return "dataset." + error; + } + if (message.updateMode != null && Object.hasOwnProperty.call(message, "updateMode")) + switch (message.updateMode) { + default: + return "updateMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + if (!$util.isInteger(message.accessPolicyVersion)) + return "accessPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates an UpdateOrPatchDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest} UpdateOrPatchDatasetRequest + */ + UpdateOrPatchDatasetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.dataset != null) { + if (!$util.isObject(object.dataset)) + throw TypeError(".google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.bigquery.v2.Dataset.fromObject(object.dataset, long + 1); + } + switch (object.updateMode) { + default: + if (typeof object.updateMode === "number") { + message.updateMode = object.updateMode; + break; + } + break; + case "UPDATE_MODE_UNSPECIFIED": + case 0: + message.updateMode = 0; + break; + case "UPDATE_METADATA": + case 1: + message.updateMode = 1; + break; + case "UPDATE_ACL": + case 2: + message.updateMode = 2; + break; + case "UPDATE_FULL": + case 3: + message.updateMode = 3; + break; + } + if (object.accessPolicyVersion != null) + message.accessPolicyVersion = object.accessPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from an UpdateOrPatchDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest} message UpdateOrPatchDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrPatchDatasetRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.dataset = null; + object.updateMode = options.enums === String ? "UPDATE_MODE_UNSPECIFIED" : 0; + object.accessPolicyVersion = 0; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + object.dataset = $root.google.cloud.bigquery.v2.Dataset.toObject(message.dataset, options, q + 1); + if (message.updateMode != null && Object.hasOwnProperty.call(message, "updateMode")) + object.updateMode = options.enums === String ? $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode[message.updateMode] === undefined ? message.updateMode : $root.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode[message.updateMode] : message.updateMode; + if (message.accessPolicyVersion != null && Object.hasOwnProperty.call(message, "accessPolicyVersion")) + object.accessPolicyVersion = message.accessPolicyVersion; + return object; + }; + + /** + * Converts this UpdateOrPatchDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrPatchDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrPatchDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrPatchDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest"; + }; + + /** + * UpdateMode enum. + * @name google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode + * @enum {number} + * @property {number} UPDATE_MODE_UNSPECIFIED=0 UPDATE_MODE_UNSPECIFIED value + * @property {number} UPDATE_METADATA=1 UPDATE_METADATA value + * @property {number} UPDATE_ACL=2 UPDATE_ACL value + * @property {number} UPDATE_FULL=3 UPDATE_FULL value + */ + UpdateOrPatchDatasetRequest.UpdateMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UPDATE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UPDATE_METADATA"] = 1; + values[valuesById[2] = "UPDATE_ACL"] = 2; + values[valuesById[3] = "UPDATE_FULL"] = 3; + return values; + })(); + + return UpdateOrPatchDatasetRequest; + })(); + + v2.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteDatasetRequest + * @property {string|null} [projectId] DeleteDatasetRequest projectId + * @property {string|null} [datasetId] DeleteDatasetRequest datasetId + * @property {boolean|null} [deleteContents] DeleteDatasetRequest deleteContents + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest=} [properties] Properties to set + */ + function DeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatasetRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.projectId = ""; + + /** + * DeleteDatasetRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.datasetId = ""; + + /** + * DeleteDatasetRequest deleteContents. + * @member {boolean} deleteContents + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.deleteContents = false; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.deleteContents != null && Object.hasOwnProperty.call(message, "deleteContents")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deleteContents); + return writer; + }; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.deleteContents = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatasetRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatasetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.deleteContents != null && Object.hasOwnProperty.call(message, "deleteContents")) + if (typeof message.deleteContents !== "boolean") + return "deleteContents: boolean expected"; + return null; + }; + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteDatasetRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteDatasetRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteDatasetRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.deleteContents != null) + message.deleteContents = Boolean(object.deleteContents); + return message; + }; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatasetRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.deleteContents = false; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.deleteContents != null && Object.hasOwnProperty.call(message, "deleteContents")) + object.deleteContents = message.deleteContents; + return object; + }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v2.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListDatasetsRequest + * @property {string|null} [projectId] ListDatasetsRequest projectId + * @property {google.protobuf.IUInt32Value|null} [maxResults] ListDatasetsRequest maxResults + * @property {string|null} [pageToken] ListDatasetsRequest pageToken + * @property {boolean|null} [all] ListDatasetsRequest all + * @property {string|null} [filter] ListDatasetsRequest filter + */ + + /** + * Constructs a new ListDatasetsRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListDatasetsRequest=} [properties] Properties to set + */ + function ListDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.projectId = ""; + + /** + * ListDatasetsRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.maxResults = null; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * ListDatasetsRequest all. + * @member {boolean} all + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.all = false; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {google.cloud.bigquery.v2.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {google.cloud.bigquery.v2.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.all); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {google.cloud.bigquery.v2.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.all = reader.bool(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListDatasetsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListDatasetsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListDatasetsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.ListDatasetsRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.all != null) + message.all = Boolean(object.all); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {google.cloud.bigquery.v2.ListDatasetsRequest} message ListDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.maxResults = null; + object.pageToken = ""; + object.all = false; + object.filter = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + object.all = message.all; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v2.ListFormatDataset = (function() { + + /** + * Properties of a ListFormatDataset. + * @memberof google.cloud.bigquery.v2 + * @interface IListFormatDataset + * @property {string|null} [kind] ListFormatDataset kind + * @property {string|null} [id] ListFormatDataset id + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [datasetReference] ListFormatDataset datasetReference + * @property {Object.|null} [labels] ListFormatDataset labels + * @property {google.protobuf.IStringValue|null} [friendlyName] ListFormatDataset friendlyName + * @property {string|null} [location] ListFormatDataset location + * @property {string|null} [type] ListFormatDataset type + * @property {string|null} [catalogSource] ListFormatDataset catalogSource + * @property {google.cloud.bigquery.v2.IExternalDatasetReference|null} [externalDatasetReference] ListFormatDataset externalDatasetReference + */ + + /** + * Constructs a new ListFormatDataset. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListFormatDataset. + * @implements IListFormatDataset + * @constructor + * @param {google.cloud.bigquery.v2.IListFormatDataset=} [properties] Properties to set + */ + function ListFormatDataset(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFormatDataset kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.kind = ""; + + /** + * ListFormatDataset id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.id = ""; + + /** + * ListFormatDataset datasetReference. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} datasetReference + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.datasetReference = null; + + /** + * ListFormatDataset labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.labels = $util.emptyObject; + + /** + * ListFormatDataset friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.friendlyName = null; + + /** + * ListFormatDataset location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.location = ""; + + /** + * ListFormatDataset type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.type = ""; + + /** + * ListFormatDataset catalogSource. + * @member {string|null|undefined} catalogSource + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.catalogSource = null; + + /** + * ListFormatDataset externalDatasetReference. + * @member {google.cloud.bigquery.v2.IExternalDatasetReference|null|undefined} externalDatasetReference + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + */ + ListFormatDataset.prototype.externalDatasetReference = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListFormatDataset.prototype, "_catalogSource", { + get: $util.oneOfGetter($oneOfFields = ["catalogSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListFormatDataset instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {google.cloud.bigquery.v2.IListFormatDataset=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListFormatDataset} ListFormatDataset instance + */ + ListFormatDataset.create = function create(properties) { + return new ListFormatDataset(properties); + }; + + /** + * Encodes the specified ListFormatDataset message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {google.cloud.bigquery.v2.IListFormatDataset} message ListFormatDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatDataset.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.datasetReference, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.type); + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) + $root.google.cloud.bigquery.v2.ExternalDatasetReference.encode(message.externalDatasetReference, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.catalogSource); + return writer; + }; + + /** + * Encodes the specified ListFormatDataset message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {google.cloud.bigquery.v2.IListFormatDataset} message ListFormatDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListFormatDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListFormatDataset} ListFormatDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatDataset.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListFormatDataset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 5: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + message.type = reader.string(); + break; + } + case 12: { + message.catalogSource = reader.string(); + break; + } + case 11: { + message.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFormatDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListFormatDataset} ListFormatDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFormatDataset message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFormatDataset.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.datasetReference, long + 1); + if (error) + return "datasetReference." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName, long + 1); + if (error) + return "friendlyName." + error; + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) { + properties._catalogSource = 1; + if (!$util.isString(message.catalogSource)) + return "catalogSource: string expected"; + } + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) { + var error = $root.google.cloud.bigquery.v2.ExternalDatasetReference.verify(message.externalDatasetReference, long + 1); + if (error) + return "externalDatasetReference." + error; + } + return null; + }; + + /** + * Creates a ListFormatDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListFormatDataset} ListFormatDataset + */ + ListFormatDataset.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListFormatDataset) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatDataset: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListFormatDataset(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.id != null) + message.id = String(object.id); + if (object.datasetReference != null) { + if (!$util.isObject(object.datasetReference)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatDataset.datasetReference: object expected"); + message.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.datasetReference, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatDataset.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.friendlyName != null) { + if (!$util.isObject(object.friendlyName)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatDataset.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName, long + 1); + } + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + if (object.catalogSource != null) + message.catalogSource = String(object.catalogSource); + if (object.externalDatasetReference != null) { + if (!$util.isObject(object.externalDatasetReference)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatDataset.externalDatasetReference: object expected"); + message.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.fromObject(object.externalDatasetReference, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListFormatDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {google.cloud.bigquery.v2.ListFormatDataset} message ListFormatDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFormatDataset.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.kind = ""; + object.id = ""; + object.datasetReference = null; + object.friendlyName = null; + object.location = ""; + object.type = ""; + object.externalDatasetReference = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.datasetReference != null && Object.hasOwnProperty.call(message, "datasetReference")) + object.datasetReference = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.datasetReference, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options, q + 1); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.externalDatasetReference != null && Object.hasOwnProperty.call(message, "externalDatasetReference")) + object.externalDatasetReference = $root.google.cloud.bigquery.v2.ExternalDatasetReference.toObject(message.externalDatasetReference, options, q + 1); + if (message.catalogSource != null && Object.hasOwnProperty.call(message, "catalogSource")) { + object.catalogSource = message.catalogSource; + if (options.oneofs) + object._catalogSource = "catalogSource"; + } + return object; + }; + + /** + * Converts this ListFormatDataset to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @instance + * @returns {Object.} JSON object + */ + ListFormatDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFormatDataset + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListFormatDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFormatDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListFormatDataset"; + }; + + return ListFormatDataset; + })(); + + v2.DatasetList = (function() { + + /** + * Properties of a DatasetList. + * @memberof google.cloud.bigquery.v2 + * @interface IDatasetList + * @property {string|null} [kind] DatasetList kind + * @property {string|null} [etag] DatasetList etag + * @property {string|null} [nextPageToken] DatasetList nextPageToken + * @property {Array.|null} [datasets] DatasetList datasets + * @property {Array.|null} [unreachable] DatasetList unreachable + */ + + /** + * Constructs a new DatasetList. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DatasetList. + * @implements IDatasetList + * @constructor + * @param {google.cloud.bigquery.v2.IDatasetList=} [properties] Properties to set + */ + function DatasetList(properties) { + this.datasets = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetList kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + */ + DatasetList.prototype.kind = ""; + + /** + * DatasetList etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + */ + DatasetList.prototype.etag = ""; + + /** + * DatasetList nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + */ + DatasetList.prototype.nextPageToken = ""; + + /** + * DatasetList datasets. + * @member {Array.} datasets + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + */ + DatasetList.prototype.datasets = $util.emptyArray; + + /** + * DatasetList unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + */ + DatasetList.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new DatasetList instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {google.cloud.bigquery.v2.IDatasetList=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DatasetList} DatasetList instance + */ + DatasetList.create = function create(properties) { + return new DatasetList(properties); + }; + + /** + * Encodes the specified DatasetList message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetList.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {google.cloud.bigquery.v2.IDatasetList} message DatasetList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetList.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.bigquery.v2.ListFormatDataset.encode(message.datasets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified DatasetList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {google.cloud.bigquery.v2.IDatasetList} message DatasetList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DatasetList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DatasetList} DatasetList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetList.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DatasetList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.bigquery.v2.ListFormatDataset.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DatasetList} DatasetList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetList message. + * @function verify + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetList.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.datasets != null && Object.hasOwnProperty.call(message, "datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ListFormatDataset.verify(message.datasets[i], long + 1); + if (error) + return "datasets." + error; + } + } + if (message.unreachable != null && Object.hasOwnProperty.call(message, "unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a DatasetList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DatasetList} DatasetList + */ + DatasetList.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DatasetList) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DatasetList: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DatasetList(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.bigquery.v2.DatasetList.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (!$util.isObject(object.datasets[i])) + throw TypeError(".google.cloud.bigquery.v2.DatasetList.datasets: object expected"); + message.datasets[i] = $root.google.cloud.bigquery.v2.ListFormatDataset.fromObject(object.datasets[i], long + 1); + } + } + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.bigquery.v2.DatasetList.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a DatasetList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {google.cloud.bigquery.v2.DatasetList} message DatasetList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetList.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.datasets = []; + object.unreachable = []; + } + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.nextPageToken = ""; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.bigquery.v2.ListFormatDataset.toObject(message.datasets[j], options, q + 1); + } + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this DatasetList to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DatasetList + * @instance + * @returns {Object.} JSON object + */ + DatasetList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetList + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DatasetList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DatasetList"; + }; + + return DatasetList; + })(); + + v2.UndeleteDatasetRequest = (function() { + + /** + * Properties of an UndeleteDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IUndeleteDatasetRequest + * @property {string|null} [projectId] UndeleteDatasetRequest projectId + * @property {string|null} [datasetId] UndeleteDatasetRequest datasetId + * @property {google.protobuf.ITimestamp|null} [deletionTime] UndeleteDatasetRequest deletionTime + */ + + /** + * Constructs a new UndeleteDatasetRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an UndeleteDatasetRequest. + * @implements IUndeleteDatasetRequest + * @constructor + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest=} [properties] Properties to set + */ + function UndeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteDatasetRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @instance + */ + UndeleteDatasetRequest.prototype.projectId = ""; + + /** + * UndeleteDatasetRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @instance + */ + UndeleteDatasetRequest.prototype.datasetId = ""; + + /** + * UndeleteDatasetRequest deletionTime. + * @member {google.protobuf.ITimestamp|null|undefined} deletionTime + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @instance + */ + UndeleteDatasetRequest.prototype.deletionTime = null; + + /** + * Creates a new UndeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UndeleteDatasetRequest} UndeleteDatasetRequest instance + */ + UndeleteDatasetRequest.create = function create(properties) { + return new UndeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified UndeleteDatasetRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UndeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest} message UndeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteDatasetRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) + $root.google.protobuf.Timestamp.encode(message.deletionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UndeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.IUndeleteDatasetRequest} message UndeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UndeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UndeleteDatasetRequest} UndeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteDatasetRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UndeleteDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.deletionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UndeleteDatasetRequest} UndeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteDatasetRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteDatasetRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deletionTime, long + 1); + if (error) + return "deletionTime." + error; + } + return null; + }; + + /** + * Creates an UndeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UndeleteDatasetRequest} UndeleteDatasetRequest + */ + UndeleteDatasetRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UndeleteDatasetRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UndeleteDatasetRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UndeleteDatasetRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.deletionTime != null) { + if (!$util.isObject(object.deletionTime)) + throw TypeError(".google.cloud.bigquery.v2.UndeleteDatasetRequest.deletionTime: object expected"); + message.deletionTime = $root.google.protobuf.Timestamp.fromObject(object.deletionTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UndeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {google.cloud.bigquery.v2.UndeleteDatasetRequest} message UndeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteDatasetRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.deletionTime = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.deletionTime != null && Object.hasOwnProperty.call(message, "deletionTime")) + object.deletionTime = $root.google.protobuf.Timestamp.toObject(message.deletionTime, options, q + 1); + return object; + }; + + /** + * Converts this UndeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UndeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UndeleteDatasetRequest"; + }; + + return UndeleteDatasetRequest; + })(); + + v2.DatasetReference = (function() { + + /** + * Properties of a DatasetReference. + * @memberof google.cloud.bigquery.v2 + * @interface IDatasetReference + * @property {string|null} [datasetId] DatasetReference datasetId + * @property {string|null} [projectId] DatasetReference projectId + */ + + /** + * Constructs a new DatasetReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DatasetReference. + * @implements IDatasetReference + * @constructor + * @param {google.cloud.bigquery.v2.IDatasetReference=} [properties] Properties to set + */ + function DatasetReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DatasetReference + * @instance + */ + DatasetReference.prototype.datasetId = ""; + + /** + * DatasetReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DatasetReference + * @instance + */ + DatasetReference.prototype.projectId = ""; + + /** + * Creates a new DatasetReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {google.cloud.bigquery.v2.IDatasetReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DatasetReference} DatasetReference instance + */ + DatasetReference.create = function create(properties) { + return new DatasetReference(properties); + }; + + /** + * Encodes the specified DatasetReference message. Does not implicitly {@link google.cloud.bigquery.v2.DatasetReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {google.cloud.bigquery.v2.IDatasetReference} message DatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DatasetReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {google.cloud.bigquery.v2.IDatasetReference} message DatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DatasetReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DatasetReference} DatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DatasetReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.datasetId = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DatasetReference} DatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DatasetReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DatasetReference} DatasetReference + */ + DatasetReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DatasetReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DatasetReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DatasetReference(); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DatasetReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {google.cloud.bigquery.v2.DatasetReference} message DatasetReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.datasetId = ""; + object.projectId = ""; + } + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DatasetReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DatasetReference + * @instance + * @returns {Object.} JSON object + */ + DatasetReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DatasetReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DatasetReference"; + }; + + return DatasetReference; + })(); + + v2.EncryptionConfiguration = (function() { + + /** + * Properties of an EncryptionConfiguration. + * @memberof google.cloud.bigquery.v2 + * @interface IEncryptionConfiguration + * @property {google.protobuf.IStringValue|null} [kmsKeyName] EncryptionConfiguration kmsKeyName + */ + + /** + * Constructs a new EncryptionConfiguration. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an EncryptionConfiguration. + * @implements IEncryptionConfiguration + * @constructor + * @param {google.cloud.bigquery.v2.IEncryptionConfiguration=} [properties] Properties to set + */ + function EncryptionConfiguration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfiguration kmsKeyName. + * @member {google.protobuf.IStringValue|null|undefined} kmsKeyName + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @instance + */ + EncryptionConfiguration.prototype.kmsKeyName = null; + + /** + * Creates a new EncryptionConfiguration instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {google.cloud.bigquery.v2.IEncryptionConfiguration=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.EncryptionConfiguration} EncryptionConfiguration instance + */ + EncryptionConfiguration.create = function create(properties) { + return new EncryptionConfiguration(properties); + }; + + /** + * Encodes the specified EncryptionConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.EncryptionConfiguration.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {google.cloud.bigquery.v2.IEncryptionConfiguration} message EncryptionConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfiguration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + $root.google.protobuf.StringValue.encode(message.kmsKeyName, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EncryptionConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.EncryptionConfiguration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {google.cloud.bigquery.v2.IEncryptionConfiguration} message EncryptionConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfiguration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfiguration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.EncryptionConfiguration} EncryptionConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfiguration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.EncryptionConfiguration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfiguration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.EncryptionConfiguration} EncryptionConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfiguration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfiguration message. + * @function verify + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfiguration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) { + var error = $root.google.protobuf.StringValue.verify(message.kmsKeyName, long + 1); + if (error) + return "kmsKeyName." + error; + } + return null; + }; + + /** + * Creates an EncryptionConfiguration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.EncryptionConfiguration} EncryptionConfiguration + */ + EncryptionConfiguration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.EncryptionConfiguration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.EncryptionConfiguration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.EncryptionConfiguration(); + if (object.kmsKeyName != null) { + if (!$util.isObject(object.kmsKeyName)) + throw TypeError(".google.cloud.bigquery.v2.EncryptionConfiguration.kmsKeyName: object expected"); + message.kmsKeyName = $root.google.protobuf.StringValue.fromObject(object.kmsKeyName, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EncryptionConfiguration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {google.cloud.bigquery.v2.EncryptionConfiguration} message EncryptionConfiguration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfiguration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.kmsKeyName = null; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + object.kmsKeyName = $root.google.protobuf.StringValue.toObject(message.kmsKeyName, options, q + 1); + return object; + }; + + /** + * Converts this EncryptionConfiguration to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfiguration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfiguration + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.EncryptionConfiguration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfiguration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.EncryptionConfiguration"; + }; + + return EncryptionConfiguration; + })(); + + v2.ExternalCatalogDatasetOptions = (function() { + + /** + * Properties of an ExternalCatalogDatasetOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalCatalogDatasetOptions + * @property {Object.|null} [parameters] ExternalCatalogDatasetOptions parameters + * @property {string|null} [defaultStorageLocationUri] ExternalCatalogDatasetOptions defaultStorageLocationUri + */ + + /** + * Constructs a new ExternalCatalogDatasetOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalCatalogDatasetOptions. + * @implements IExternalCatalogDatasetOptions + * @constructor + * @param {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions=} [properties] Properties to set + */ + function ExternalCatalogDatasetOptions(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalCatalogDatasetOptions parameters. + * @member {Object.} parameters + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @instance + */ + ExternalCatalogDatasetOptions.prototype.parameters = $util.emptyObject; + + /** + * ExternalCatalogDatasetOptions defaultStorageLocationUri. + * @member {string} defaultStorageLocationUri + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @instance + */ + ExternalCatalogDatasetOptions.prototype.defaultStorageLocationUri = ""; + + /** + * Creates a new ExternalCatalogDatasetOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalCatalogDatasetOptions} ExternalCatalogDatasetOptions instance + */ + ExternalCatalogDatasetOptions.create = function create(properties) { + return new ExternalCatalogDatasetOptions(properties); + }; + + /** + * Encodes the specified ExternalCatalogDatasetOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions} message ExternalCatalogDatasetOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalCatalogDatasetOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + if (message.defaultStorageLocationUri != null && Object.hasOwnProperty.call(message, "defaultStorageLocationUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultStorageLocationUri); + return writer; + }; + + /** + * Encodes the specified ExternalCatalogDatasetOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogDatasetOptions} message ExternalCatalogDatasetOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalCatalogDatasetOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalCatalogDatasetOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalCatalogDatasetOptions} ExternalCatalogDatasetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalCatalogDatasetOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + case 2: { + message.defaultStorageLocationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalCatalogDatasetOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalCatalogDatasetOptions} ExternalCatalogDatasetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalCatalogDatasetOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalCatalogDatasetOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalCatalogDatasetOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.defaultStorageLocationUri != null && Object.hasOwnProperty.call(message, "defaultStorageLocationUri")) + if (!$util.isString(message.defaultStorageLocationUri)) + return "defaultStorageLocationUri: string expected"; + return null; + }; + + /** + * Creates an ExternalCatalogDatasetOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalCatalogDatasetOptions} ExternalCatalogDatasetOptions + */ + ExternalCatalogDatasetOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalCatalogDatasetOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalCatalogDatasetOptions(); + if (object.parameters) { + if (!$util.isObject(object.parameters)) + throw TypeError(".google.cloud.bigquery.v2.ExternalCatalogDatasetOptions.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + } + if (object.defaultStorageLocationUri != null) + message.defaultStorageLocationUri = String(object.defaultStorageLocationUri); + return message; + }; + + /** + * Creates a plain object from an ExternalCatalogDatasetOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {google.cloud.bigquery.v2.ExternalCatalogDatasetOptions} message ExternalCatalogDatasetOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalCatalogDatasetOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) + object.defaultStorageLocationUri = ""; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + } + if (message.defaultStorageLocationUri != null && Object.hasOwnProperty.call(message, "defaultStorageLocationUri")) + object.defaultStorageLocationUri = message.defaultStorageLocationUri; + return object; + }; + + /** + * Converts this ExternalCatalogDatasetOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @instance + * @returns {Object.} JSON object + */ + ExternalCatalogDatasetOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalCatalogDatasetOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalCatalogDatasetOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalCatalogDatasetOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalCatalogDatasetOptions"; + }; + + return ExternalCatalogDatasetOptions; + })(); + + v2.ExternalDatasetReference = (function() { + + /** + * Properties of an ExternalDatasetReference. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalDatasetReference + * @property {string|null} [externalSource] ExternalDatasetReference externalSource + * @property {string|null} [connection] ExternalDatasetReference connection + */ + + /** + * Constructs a new ExternalDatasetReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalDatasetReference. + * @implements IExternalDatasetReference + * @constructor + * @param {google.cloud.bigquery.v2.IExternalDatasetReference=} [properties] Properties to set + */ + function ExternalDatasetReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalDatasetReference externalSource. + * @member {string} externalSource + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @instance + */ + ExternalDatasetReference.prototype.externalSource = ""; + + /** + * ExternalDatasetReference connection. + * @member {string} connection + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @instance + */ + ExternalDatasetReference.prototype.connection = ""; + + /** + * Creates a new ExternalDatasetReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {google.cloud.bigquery.v2.IExternalDatasetReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalDatasetReference} ExternalDatasetReference instance + */ + ExternalDatasetReference.create = function create(properties) { + return new ExternalDatasetReference(properties); + }; + + /** + * Encodes the specified ExternalDatasetReference message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDatasetReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {google.cloud.bigquery.v2.IExternalDatasetReference} message ExternalDatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalDatasetReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.externalSource != null && Object.hasOwnProperty.call(message, "externalSource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.externalSource); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.connection); + return writer; + }; + + /** + * Encodes the specified ExternalDatasetReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDatasetReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {google.cloud.bigquery.v2.IExternalDatasetReference} message ExternalDatasetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalDatasetReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalDatasetReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalDatasetReference} ExternalDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalDatasetReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalDatasetReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.externalSource = reader.string(); + break; + } + case 3: { + message.connection = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalDatasetReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalDatasetReference} ExternalDatasetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalDatasetReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalDatasetReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalDatasetReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.externalSource != null && Object.hasOwnProperty.call(message, "externalSource")) + if (!$util.isString(message.externalSource)) + return "externalSource: string expected"; + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + return null; + }; + + /** + * Creates an ExternalDatasetReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalDatasetReference} ExternalDatasetReference + */ + ExternalDatasetReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalDatasetReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDatasetReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalDatasetReference(); + if (object.externalSource != null) + message.externalSource = String(object.externalSource); + if (object.connection != null) + message.connection = String(object.connection); + return message; + }; + + /** + * Creates a plain object from an ExternalDatasetReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {google.cloud.bigquery.v2.ExternalDatasetReference} message ExternalDatasetReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalDatasetReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.externalSource = ""; + object.connection = ""; + } + if (message.externalSource != null && Object.hasOwnProperty.call(message, "externalSource")) + object.externalSource = message.externalSource; + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + object.connection = message.connection; + return object; + }; + + /** + * Converts this ExternalDatasetReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @instance + * @returns {Object.} JSON object + */ + ExternalDatasetReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalDatasetReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalDatasetReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalDatasetReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalDatasetReference"; + }; + + return ExternalDatasetReference; + })(); + + v2.RestrictionConfig = (function() { + + /** + * Properties of a RestrictionConfig. + * @memberof google.cloud.bigquery.v2 + * @interface IRestrictionConfig + * @property {google.cloud.bigquery.v2.RestrictionConfig.RestrictionType|null} [type] RestrictionConfig type + */ + + /** + * Constructs a new RestrictionConfig. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RestrictionConfig. + * @implements IRestrictionConfig + * @constructor + * @param {google.cloud.bigquery.v2.IRestrictionConfig=} [properties] Properties to set + */ + function RestrictionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestrictionConfig type. + * @member {google.cloud.bigquery.v2.RestrictionConfig.RestrictionType} type + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @instance + */ + RestrictionConfig.prototype.type = 0; + + /** + * Creates a new RestrictionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {google.cloud.bigquery.v2.IRestrictionConfig=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RestrictionConfig} RestrictionConfig instance + */ + RestrictionConfig.create = function create(properties) { + return new RestrictionConfig(properties); + }; + + /** + * Encodes the specified RestrictionConfig message. Does not implicitly {@link google.cloud.bigquery.v2.RestrictionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {google.cloud.bigquery.v2.IRestrictionConfig} message RestrictionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictionConfig.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified RestrictionConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RestrictionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {google.cloud.bigquery.v2.IRestrictionConfig} message RestrictionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RestrictionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RestrictionConfig} RestrictionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictionConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RestrictionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RestrictionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RestrictionConfig} RestrictionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestrictionConfig message. + * @function verify + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestrictionConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a RestrictionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RestrictionConfig} RestrictionConfig + */ + RestrictionConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RestrictionConfig) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RestrictionConfig: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RestrictionConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "RESTRICTED_DATA_EGRESS": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a RestrictionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {google.cloud.bigquery.v2.RestrictionConfig} message RestrictionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestrictionConfig.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = options.enums === String ? $root.google.cloud.bigquery.v2.RestrictionConfig.RestrictionType[message.type] === undefined ? message.type : $root.google.cloud.bigquery.v2.RestrictionConfig.RestrictionType[message.type] : message.type; + return object; + }; + + /** + * Converts this RestrictionConfig to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @instance + * @returns {Object.} JSON object + */ + RestrictionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestrictionConfig + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RestrictionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RestrictionConfig"; + }; + + /** + * RestrictionType enum. + * @name google.cloud.bigquery.v2.RestrictionConfig.RestrictionType + * @enum {number} + * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value + * @property {number} RESTRICTED_DATA_EGRESS=1 RESTRICTED_DATA_EGRESS value + */ + RestrictionConfig.RestrictionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESTRICTED_DATA_EGRESS"] = 1; + return values; + })(); + + return RestrictionConfig; + })(); + + v2.RoutineReference = (function() { + + /** + * Properties of a RoutineReference. + * @memberof google.cloud.bigquery.v2 + * @interface IRoutineReference + * @property {string|null} [projectId] RoutineReference projectId + * @property {string|null} [datasetId] RoutineReference datasetId + * @property {string|null} [routineId] RoutineReference routineId + */ + + /** + * Constructs a new RoutineReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RoutineReference. + * @implements IRoutineReference + * @constructor + * @param {google.cloud.bigquery.v2.IRoutineReference=} [properties] Properties to set + */ + function RoutineReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutineReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.RoutineReference + * @instance + */ + RoutineReference.prototype.projectId = ""; + + /** + * RoutineReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.RoutineReference + * @instance + */ + RoutineReference.prototype.datasetId = ""; + + /** + * RoutineReference routineId. + * @member {string} routineId + * @memberof google.cloud.bigquery.v2.RoutineReference + * @instance + */ + RoutineReference.prototype.routineId = ""; + + /** + * Creates a new RoutineReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {google.cloud.bigquery.v2.IRoutineReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RoutineReference} RoutineReference instance + */ + RoutineReference.create = function create(properties) { + return new RoutineReference(properties); + }; + + /** + * Encodes the specified RoutineReference message. Does not implicitly {@link google.cloud.bigquery.v2.RoutineReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {google.cloud.bigquery.v2.IRoutineReference} message RoutineReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutineReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.routineId); + return writer; + }; + + /** + * Encodes the specified RoutineReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RoutineReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {google.cloud.bigquery.v2.IRoutineReference} message RoutineReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutineReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RoutineReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RoutineReference} RoutineReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutineReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RoutineReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.routineId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RoutineReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RoutineReference} RoutineReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutineReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutineReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutineReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + if (!$util.isString(message.routineId)) + return "routineId: string expected"; + return null; + }; + + /** + * Creates a RoutineReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RoutineReference} RoutineReference + */ + RoutineReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RoutineReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RoutineReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RoutineReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.routineId != null) + message.routineId = String(object.routineId); + return message; + }; + + /** + * Creates a plain object from a RoutineReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {google.cloud.bigquery.v2.RoutineReference} message RoutineReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutineReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.routineId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + object.routineId = message.routineId; + return object; + }; + + /** + * Converts this RoutineReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RoutineReference + * @instance + * @returns {Object.} JSON object + */ + RoutineReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutineReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RoutineReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutineReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RoutineReference"; + }; + + return RoutineReference; + })(); + + v2.TableReference = (function() { + + /** + * Properties of a TableReference. + * @memberof google.cloud.bigquery.v2 + * @interface ITableReference + * @property {string|null} [projectId] TableReference projectId + * @property {string|null} [datasetId] TableReference datasetId + * @property {string|null} [tableId] TableReference tableId + */ + + /** + * Constructs a new TableReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableReference. + * @implements ITableReference + * @constructor + * @param {google.cloud.bigquery.v2.ITableReference=} [properties] Properties to set + */ + function TableReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.TableReference + * @instance + */ + TableReference.prototype.projectId = ""; + + /** + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.TableReference + * @instance + */ + TableReference.prototype.datasetId = ""; + + /** + * TableReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.TableReference + * @instance + */ + TableReference.prototype.tableId = ""; + + /** + * Creates a new TableReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {google.cloud.bigquery.v2.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableReference} TableReference instance + */ + TableReference.create = function create(properties) { + return new TableReference(properties); + }; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.v2.TableReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {google.cloud.bigquery.v2.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {google.cloud.bigquery.v2.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableReference} TableReference + */ + TableReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {google.cloud.bigquery.v2.TableReference} message TableReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this TableReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableReference + * @instance + * @returns {Object.} JSON object + */ + TableReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableReference"; + }; + + return TableReference; + })(); + + v2.TableSchema = (function() { + + /** + * Properties of a TableSchema. + * @memberof google.cloud.bigquery.v2 + * @interface ITableSchema + * @property {Array.|null} [fields] TableSchema fields + * @property {google.cloud.bigquery.v2.IForeignTypeInfo|null} [foreignTypeInfo] TableSchema foreignTypeInfo + */ + + /** + * Constructs a new TableSchema. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableSchema. + * @implements ITableSchema + * @constructor + * @param {google.cloud.bigquery.v2.ITableSchema=} [properties] Properties to set + */ + function TableSchema(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableSchema fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.v2.TableSchema + * @instance + */ + TableSchema.prototype.fields = $util.emptyArray; + + /** + * TableSchema foreignTypeInfo. + * @member {google.cloud.bigquery.v2.IForeignTypeInfo|null|undefined} foreignTypeInfo + * @memberof google.cloud.bigquery.v2.TableSchema + * @instance + */ + TableSchema.prototype.foreignTypeInfo = null; + + /** + * Creates a new TableSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {google.cloud.bigquery.v2.ITableSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableSchema} TableSchema instance + */ + TableSchema.create = function create(properties) { + return new TableSchema(properties); + }; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.bigquery.v2.TableSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {google.cloud.bigquery.v2.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.v2.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.foreignTypeInfo != null && Object.hasOwnProperty.call(message, "foreignTypeInfo")) + $root.google.cloud.bigquery.v2.ForeignTypeInfo.encode(message.foreignTypeInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {google.cloud.bigquery.v2.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.v2.TableFieldSchema.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.foreignTypeInfo = $root.google.cloud.bigquery.v2.ForeignTypeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSchema message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.verify(message.fields[i], long + 1); + if (error) + return "fields." + error; + } + } + if (message.foreignTypeInfo != null && Object.hasOwnProperty.call(message, "foreignTypeInfo")) { + var error = $root.google.cloud.bigquery.v2.ForeignTypeInfo.verify(message.foreignTypeInfo, long + 1); + if (error) + return "foreignTypeInfo." + error; + } + return null; + }; + + /** + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableSchema} TableSchema + */ + TableSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableSchema) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableSchema: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableSchema(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.v2.TableSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (!$util.isObject(object.fields[i])) + throw TypeError(".google.cloud.bigquery.v2.TableSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.v2.TableFieldSchema.fromObject(object.fields[i], long + 1); + } + } + if (object.foreignTypeInfo != null) { + if (!$util.isObject(object.foreignTypeInfo)) + throw TypeError(".google.cloud.bigquery.v2.TableSchema.foreignTypeInfo: object expected"); + message.foreignTypeInfo = $root.google.cloud.bigquery.v2.ForeignTypeInfo.fromObject(object.foreignTypeInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {google.cloud.bigquery.v2.TableSchema} message TableSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSchema.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.foreignTypeInfo = null; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.v2.TableFieldSchema.toObject(message.fields[j], options, q + 1); + } + if (message.foreignTypeInfo != null && Object.hasOwnProperty.call(message, "foreignTypeInfo")) + object.foreignTypeInfo = $root.google.cloud.bigquery.v2.ForeignTypeInfo.toObject(message.foreignTypeInfo, options, q + 1); + return object; + }; + + /** + * Converts this TableSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableSchema + * @instance + * @returns {Object.} JSON object + */ + TableSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableSchema"; + }; + + return TableSchema; + })(); + + v2.ForeignTypeInfo = (function() { + + /** + * Properties of a ForeignTypeInfo. + * @memberof google.cloud.bigquery.v2 + * @interface IForeignTypeInfo + * @property {google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem|null} [typeSystem] ForeignTypeInfo typeSystem + */ + + /** + * Constructs a new ForeignTypeInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ForeignTypeInfo. + * @implements IForeignTypeInfo + * @constructor + * @param {google.cloud.bigquery.v2.IForeignTypeInfo=} [properties] Properties to set + */ + function ForeignTypeInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForeignTypeInfo typeSystem. + * @member {google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem} typeSystem + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @instance + */ + ForeignTypeInfo.prototype.typeSystem = 0; + + /** + * Creates a new ForeignTypeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {google.cloud.bigquery.v2.IForeignTypeInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ForeignTypeInfo} ForeignTypeInfo instance + */ + ForeignTypeInfo.create = function create(properties) { + return new ForeignTypeInfo(properties); + }; + + /** + * Encodes the specified ForeignTypeInfo message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignTypeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {google.cloud.bigquery.v2.IForeignTypeInfo} message ForeignTypeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignTypeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.typeSystem != null && Object.hasOwnProperty.call(message, "typeSystem")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.typeSystem); + return writer; + }; + + /** + * Encodes the specified ForeignTypeInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignTypeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {google.cloud.bigquery.v2.IForeignTypeInfo} message ForeignTypeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignTypeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ForeignTypeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ForeignTypeInfo} ForeignTypeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignTypeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ForeignTypeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.typeSystem = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForeignTypeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ForeignTypeInfo} ForeignTypeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignTypeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForeignTypeInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForeignTypeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.typeSystem != null && Object.hasOwnProperty.call(message, "typeSystem")) + switch (message.typeSystem) { + default: + return "typeSystem: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ForeignTypeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ForeignTypeInfo} ForeignTypeInfo + */ + ForeignTypeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ForeignTypeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ForeignTypeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ForeignTypeInfo(); + switch (object.typeSystem) { + default: + if (typeof object.typeSystem === "number") { + message.typeSystem = object.typeSystem; + break; + } + break; + case "TYPE_SYSTEM_UNSPECIFIED": + case 0: + message.typeSystem = 0; + break; + case "HIVE": + case 1: + message.typeSystem = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ForeignTypeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {google.cloud.bigquery.v2.ForeignTypeInfo} message ForeignTypeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForeignTypeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.typeSystem = options.enums === String ? "TYPE_SYSTEM_UNSPECIFIED" : 0; + if (message.typeSystem != null && Object.hasOwnProperty.call(message, "typeSystem")) + object.typeSystem = options.enums === String ? $root.google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem[message.typeSystem] === undefined ? message.typeSystem : $root.google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem[message.typeSystem] : message.typeSystem; + return object; + }; + + /** + * Converts this ForeignTypeInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @instance + * @returns {Object.} JSON object + */ + ForeignTypeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForeignTypeInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ForeignTypeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForeignTypeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ForeignTypeInfo"; + }; + + /** + * TypeSystem enum. + * @name google.cloud.bigquery.v2.ForeignTypeInfo.TypeSystem + * @enum {number} + * @property {number} TYPE_SYSTEM_UNSPECIFIED=0 TYPE_SYSTEM_UNSPECIFIED value + * @property {number} HIVE=1 HIVE value + */ + ForeignTypeInfo.TypeSystem = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_SYSTEM_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIVE"] = 1; + return values; + })(); + + return ForeignTypeInfo; + })(); + + v2.DataPolicyOption = (function() { + + /** + * Properties of a DataPolicyOption. + * @memberof google.cloud.bigquery.v2 + * @interface IDataPolicyOption + * @property {string|null} [name] DataPolicyOption name + */ + + /** + * Constructs a new DataPolicyOption. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DataPolicyOption. + * @implements IDataPolicyOption + * @constructor + * @param {google.cloud.bigquery.v2.IDataPolicyOption=} [properties] Properties to set + */ + function DataPolicyOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataPolicyOption name. + * @member {string|null|undefined} name + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @instance + */ + DataPolicyOption.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataPolicyOption.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataPolicyOption instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyOption=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DataPolicyOption} DataPolicyOption instance + */ + DataPolicyOption.create = function create(properties) { + return new DataPolicyOption(properties); + }; + + /** + * Encodes the specified DataPolicyOption message. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyOption} message DataPolicyOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicyOption.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DataPolicyOption message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyOption} message DataPolicyOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicyOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataPolicyOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DataPolicyOption} DataPolicyOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicyOption.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DataPolicyOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataPolicyOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DataPolicyOption} DataPolicyOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicyOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataPolicyOption message. + * @function verify + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataPolicyOption.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a DataPolicyOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DataPolicyOption} DataPolicyOption + */ + DataPolicyOption.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DataPolicyOption) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DataPolicyOption: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DataPolicyOption(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DataPolicyOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {google.cloud.bigquery.v2.DataPolicyOption} message DataPolicyOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataPolicyOption.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + return object; + }; + + /** + * Converts this DataPolicyOption to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @instance + * @returns {Object.} JSON object + */ + DataPolicyOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataPolicyOption + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DataPolicyOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataPolicyOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DataPolicyOption"; + }; + + return DataPolicyOption; + })(); + + v2.DataPolicyList = (function() { + + /** + * Properties of a DataPolicyList. + * @memberof google.cloud.bigquery.v2 + * @interface IDataPolicyList + * @property {Array.|null} [dataPolicies] DataPolicyList dataPolicies + */ + + /** + * Constructs a new DataPolicyList. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DataPolicyList. + * @implements IDataPolicyList + * @constructor + * @param {google.cloud.bigquery.v2.IDataPolicyList=} [properties] Properties to set + */ + function DataPolicyList(properties) { + this.dataPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataPolicyList dataPolicies. + * @member {Array.} dataPolicies + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @instance + */ + DataPolicyList.prototype.dataPolicies = $util.emptyArray; + + /** + * Creates a new DataPolicyList instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyList=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DataPolicyList} DataPolicyList instance + */ + DataPolicyList.create = function create(properties) { + return new DataPolicyList(properties); + }; + + /** + * Encodes the specified DataPolicyList message. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyList} message DataPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicyList.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.dataPolicies != null && message.dataPolicies.length) + for (var i = 0; i < message.dataPolicies.length; ++i) + $root.google.cloud.bigquery.v2.DataPolicyOption.encode(message.dataPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataPolicyList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataPolicyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {google.cloud.bigquery.v2.IDataPolicyList} message DataPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPolicyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataPolicyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DataPolicyList} DataPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicyList.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DataPolicyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPolicies && message.dataPolicies.length)) + message.dataPolicies = []; + message.dataPolicies.push($root.google.cloud.bigquery.v2.DataPolicyOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataPolicyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DataPolicyList} DataPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPolicyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataPolicyList message. + * @function verify + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataPolicyList.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataPolicies != null && Object.hasOwnProperty.call(message, "dataPolicies")) { + if (!Array.isArray(message.dataPolicies)) + return "dataPolicies: array expected"; + for (var i = 0; i < message.dataPolicies.length; ++i) { + var error = $root.google.cloud.bigquery.v2.DataPolicyOption.verify(message.dataPolicies[i], long + 1); + if (error) + return "dataPolicies." + error; + } + } + return null; + }; + + /** + * Creates a DataPolicyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DataPolicyList} DataPolicyList + */ + DataPolicyList.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DataPolicyList) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DataPolicyList: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DataPolicyList(); + if (object.dataPolicies) { + if (!Array.isArray(object.dataPolicies)) + throw TypeError(".google.cloud.bigquery.v2.DataPolicyList.dataPolicies: array expected"); + message.dataPolicies = []; + for (var i = 0; i < object.dataPolicies.length; ++i) { + if (!$util.isObject(object.dataPolicies[i])) + throw TypeError(".google.cloud.bigquery.v2.DataPolicyList.dataPolicies: object expected"); + message.dataPolicies[i] = $root.google.cloud.bigquery.v2.DataPolicyOption.fromObject(object.dataPolicies[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DataPolicyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {google.cloud.bigquery.v2.DataPolicyList} message DataPolicyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataPolicyList.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.dataPolicies = []; + if (message.dataPolicies && message.dataPolicies.length) { + object.dataPolicies = []; + for (var j = 0; j < message.dataPolicies.length; ++j) + object.dataPolicies[j] = $root.google.cloud.bigquery.v2.DataPolicyOption.toObject(message.dataPolicies[j], options, q + 1); + } + return object; + }; + + /** + * Converts this DataPolicyList to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @instance + * @returns {Object.} JSON object + */ + DataPolicyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataPolicyList + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DataPolicyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataPolicyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DataPolicyList"; + }; + + return DataPolicyList; + })(); + + v2.TableFieldSchema = (function() { + + /** + * Properties of a TableFieldSchema. + * @memberof google.cloud.bigquery.v2 + * @interface ITableFieldSchema + * @property {string|null} [name] TableFieldSchema name + * @property {string|null} [type] TableFieldSchema type + * @property {string|null} [mode] TableFieldSchema mode + * @property {Array.|null} [fields] TableFieldSchema fields + * @property {google.protobuf.IStringValue|null} [description] TableFieldSchema description + * @property {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList|null} [policyTags] TableFieldSchema policyTags + * @property {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo|null} [dataGovernanceTagsInfo] TableFieldSchema dataGovernanceTagsInfo + * @property {Array.|null} [dataPolicies] TableFieldSchema dataPolicies + * @property {google.cloud.bigquery.v2.IDataPolicyList|null} [dataPolicyList] TableFieldSchema dataPolicyList + * @property {number|Long|null} [maxLength] TableFieldSchema maxLength + * @property {number|Long|null} [precision] TableFieldSchema precision + * @property {number|Long|null} [scale] TableFieldSchema scale + * @property {google.protobuf.IInt64Value|null} [timestampPrecision] TableFieldSchema timestampPrecision + * @property {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null} [roundingMode] TableFieldSchema roundingMode + * @property {google.protobuf.IStringValue|null} [collation] TableFieldSchema collation + * @property {google.protobuf.IStringValue|null} [defaultValueExpression] TableFieldSchema defaultValueExpression + * @property {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType|null} [rangeElementType] TableFieldSchema rangeElementType + * @property {string|null} [foreignTypeDefinition] TableFieldSchema foreignTypeDefinition + * @property {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn|null} [generatedColumn] TableFieldSchema generatedColumn + */ + + /** + * Constructs a new TableFieldSchema. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableFieldSchema. + * @implements ITableFieldSchema + * @constructor + * @param {google.cloud.bigquery.v2.ITableFieldSchema=} [properties] Properties to set + */ + function TableFieldSchema(properties) { + this.fields = []; + this.dataPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableFieldSchema name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.name = ""; + + /** + * TableFieldSchema type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.type = ""; + + /** + * TableFieldSchema mode. + * @member {string} mode + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.mode = ""; + + /** + * TableFieldSchema fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.fields = $util.emptyArray; + + /** + * TableFieldSchema description. + * @member {google.protobuf.IStringValue|null|undefined} description + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.description = null; + + /** + * TableFieldSchema policyTags. + * @member {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList|null|undefined} policyTags + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.policyTags = null; + + /** + * TableFieldSchema dataGovernanceTagsInfo. + * @member {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo|null|undefined} dataGovernanceTagsInfo + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.dataGovernanceTagsInfo = null; + + /** + * TableFieldSchema dataPolicies. + * @member {Array.} dataPolicies + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.dataPolicies = $util.emptyArray; + + /** + * TableFieldSchema dataPolicyList. + * @member {google.cloud.bigquery.v2.IDataPolicyList|null|undefined} dataPolicyList + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.dataPolicyList = null; + + /** + * TableFieldSchema maxLength. + * @member {number|Long} maxLength + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.maxLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableFieldSchema precision. + * @member {number|Long} precision + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.precision = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableFieldSchema scale. + * @member {number|Long} scale + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.scale = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableFieldSchema timestampPrecision. + * @member {google.protobuf.IInt64Value|null|undefined} timestampPrecision + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.timestampPrecision = null; + + /** + * TableFieldSchema roundingMode. + * @member {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode} roundingMode + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.roundingMode = 0; + + /** + * TableFieldSchema collation. + * @member {google.protobuf.IStringValue|null|undefined} collation + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.collation = null; + + /** + * TableFieldSchema defaultValueExpression. + * @member {google.protobuf.IStringValue|null|undefined} defaultValueExpression + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.defaultValueExpression = null; + + /** + * TableFieldSchema rangeElementType. + * @member {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType|null|undefined} rangeElementType + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.rangeElementType = null; + + /** + * TableFieldSchema foreignTypeDefinition. + * @member {string} foreignTypeDefinition + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.foreignTypeDefinition = ""; + + /** + * TableFieldSchema generatedColumn. + * @member {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn|null|undefined} generatedColumn + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.generatedColumn = null; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {google.cloud.bigquery.v2.ITableFieldSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema} TableFieldSchema instance + */ + TableFieldSchema.create = function create(properties) { + return new TableFieldSchema(properties); + }; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {google.cloud.bigquery.v2.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mode); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.v2.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.protobuf.StringValue.encode(message.description, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.policyTags != null && Object.hasOwnProperty.call(message, "policyTags")) + $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.encode(message.policyTags, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.maxLength != null && Object.hasOwnProperty.call(message, "maxLength")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.maxLength); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.precision); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.scale); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + $root.google.protobuf.StringValue.encode(message.collation, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.defaultValueExpression != null && Object.hasOwnProperty.call(message, "defaultValueExpression")) + $root.google.protobuf.StringValue.encode(message.defaultValueExpression, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.roundingMode != null && Object.hasOwnProperty.call(message, "roundingMode")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.roundingMode); + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) + $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.encode(message.rangeElementType, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.dataPolicies != null && message.dataPolicies.length) + for (var i = 0; i < message.dataPolicies.length; ++i) + $root.google.cloud.bigquery.v2.DataPolicyOption.encode(message.dataPolicies[i], writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.foreignTypeDefinition != null && Object.hasOwnProperty.call(message, "foreignTypeDefinition")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.foreignTypeDefinition); + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) + $root.google.protobuf.Int64Value.encode(message.timestampPrecision, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.generatedColumn != null && Object.hasOwnProperty.call(message, "generatedColumn")) + $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.encode(message.generatedColumn, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); + if (message.dataPolicyList != null && Object.hasOwnProperty.call(message, "dataPolicyList")) + $root.google.cloud.bigquery.v2.DataPolicyList.encode(message.dataPolicyList, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.dataGovernanceTagsInfo != null && Object.hasOwnProperty.call(message, "dataGovernanceTagsInfo")) + $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.encode(message.dataGovernanceTagsInfo, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {google.cloud.bigquery.v2.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.mode = reader.string(); + break; + } + case 4: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.v2.TableFieldSchema.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.description = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.policyTags = $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.dataGovernanceTagsInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + if (!(message.dataPolicies && message.dataPolicies.length)) + message.dataPolicies = []; + message.dataPolicies.push($root.google.cloud.bigquery.v2.DataPolicyOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 29: { + message.dataPolicyList = $root.google.cloud.bigquery.v2.DataPolicyList.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.maxLength = reader.int64(); + break; + } + case 11: { + message.precision = reader.int64(); + break; + } + case 12: { + message.scale = reader.int64(); + break; + } + case 27: { + message.timestampPrecision = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.roundingMode = reader.int32(); + break; + } + case 13: { + message.collation = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.defaultValueExpression = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.rangeElementType = $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.foreignTypeDefinition = reader.string(); + break; + } + case 28: { + message.generatedColumn = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableFieldSchema message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableFieldSchema.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + if (!$util.isString(message.mode)) + return "mode: string expected"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.verify(message.fields[i], long + 1); + if (error) + return "fields." + error; + } + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) { + var error = $root.google.protobuf.StringValue.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.policyTags != null && Object.hasOwnProperty.call(message, "policyTags")) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.verify(message.policyTags, long + 1); + if (error) + return "policyTags." + error; + } + if (message.dataGovernanceTagsInfo != null && Object.hasOwnProperty.call(message, "dataGovernanceTagsInfo")) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.verify(message.dataGovernanceTagsInfo, long + 1); + if (error) + return "dataGovernanceTagsInfo." + error; + } + if (message.dataPolicies != null && Object.hasOwnProperty.call(message, "dataPolicies")) { + if (!Array.isArray(message.dataPolicies)) + return "dataPolicies: array expected"; + for (var i = 0; i < message.dataPolicies.length; ++i) { + var error = $root.google.cloud.bigquery.v2.DataPolicyOption.verify(message.dataPolicies[i], long + 1); + if (error) + return "dataPolicies." + error; + } + } + if (message.dataPolicyList != null && Object.hasOwnProperty.call(message, "dataPolicyList")) { + var error = $root.google.cloud.bigquery.v2.DataPolicyList.verify(message.dataPolicyList, long + 1); + if (error) + return "dataPolicyList." + error; + } + if (message.maxLength != null && Object.hasOwnProperty.call(message, "maxLength")) + if (!$util.isInteger(message.maxLength) && !(message.maxLength && $util.isInteger(message.maxLength.low) && $util.isInteger(message.maxLength.high))) + return "maxLength: integer|Long expected"; + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + if (!$util.isInteger(message.precision) && !(message.precision && $util.isInteger(message.precision.low) && $util.isInteger(message.precision.high))) + return "precision: integer|Long expected"; + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + if (!$util.isInteger(message.scale) && !(message.scale && $util.isInteger(message.scale.low) && $util.isInteger(message.scale.high))) + return "scale: integer|Long expected"; + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) { + var error = $root.google.protobuf.Int64Value.verify(message.timestampPrecision, long + 1); + if (error) + return "timestampPrecision." + error; + } + if (message.roundingMode != null && Object.hasOwnProperty.call(message, "roundingMode")) + switch (message.roundingMode) { + default: + return "roundingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) { + var error = $root.google.protobuf.StringValue.verify(message.collation, long + 1); + if (error) + return "collation." + error; + } + if (message.defaultValueExpression != null && Object.hasOwnProperty.call(message, "defaultValueExpression")) { + var error = $root.google.protobuf.StringValue.verify(message.defaultValueExpression, long + 1); + if (error) + return "defaultValueExpression." + error; + } + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.verify(message.rangeElementType, long + 1); + if (error) + return "rangeElementType." + error; + } + if (message.foreignTypeDefinition != null && Object.hasOwnProperty.call(message, "foreignTypeDefinition")) + if (!$util.isString(message.foreignTypeDefinition)) + return "foreignTypeDefinition: string expected"; + if (message.generatedColumn != null && Object.hasOwnProperty.call(message, "generatedColumn")) { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.verify(message.generatedColumn, long + 1); + if (error) + return "generatedColumn." + error; + } + return null; + }; + + /** + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema} TableFieldSchema + */ + TableFieldSchema.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.mode != null) + message.mode = String(object.mode); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (!$util.isObject(object.fields[i])) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.v2.TableFieldSchema.fromObject(object.fields[i], long + 1); + } + } + if (object.description != null) { + if (!$util.isObject(object.description)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.description: object expected"); + message.description = $root.google.protobuf.StringValue.fromObject(object.description, long + 1); + } + if (object.policyTags != null) { + if (!$util.isObject(object.policyTags)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.policyTags: object expected"); + message.policyTags = $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.fromObject(object.policyTags, long + 1); + } + if (object.dataGovernanceTagsInfo != null) { + if (!$util.isObject(object.dataGovernanceTagsInfo)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.dataGovernanceTagsInfo: object expected"); + message.dataGovernanceTagsInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.fromObject(object.dataGovernanceTagsInfo, long + 1); + } + if (object.dataPolicies) { + if (!Array.isArray(object.dataPolicies)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.dataPolicies: array expected"); + message.dataPolicies = []; + for (var i = 0; i < object.dataPolicies.length; ++i) { + if (!$util.isObject(object.dataPolicies[i])) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.dataPolicies: object expected"); + message.dataPolicies[i] = $root.google.cloud.bigquery.v2.DataPolicyOption.fromObject(object.dataPolicies[i], long + 1); + } + } + if (object.dataPolicyList != null) { + if (!$util.isObject(object.dataPolicyList)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.dataPolicyList: object expected"); + message.dataPolicyList = $root.google.cloud.bigquery.v2.DataPolicyList.fromObject(object.dataPolicyList, long + 1); + } + if (object.maxLength != null) + if ($util.Long) + message.maxLength = $util.Long.fromValue(object.maxLength, false); + else if (typeof object.maxLength === "string") + message.maxLength = parseInt(object.maxLength, 10); + else if (typeof object.maxLength === "number") + message.maxLength = object.maxLength; + else if (typeof object.maxLength === "object") + message.maxLength = new $util.LongBits(object.maxLength.low >>> 0, object.maxLength.high >>> 0).toNumber(); + if (object.precision != null) + if ($util.Long) + message.precision = $util.Long.fromValue(object.precision, false); + else if (typeof object.precision === "string") + message.precision = parseInt(object.precision, 10); + else if (typeof object.precision === "number") + message.precision = object.precision; + else if (typeof object.precision === "object") + message.precision = new $util.LongBits(object.precision.low >>> 0, object.precision.high >>> 0).toNumber(); + if (object.scale != null) + if ($util.Long) + message.scale = $util.Long.fromValue(object.scale, false); + else if (typeof object.scale === "string") + message.scale = parseInt(object.scale, 10); + else if (typeof object.scale === "number") + message.scale = object.scale; + else if (typeof object.scale === "object") + message.scale = new $util.LongBits(object.scale.low >>> 0, object.scale.high >>> 0).toNumber(); + if (object.timestampPrecision != null) { + if (!$util.isObject(object.timestampPrecision)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.timestampPrecision: object expected"); + message.timestampPrecision = $root.google.protobuf.Int64Value.fromObject(object.timestampPrecision, long + 1); + } + switch (object.roundingMode) { + default: + if (typeof object.roundingMode === "number") { + message.roundingMode = object.roundingMode; + break; + } + break; + case "ROUNDING_MODE_UNSPECIFIED": + case 0: + message.roundingMode = 0; + break; + case "ROUND_HALF_AWAY_FROM_ZERO": + case 1: + message.roundingMode = 1; + break; + case "ROUND_HALF_EVEN": + case 2: + message.roundingMode = 2; + break; + } + if (object.collation != null) { + if (!$util.isObject(object.collation)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.collation: object expected"); + message.collation = $root.google.protobuf.StringValue.fromObject(object.collation, long + 1); + } + if (object.defaultValueExpression != null) { + if (!$util.isObject(object.defaultValueExpression)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.defaultValueExpression: object expected"); + message.defaultValueExpression = $root.google.protobuf.StringValue.fromObject(object.defaultValueExpression, long + 1); + } + if (object.rangeElementType != null) { + if (!$util.isObject(object.rangeElementType)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.rangeElementType: object expected"); + message.rangeElementType = $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.fromObject(object.rangeElementType, long + 1); + } + if (object.foreignTypeDefinition != null) + message.foreignTypeDefinition = String(object.foreignTypeDefinition); + if (object.generatedColumn != null) { + if (!$util.isObject(object.generatedColumn)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.generatedColumn: object expected"); + message.generatedColumn = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.fromObject(object.generatedColumn, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema} message TableFieldSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableFieldSchema.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.fields = []; + object.dataPolicies = []; + } + if (options.defaults) { + object.name = ""; + object.type = ""; + object.mode = ""; + object.description = null; + object.policyTags = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxLength = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.precision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.precision = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.scale = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.scale = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.collation = null; + object.defaultValueExpression = null; + object.roundingMode = options.enums === String ? "ROUNDING_MODE_UNSPECIFIED" : 0; + object.rangeElementType = null; + object.foreignTypeDefinition = ""; + object.timestampPrecision = null; + object.generatedColumn = null; + object.dataPolicyList = null; + object.dataGovernanceTagsInfo = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + object.mode = message.mode; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.v2.TableFieldSchema.toObject(message.fields[j], options, q + 1); + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = $root.google.protobuf.StringValue.toObject(message.description, options, q + 1); + if (message.policyTags != null && Object.hasOwnProperty.call(message, "policyTags")) + object.policyTags = $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.toObject(message.policyTags, options, q + 1); + if (message.maxLength != null && Object.hasOwnProperty.call(message, "maxLength")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxLength = typeof message.maxLength === "number" ? BigInt(message.maxLength) : $util.Long.fromBits(message.maxLength.low >>> 0, message.maxLength.high >>> 0, false).toBigInt(); + else if (typeof message.maxLength === "number") + object.maxLength = options.longs === String ? String(message.maxLength) : message.maxLength; + else + object.maxLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxLength) : options.longs === Number ? new $util.LongBits(message.maxLength.low >>> 0, message.maxLength.high >>> 0).toNumber() : message.maxLength; + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.precision = typeof message.precision === "number" ? BigInt(message.precision) : $util.Long.fromBits(message.precision.low >>> 0, message.precision.high >>> 0, false).toBigInt(); + else if (typeof message.precision === "number") + object.precision = options.longs === String ? String(message.precision) : message.precision; + else + object.precision = options.longs === String ? $util.Long.prototype.toString.call(message.precision) : options.longs === Number ? new $util.LongBits(message.precision.low >>> 0, message.precision.high >>> 0).toNumber() : message.precision; + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.scale = typeof message.scale === "number" ? BigInt(message.scale) : $util.Long.fromBits(message.scale.low >>> 0, message.scale.high >>> 0, false).toBigInt(); + else if (typeof message.scale === "number") + object.scale = options.longs === String ? String(message.scale) : message.scale; + else + object.scale = options.longs === String ? $util.Long.prototype.toString.call(message.scale) : options.longs === Number ? new $util.LongBits(message.scale.low >>> 0, message.scale.high >>> 0).toNumber() : message.scale; + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + object.collation = $root.google.protobuf.StringValue.toObject(message.collation, options, q + 1); + if (message.defaultValueExpression != null && Object.hasOwnProperty.call(message, "defaultValueExpression")) + object.defaultValueExpression = $root.google.protobuf.StringValue.toObject(message.defaultValueExpression, options, q + 1); + if (message.roundingMode != null && Object.hasOwnProperty.call(message, "roundingMode")) + object.roundingMode = options.enums === String ? $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.roundingMode] === undefined ? message.roundingMode : $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.roundingMode] : message.roundingMode; + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) + object.rangeElementType = $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.toObject(message.rangeElementType, options, q + 1); + if (message.dataPolicies && message.dataPolicies.length) { + object.dataPolicies = []; + for (var j = 0; j < message.dataPolicies.length; ++j) + object.dataPolicies[j] = $root.google.cloud.bigquery.v2.DataPolicyOption.toObject(message.dataPolicies[j], options, q + 1); + } + if (message.foreignTypeDefinition != null && Object.hasOwnProperty.call(message, "foreignTypeDefinition")) + object.foreignTypeDefinition = message.foreignTypeDefinition; + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) + object.timestampPrecision = $root.google.protobuf.Int64Value.toObject(message.timestampPrecision, options, q + 1); + if (message.generatedColumn != null && Object.hasOwnProperty.call(message, "generatedColumn")) + object.generatedColumn = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.toObject(message.generatedColumn, options, q + 1); + if (message.dataPolicyList != null && Object.hasOwnProperty.call(message, "dataPolicyList")) + object.dataPolicyList = $root.google.cloud.bigquery.v2.DataPolicyList.toObject(message.dataPolicyList, options, q + 1); + if (message.dataGovernanceTagsInfo != null && Object.hasOwnProperty.call(message, "dataGovernanceTagsInfo")) + object.dataGovernanceTagsInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.toObject(message.dataGovernanceTagsInfo, options, q + 1); + return object; + }; + + /** + * Converts this TableFieldSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @instance + * @returns {Object.} JSON object + */ + TableFieldSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableFieldSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableFieldSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema"; + }; + + TableFieldSchema.PolicyTagList = (function() { + + /** + * Properties of a PolicyTagList. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @interface IPolicyTagList + * @property {Array.|null} [names] PolicyTagList names + */ + + /** + * Constructs a new PolicyTagList. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @classdesc Represents a PolicyTagList. + * @implements IPolicyTagList + * @constructor + * @param {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList=} [properties] Properties to set + */ + function PolicyTagList(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyTagList names. + * @member {Array.} names + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @instance + */ + PolicyTagList.prototype.names = $util.emptyArray; + + /** + * Creates a new PolicyTagList instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList} PolicyTagList instance + */ + PolicyTagList.create = function create(properties) { + return new PolicyTagList(properties); + }; + + /** + * Encodes the specified PolicyTagList message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList} message PolicyTagList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyTagList.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified PolicyTagList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IPolicyTagList} message PolicyTagList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyTagList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PolicyTagList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList} PolicyTagList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyTagList.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyTagList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList} PolicyTagList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyTagList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyTagList message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyTagList.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.names != null && Object.hasOwnProperty.call(message, "names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a PolicyTagList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList} PolicyTagList + */ + PolicyTagList.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a PolicyTagList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList} message PolicyTagList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyTagList.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this PolicyTagList to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @instance + * @returns {Object.} JSON object + */ + PolicyTagList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyTagList + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyTagList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema.PolicyTagList"; + }; + + return PolicyTagList; + })(); + + TableFieldSchema.DataGovernanceTagsInfo = (function() { + + /** + * Properties of a DataGovernanceTagsInfo. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @interface IDataGovernanceTagsInfo + * @property {Object.|null} [dataGovernanceTags] DataGovernanceTagsInfo dataGovernanceTags + */ + + /** + * Constructs a new DataGovernanceTagsInfo. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @classdesc Represents a DataGovernanceTagsInfo. + * @implements IDataGovernanceTagsInfo + * @constructor + * @param {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo=} [properties] Properties to set + */ + function DataGovernanceTagsInfo(properties) { + this.dataGovernanceTags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataGovernanceTagsInfo dataGovernanceTags. + * @member {Object.} dataGovernanceTags + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @instance + */ + DataGovernanceTagsInfo.prototype.dataGovernanceTags = $util.emptyObject; + + /** + * Creates a new DataGovernanceTagsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo} DataGovernanceTagsInfo instance + */ + DataGovernanceTagsInfo.create = function create(properties) { + return new DataGovernanceTagsInfo(properties); + }; + + /** + * Encodes the specified DataGovernanceTagsInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo} message DataGovernanceTagsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataGovernanceTagsInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.dataGovernanceTags != null && Object.hasOwnProperty.call(message, "dataGovernanceTags")) + for (var keys = Object.keys(message.dataGovernanceTags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dataGovernanceTags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataGovernanceTagsInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IDataGovernanceTagsInfo} message DataGovernanceTagsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataGovernanceTagsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataGovernanceTagsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo} DataGovernanceTagsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataGovernanceTagsInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.dataGovernanceTags === $util.emptyObject) + message.dataGovernanceTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.dataGovernanceTags, key); + message.dataGovernanceTags[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataGovernanceTagsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo} DataGovernanceTagsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataGovernanceTagsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataGovernanceTagsInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataGovernanceTagsInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataGovernanceTags != null && Object.hasOwnProperty.call(message, "dataGovernanceTags")) { + if (!$util.isObject(message.dataGovernanceTags)) + return "dataGovernanceTags: object expected"; + var key = Object.keys(message.dataGovernanceTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.dataGovernanceTags[key[i]])) + return "dataGovernanceTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DataGovernanceTagsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo} DataGovernanceTagsInfo + */ + DataGovernanceTagsInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo(); + if (object.dataGovernanceTags) { + if (!$util.isObject(object.dataGovernanceTags)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo.dataGovernanceTags: object expected"); + message.dataGovernanceTags = {}; + for (var keys = Object.keys(object.dataGovernanceTags), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.dataGovernanceTags, keys[i]); + message.dataGovernanceTags[keys[i]] = String(object.dataGovernanceTags[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataGovernanceTagsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo} message DataGovernanceTagsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataGovernanceTagsInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.dataGovernanceTags = {}; + var keys2; + if (message.dataGovernanceTags && (keys2 = Object.keys(message.dataGovernanceTags)).length) { + object.dataGovernanceTags = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.dataGovernanceTags, keys2[j]); + object.dataGovernanceTags[keys2[j]] = message.dataGovernanceTags[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this DataGovernanceTagsInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @instance + * @returns {Object.} JSON object + */ + DataGovernanceTagsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataGovernanceTagsInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataGovernanceTagsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema.DataGovernanceTagsInfo"; + }; + + return DataGovernanceTagsInfo; + })(); + + /** + * RoundingMode enum. + * @name google.cloud.bigquery.v2.TableFieldSchema.RoundingMode + * @enum {number} + * @property {number} ROUNDING_MODE_UNSPECIFIED=0 ROUNDING_MODE_UNSPECIFIED value + * @property {number} ROUND_HALF_AWAY_FROM_ZERO=1 ROUND_HALF_AWAY_FROM_ZERO value + * @property {number} ROUND_HALF_EVEN=2 ROUND_HALF_EVEN value + */ + TableFieldSchema.RoundingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUNDING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROUND_HALF_AWAY_FROM_ZERO"] = 1; + values[valuesById[2] = "ROUND_HALF_EVEN"] = 2; + return values; + })(); + + TableFieldSchema.FieldElementType = (function() { + + /** + * Properties of a FieldElementType. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @interface IFieldElementType + * @property {string|null} [type] FieldElementType type + */ + + /** + * Constructs a new FieldElementType. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @classdesc Represents a FieldElementType. + * @implements IFieldElementType + * @constructor + * @param {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType=} [properties] Properties to set + */ + function FieldElementType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldElementType type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @instance + */ + FieldElementType.prototype.type = ""; + + /** + * Creates a new FieldElementType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema.FieldElementType} FieldElementType instance + */ + FieldElementType.create = function create(properties) { + return new FieldElementType(properties); + }; + + /** + * Encodes the specified FieldElementType message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType} message FieldElementType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldElementType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + return writer; + }; + + /** + * Encodes the specified FieldElementType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.FieldElementType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IFieldElementType} message FieldElementType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldElementType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldElementType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema.FieldElementType} FieldElementType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldElementType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldElementType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema.FieldElementType} FieldElementType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldElementType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldElementType message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldElementType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a FieldElementType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema.FieldElementType} FieldElementType + */ + FieldElementType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.FieldElementType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema.FieldElementType(); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a FieldElementType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.FieldElementType} message FieldElementType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldElementType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + return object; + }; + + /** + * Converts this FieldElementType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @instance + * @returns {Object.} JSON object + */ + FieldElementType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldElementType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema.FieldElementType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldElementType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema.FieldElementType"; + }; + + return FieldElementType; + })(); + + TableFieldSchema.GeneratedExpressionInfo = (function() { + + /** + * Properties of a GeneratedExpressionInfo. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @interface IGeneratedExpressionInfo + * @property {string|null} [generationExpression] GeneratedExpressionInfo generationExpression + * @property {boolean|null} [asynchronous] GeneratedExpressionInfo asynchronous + * @property {boolean|null} [stored] GeneratedExpressionInfo stored + */ + + /** + * Constructs a new GeneratedExpressionInfo. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @classdesc Represents a GeneratedExpressionInfo. + * @implements IGeneratedExpressionInfo + * @constructor + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo=} [properties] Properties to set + */ + function GeneratedExpressionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedExpressionInfo generationExpression. + * @member {string|null|undefined} generationExpression + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @instance + */ + GeneratedExpressionInfo.prototype.generationExpression = null; + + /** + * GeneratedExpressionInfo asynchronous. + * @member {boolean|null|undefined} asynchronous + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @instance + */ + GeneratedExpressionInfo.prototype.asynchronous = null; + + /** + * GeneratedExpressionInfo stored. + * @member {boolean|null|undefined} stored + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @instance + */ + GeneratedExpressionInfo.prototype.stored = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GeneratedExpressionInfo.prototype, "_generationExpression", { + get: $util.oneOfGetter($oneOfFields = ["generationExpression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GeneratedExpressionInfo.prototype, "_asynchronous", { + get: $util.oneOfGetter($oneOfFields = ["asynchronous"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GeneratedExpressionInfo.prototype, "_stored", { + get: $util.oneOfGetter($oneOfFields = ["stored"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GeneratedExpressionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo} GeneratedExpressionInfo instance + */ + GeneratedExpressionInfo.create = function create(properties) { + return new GeneratedExpressionInfo(properties); + }; + + /** + * Encodes the specified GeneratedExpressionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo} message GeneratedExpressionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedExpressionInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.generationExpression != null && Object.hasOwnProperty.call(message, "generationExpression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.generationExpression); + if (message.asynchronous != null && Object.hasOwnProperty.call(message, "asynchronous")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.asynchronous); + if (message.stored != null && Object.hasOwnProperty.call(message, "stored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.stored); + return writer; + }; + + /** + * Encodes the specified GeneratedExpressionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo} message GeneratedExpressionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedExpressionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GeneratedExpressionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo} GeneratedExpressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedExpressionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generationExpression = reader.string(); + break; + } + case 2: { + message.asynchronous = reader.bool(); + break; + } + case 3: { + message.stored = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedExpressionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo} GeneratedExpressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedExpressionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedExpressionInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedExpressionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.generationExpression != null && Object.hasOwnProperty.call(message, "generationExpression")) { + properties._generationExpression = 1; + if (!$util.isString(message.generationExpression)) + return "generationExpression: string expected"; + } + if (message.asynchronous != null && Object.hasOwnProperty.call(message, "asynchronous")) { + properties._asynchronous = 1; + if (typeof message.asynchronous !== "boolean") + return "asynchronous: boolean expected"; + } + if (message.stored != null && Object.hasOwnProperty.call(message, "stored")) { + properties._stored = 1; + if (typeof message.stored !== "boolean") + return "stored: boolean expected"; + } + return null; + }; + + /** + * Creates a GeneratedExpressionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo} GeneratedExpressionInfo + */ + GeneratedExpressionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo(); + if (object.generationExpression != null) + message.generationExpression = String(object.generationExpression); + if (object.asynchronous != null) + message.asynchronous = Boolean(object.asynchronous); + if (object.stored != null) + message.stored = Boolean(object.stored); + return message; + }; + + /** + * Creates a plain object from a GeneratedExpressionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo} message GeneratedExpressionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedExpressionInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.generationExpression != null && Object.hasOwnProperty.call(message, "generationExpression")) { + object.generationExpression = message.generationExpression; + if (options.oneofs) + object._generationExpression = "generationExpression"; + } + if (message.asynchronous != null && Object.hasOwnProperty.call(message, "asynchronous")) { + object.asynchronous = message.asynchronous; + if (options.oneofs) + object._asynchronous = "asynchronous"; + } + if (message.stored != null && Object.hasOwnProperty.call(message, "stored")) { + object.stored = message.stored; + if (options.oneofs) + object._stored = "stored"; + } + return object; + }; + + /** + * Converts this GeneratedExpressionInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedExpressionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedExpressionInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedExpressionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo"; + }; + + return GeneratedExpressionInfo; + })(); + + TableFieldSchema.GeneratedColumn = (function() { + + /** + * Properties of a GeneratedColumn. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @interface IGeneratedColumn + * @property {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|null} [generatedMode] GeneratedColumn generatedMode + * @property {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo|null} [generatedExpressionInfo] GeneratedColumn generatedExpressionInfo + */ + + /** + * Constructs a new GeneratedColumn. + * @memberof google.cloud.bigquery.v2.TableFieldSchema + * @classdesc Represents a GeneratedColumn. + * @implements IGeneratedColumn + * @constructor + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn=} [properties] Properties to set + */ + function GeneratedColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedColumn generatedMode. + * @member {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode|null|undefined} generatedMode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @instance + */ + GeneratedColumn.prototype.generatedMode = null; + + /** + * GeneratedColumn generatedExpressionInfo. + * @member {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedExpressionInfo|null|undefined} generatedExpressionInfo + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @instance + */ + GeneratedColumn.prototype.generatedExpressionInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GeneratedColumn.prototype, "_generatedMode", { + get: $util.oneOfGetter($oneOfFields = ["generatedMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GeneratedColumn definition. + * @member {"generatedExpressionInfo"|undefined} definition + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @instance + */ + Object.defineProperty(GeneratedColumn.prototype, "definition", { + get: $util.oneOfGetter($oneOfFields = ["generatedExpressionInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GeneratedColumn instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn} GeneratedColumn instance + */ + GeneratedColumn.create = function create(properties) { + return new GeneratedColumn(properties); + }; + + /** + * Encodes the specified GeneratedColumn message. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn} message GeneratedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedColumn.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.generatedMode != null && Object.hasOwnProperty.call(message, "generatedMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generatedMode); + if (message.generatedExpressionInfo != null && Object.hasOwnProperty.call(message, "generatedExpressionInfo")) + $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.encode(message.generatedExpressionInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.IGeneratedColumn} message GeneratedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GeneratedColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn} GeneratedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedColumn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generatedMode = reader.int32(); + break; + } + case 3: { + message.generatedExpressionInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn} GeneratedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedColumn message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedColumn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.generatedMode != null && Object.hasOwnProperty.call(message, "generatedMode")) { + properties._generatedMode = 1; + switch (message.generatedMode) { + default: + return "generatedMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.generatedExpressionInfo != null && Object.hasOwnProperty.call(message, "generatedExpressionInfo")) { + properties.definition = 1; + { + var error = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.verify(message.generatedExpressionInfo, long + 1); + if (error) + return "generatedExpressionInfo." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn} GeneratedColumn + */ + GeneratedColumn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn(); + switch (object.generatedMode) { + default: + if (typeof object.generatedMode === "number") { + message.generatedMode = object.generatedMode; + break; + } + break; + case "GENERATED_MODE_UNSPECIFIED": + case 0: + message.generatedMode = 0; + break; + case "GENERATED_ALWAYS": + case 1: + message.generatedMode = 1; + break; + case "GENERATED_BY_DEFAULT": + case 2: + message.generatedMode = 2; + break; + } + if (object.generatedExpressionInfo != null) { + if (!$util.isObject(object.generatedExpressionInfo)) + throw TypeError(".google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.generatedExpressionInfo: object expected"); + message.generatedExpressionInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.fromObject(object.generatedExpressionInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GeneratedColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn} message GeneratedColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedColumn.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.generatedMode != null && Object.hasOwnProperty.call(message, "generatedMode")) { + object.generatedMode = options.enums === String ? $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode[message.generatedMode] === undefined ? message.generatedMode : $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode[message.generatedMode] : message.generatedMode; + if (options.oneofs) + object._generatedMode = "generatedMode"; + } + if (message.generatedExpressionInfo != null && Object.hasOwnProperty.call(message, "generatedExpressionInfo")) { + object.generatedExpressionInfo = $root.google.cloud.bigquery.v2.TableFieldSchema.GeneratedExpressionInfo.toObject(message.generatedExpressionInfo, options, q + 1); + if (options.oneofs) + object.definition = "generatedExpressionInfo"; + } + return object; + }; + + /** + * Converts this GeneratedColumn to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @instance + * @returns {Object.} JSON object + */ + GeneratedColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedColumn + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn"; + }; + + /** + * GeneratedMode enum. + * @name google.cloud.bigquery.v2.TableFieldSchema.GeneratedColumn.GeneratedMode + * @enum {number} + * @property {number} GENERATED_MODE_UNSPECIFIED=0 GENERATED_MODE_UNSPECIFIED value + * @property {number} GENERATED_ALWAYS=1 GENERATED_ALWAYS value + * @property {number} GENERATED_BY_DEFAULT=2 GENERATED_BY_DEFAULT value + */ + GeneratedColumn.GeneratedMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENERATED_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GENERATED_ALWAYS"] = 1; + values[valuesById[2] = "GENERATED_BY_DEFAULT"] = 2; + return values; + })(); + + return GeneratedColumn; + })(); + + return TableFieldSchema; + })(); + + /** + * DecimalTargetType enum. + * @name google.cloud.bigquery.v2.DecimalTargetType + * @enum {number} + * @property {number} DECIMAL_TARGET_TYPE_UNSPECIFIED=0 DECIMAL_TARGET_TYPE_UNSPECIFIED value + * @property {number} NUMERIC=1 NUMERIC value + * @property {number} BIGNUMERIC=2 BIGNUMERIC value + * @property {number} STRING=3 STRING value + */ + v2.DecimalTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECIMAL_TARGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMERIC"] = 1; + values[valuesById[2] = "BIGNUMERIC"] = 2; + values[valuesById[3] = "STRING"] = 3; + return values; + })(); + + v2.ErrorProto = (function() { + + /** + * Properties of an ErrorProto. + * @memberof google.cloud.bigquery.v2 + * @interface IErrorProto + * @property {string|null} [reason] ErrorProto reason + * @property {string|null} [location] ErrorProto location + * @property {string|null} [debugInfo] ErrorProto debugInfo + * @property {string|null} [message] ErrorProto message + */ + + /** + * Constructs a new ErrorProto. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ErrorProto. + * @implements IErrorProto + * @constructor + * @param {google.cloud.bigquery.v2.IErrorProto=} [properties] Properties to set + */ + function ErrorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorProto reason. + * @member {string} reason + * @memberof google.cloud.bigquery.v2.ErrorProto + * @instance + */ + ErrorProto.prototype.reason = ""; + + /** + * ErrorProto location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.ErrorProto + * @instance + */ + ErrorProto.prototype.location = ""; + + /** + * ErrorProto debugInfo. + * @member {string} debugInfo + * @memberof google.cloud.bigquery.v2.ErrorProto + * @instance + */ + ErrorProto.prototype.debugInfo = ""; + + /** + * ErrorProto message. + * @member {string} message + * @memberof google.cloud.bigquery.v2.ErrorProto + * @instance + */ + ErrorProto.prototype.message = ""; + + /** + * Creates a new ErrorProto instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {google.cloud.bigquery.v2.IErrorProto=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ErrorProto} ErrorProto instance + */ + ErrorProto.create = function create(properties) { + return new ErrorProto(properties); + }; + + /** + * Encodes the specified ErrorProto message. Does not implicitly {@link google.cloud.bigquery.v2.ErrorProto.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {google.cloud.bigquery.v2.IErrorProto} message ErrorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.reason); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.debugInfo != null && Object.hasOwnProperty.call(message, "debugInfo")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.debugInfo); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.message); + return writer; + }; + + /** + * Encodes the specified ErrorProto message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ErrorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {google.cloud.bigquery.v2.IErrorProto} message ErrorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ErrorProto message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ErrorProto} ErrorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ErrorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reason = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.debugInfo = reader.string(); + break; + } + case 4: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ErrorProto} ErrorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorProto message. + * @function verify + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.debugInfo != null && Object.hasOwnProperty.call(message, "debugInfo")) + if (!$util.isString(message.debugInfo)) + return "debugInfo: string expected"; + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an ErrorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ErrorProto} ErrorProto + */ + ErrorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ErrorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ErrorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ErrorProto(); + if (object.reason != null) + message.reason = String(object.reason); + if (object.location != null) + message.location = String(object.location); + if (object.debugInfo != null) + message.debugInfo = String(object.debugInfo); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an ErrorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {google.cloud.bigquery.v2.ErrorProto} message ErrorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.reason = ""; + object.location = ""; + object.debugInfo = ""; + object.message = ""; + } + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + object.reason = message.reason; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.debugInfo != null && Object.hasOwnProperty.call(message, "debugInfo")) + object.debugInfo = message.debugInfo; + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + object.message = message.message; + return object; + }; + + /** + * Converts this ErrorProto to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ErrorProto + * @instance + * @returns {Object.} JSON object + */ + ErrorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorProto + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ErrorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ErrorProto"; + }; + + return ErrorProto; + })(); + + v2.ExternalCatalogTableOptions = (function() { + + /** + * Properties of an ExternalCatalogTableOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalCatalogTableOptions + * @property {Object.|null} [parameters] ExternalCatalogTableOptions parameters + * @property {google.cloud.bigquery.v2.IStorageDescriptor|null} [storageDescriptor] ExternalCatalogTableOptions storageDescriptor + * @property {string|null} [connectionId] ExternalCatalogTableOptions connectionId + */ + + /** + * Constructs a new ExternalCatalogTableOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalCatalogTableOptions. + * @implements IExternalCatalogTableOptions + * @constructor + * @param {google.cloud.bigquery.v2.IExternalCatalogTableOptions=} [properties] Properties to set + */ + function ExternalCatalogTableOptions(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalCatalogTableOptions parameters. + * @member {Object.} parameters + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @instance + */ + ExternalCatalogTableOptions.prototype.parameters = $util.emptyObject; + + /** + * ExternalCatalogTableOptions storageDescriptor. + * @member {google.cloud.bigquery.v2.IStorageDescriptor|null|undefined} storageDescriptor + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @instance + */ + ExternalCatalogTableOptions.prototype.storageDescriptor = null; + + /** + * ExternalCatalogTableOptions connectionId. + * @member {string} connectionId + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @instance + */ + ExternalCatalogTableOptions.prototype.connectionId = ""; + + /** + * Creates a new ExternalCatalogTableOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogTableOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalCatalogTableOptions} ExternalCatalogTableOptions instance + */ + ExternalCatalogTableOptions.create = function create(properties) { + return new ExternalCatalogTableOptions(properties); + }; + + /** + * Encodes the specified ExternalCatalogTableOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogTableOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogTableOptions} message ExternalCatalogTableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalCatalogTableOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + if (message.storageDescriptor != null && Object.hasOwnProperty.call(message, "storageDescriptor")) + $root.google.cloud.bigquery.v2.StorageDescriptor.encode(message.storageDescriptor, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.connectionId); + return writer; + }; + + /** + * Encodes the specified ExternalCatalogTableOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalCatalogTableOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalCatalogTableOptions} message ExternalCatalogTableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalCatalogTableOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalCatalogTableOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalCatalogTableOptions} ExternalCatalogTableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalCatalogTableOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + case 2: { + message.storageDescriptor = $root.google.cloud.bigquery.v2.StorageDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.connectionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalCatalogTableOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalCatalogTableOptions} ExternalCatalogTableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalCatalogTableOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalCatalogTableOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalCatalogTableOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.storageDescriptor != null && Object.hasOwnProperty.call(message, "storageDescriptor")) { + var error = $root.google.cloud.bigquery.v2.StorageDescriptor.verify(message.storageDescriptor, long + 1); + if (error) + return "storageDescriptor." + error; + } + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + return null; + }; + + /** + * Creates an ExternalCatalogTableOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalCatalogTableOptions} ExternalCatalogTableOptions + */ + ExternalCatalogTableOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalCatalogTableOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions(); + if (object.parameters) { + if (!$util.isObject(object.parameters)) + throw TypeError(".google.cloud.bigquery.v2.ExternalCatalogTableOptions.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + } + if (object.storageDescriptor != null) { + if (!$util.isObject(object.storageDescriptor)) + throw TypeError(".google.cloud.bigquery.v2.ExternalCatalogTableOptions.storageDescriptor: object expected"); + message.storageDescriptor = $root.google.cloud.bigquery.v2.StorageDescriptor.fromObject(object.storageDescriptor, long + 1); + } + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + return message; + }; + + /** + * Creates a plain object from an ExternalCatalogTableOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {google.cloud.bigquery.v2.ExternalCatalogTableOptions} message ExternalCatalogTableOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalCatalogTableOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.storageDescriptor = null; + object.connectionId = ""; + } + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + } + if (message.storageDescriptor != null && Object.hasOwnProperty.call(message, "storageDescriptor")) + object.storageDescriptor = $root.google.cloud.bigquery.v2.StorageDescriptor.toObject(message.storageDescriptor, options, q + 1); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + object.connectionId = message.connectionId; + return object; + }; + + /** + * Converts this ExternalCatalogTableOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @instance + * @returns {Object.} JSON object + */ + ExternalCatalogTableOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalCatalogTableOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalCatalogTableOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalCatalogTableOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalCatalogTableOptions"; + }; + + return ExternalCatalogTableOptions; + })(); + + v2.StorageDescriptor = (function() { + + /** + * Properties of a StorageDescriptor. + * @memberof google.cloud.bigquery.v2 + * @interface IStorageDescriptor + * @property {string|null} [locationUri] StorageDescriptor locationUri + * @property {string|null} [inputFormat] StorageDescriptor inputFormat + * @property {string|null} [outputFormat] StorageDescriptor outputFormat + * @property {google.cloud.bigquery.v2.ISerDeInfo|null} [serdeInfo] StorageDescriptor serdeInfo + */ + + /** + * Constructs a new StorageDescriptor. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StorageDescriptor. + * @implements IStorageDescriptor + * @constructor + * @param {google.cloud.bigquery.v2.IStorageDescriptor=} [properties] Properties to set + */ + function StorageDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageDescriptor locationUri. + * @member {string} locationUri + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @instance + */ + StorageDescriptor.prototype.locationUri = ""; + + /** + * StorageDescriptor inputFormat. + * @member {string} inputFormat + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @instance + */ + StorageDescriptor.prototype.inputFormat = ""; + + /** + * StorageDescriptor outputFormat. + * @member {string} outputFormat + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @instance + */ + StorageDescriptor.prototype.outputFormat = ""; + + /** + * StorageDescriptor serdeInfo. + * @member {google.cloud.bigquery.v2.ISerDeInfo|null|undefined} serdeInfo + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @instance + */ + StorageDescriptor.prototype.serdeInfo = null; + + /** + * Creates a new StorageDescriptor instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {google.cloud.bigquery.v2.IStorageDescriptor=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StorageDescriptor} StorageDescriptor instance + */ + StorageDescriptor.create = function create(properties) { + return new StorageDescriptor(properties); + }; + + /** + * Encodes the specified StorageDescriptor message. Does not implicitly {@link google.cloud.bigquery.v2.StorageDescriptor.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {google.cloud.bigquery.v2.IStorageDescriptor} message StorageDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageDescriptor.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.locationUri != null && Object.hasOwnProperty.call(message, "locationUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationUri); + if (message.inputFormat != null && Object.hasOwnProperty.call(message, "inputFormat")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputFormat); + if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputFormat); + if (message.serdeInfo != null && Object.hasOwnProperty.call(message, "serdeInfo")) + $root.google.cloud.bigquery.v2.SerDeInfo.encode(message.serdeInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StorageDescriptor message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StorageDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {google.cloud.bigquery.v2.IStorageDescriptor} message StorageDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StorageDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StorageDescriptor} StorageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StorageDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.locationUri = reader.string(); + break; + } + case 2: { + message.inputFormat = reader.string(); + break; + } + case 3: { + message.outputFormat = reader.string(); + break; + } + case 4: { + message.serdeInfo = $root.google.cloud.bigquery.v2.SerDeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StorageDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StorageDescriptor} StorageDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageDescriptor message. + * @function verify + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.locationUri != null && Object.hasOwnProperty.call(message, "locationUri")) + if (!$util.isString(message.locationUri)) + return "locationUri: string expected"; + if (message.inputFormat != null && Object.hasOwnProperty.call(message, "inputFormat")) + if (!$util.isString(message.inputFormat)) + return "inputFormat: string expected"; + if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) + if (!$util.isString(message.outputFormat)) + return "outputFormat: string expected"; + if (message.serdeInfo != null && Object.hasOwnProperty.call(message, "serdeInfo")) { + var error = $root.google.cloud.bigquery.v2.SerDeInfo.verify(message.serdeInfo, long + 1); + if (error) + return "serdeInfo." + error; + } + return null; + }; + + /** + * Creates a StorageDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StorageDescriptor} StorageDescriptor + */ + StorageDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StorageDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StorageDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StorageDescriptor(); + if (object.locationUri != null) + message.locationUri = String(object.locationUri); + if (object.inputFormat != null) + message.inputFormat = String(object.inputFormat); + if (object.outputFormat != null) + message.outputFormat = String(object.outputFormat); + if (object.serdeInfo != null) { + if (!$util.isObject(object.serdeInfo)) + throw TypeError(".google.cloud.bigquery.v2.StorageDescriptor.serdeInfo: object expected"); + message.serdeInfo = $root.google.cloud.bigquery.v2.SerDeInfo.fromObject(object.serdeInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StorageDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {google.cloud.bigquery.v2.StorageDescriptor} message StorageDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageDescriptor.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.locationUri = ""; + object.inputFormat = ""; + object.outputFormat = ""; + object.serdeInfo = null; + } + if (message.locationUri != null && Object.hasOwnProperty.call(message, "locationUri")) + object.locationUri = message.locationUri; + if (message.inputFormat != null && Object.hasOwnProperty.call(message, "inputFormat")) + object.inputFormat = message.inputFormat; + if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) + object.outputFormat = message.outputFormat; + if (message.serdeInfo != null && Object.hasOwnProperty.call(message, "serdeInfo")) + object.serdeInfo = $root.google.cloud.bigquery.v2.SerDeInfo.toObject(message.serdeInfo, options, q + 1); + return object; + }; + + /** + * Converts this StorageDescriptor to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @instance + * @returns {Object.} JSON object + */ + StorageDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageDescriptor + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StorageDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StorageDescriptor"; + }; + + return StorageDescriptor; + })(); + + v2.SerDeInfo = (function() { + + /** + * Properties of a SerDeInfo. + * @memberof google.cloud.bigquery.v2 + * @interface ISerDeInfo + * @property {string|null} [name] SerDeInfo name + * @property {string|null} [serializationLibrary] SerDeInfo serializationLibrary + * @property {Object.|null} [parameters] SerDeInfo parameters + */ + + /** + * Constructs a new SerDeInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SerDeInfo. + * @implements ISerDeInfo + * @constructor + * @param {google.cloud.bigquery.v2.ISerDeInfo=} [properties] Properties to set + */ + function SerDeInfo(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerDeInfo name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @instance + */ + SerDeInfo.prototype.name = ""; + + /** + * SerDeInfo serializationLibrary. + * @member {string} serializationLibrary + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @instance + */ + SerDeInfo.prototype.serializationLibrary = ""; + + /** + * SerDeInfo parameters. + * @member {Object.} parameters + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @instance + */ + SerDeInfo.prototype.parameters = $util.emptyObject; + + /** + * Creates a new SerDeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {google.cloud.bigquery.v2.ISerDeInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SerDeInfo} SerDeInfo instance + */ + SerDeInfo.create = function create(properties) { + return new SerDeInfo(properties); + }; + + /** + * Encodes the specified SerDeInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SerDeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {google.cloud.bigquery.v2.ISerDeInfo} message SerDeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerDeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.serializationLibrary != null && Object.hasOwnProperty.call(message, "serializationLibrary")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serializationLibrary); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SerDeInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SerDeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {google.cloud.bigquery.v2.ISerDeInfo} message SerDeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerDeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SerDeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SerDeInfo} SerDeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerDeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SerDeInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.serializationLibrary = reader.string(); + break; + } + case 3: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.parameters, key); + message.parameters[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SerDeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SerDeInfo} SerDeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerDeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerDeInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerDeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.serializationLibrary != null && Object.hasOwnProperty.call(message, "serializationLibrary")) + if (!$util.isString(message.serializationLibrary)) + return "serializationLibrary: string expected"; + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a SerDeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SerDeInfo} SerDeInfo + */ + SerDeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SerDeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SerDeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SerDeInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.serializationLibrary != null) + message.serializationLibrary = String(object.serializationLibrary); + if (object.parameters) { + if (!$util.isObject(object.parameters)) + throw TypeError(".google.cloud.bigquery.v2.SerDeInfo.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.parameters, keys[i]); + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SerDeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {google.cloud.bigquery.v2.SerDeInfo} message SerDeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerDeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.name = ""; + object.serializationLibrary = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.serializationLibrary != null && Object.hasOwnProperty.call(message, "serializationLibrary")) + object.serializationLibrary = message.serializationLibrary; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.parameters, keys2[j]); + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this SerDeInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @instance + * @returns {Object.} JSON object + */ + SerDeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SerDeInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SerDeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SerDeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SerDeInfo"; + }; + + return SerDeInfo; + })(); + + v2.AvroOptions = (function() { + + /** + * Properties of an AvroOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IAvroOptions + * @property {google.protobuf.IBoolValue|null} [useAvroLogicalTypes] AvroOptions useAvroLogicalTypes + */ + + /** + * Constructs a new AvroOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an AvroOptions. + * @implements IAvroOptions + * @constructor + * @param {google.cloud.bigquery.v2.IAvroOptions=} [properties] Properties to set + */ + function AvroOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroOptions useAvroLogicalTypes. + * @member {google.protobuf.IBoolValue|null|undefined} useAvroLogicalTypes + * @memberof google.cloud.bigquery.v2.AvroOptions + * @instance + */ + AvroOptions.prototype.useAvroLogicalTypes = null; + + /** + * Creates a new AvroOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {google.cloud.bigquery.v2.IAvroOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.AvroOptions} AvroOptions instance + */ + AvroOptions.create = function create(properties) { + return new AvroOptions(properties); + }; + + /** + * Encodes the specified AvroOptions message. Does not implicitly {@link google.cloud.bigquery.v2.AvroOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {google.cloud.bigquery.v2.IAvroOptions} message AvroOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + $root.google.protobuf.BoolValue.encode(message.useAvroLogicalTypes, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified AvroOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.AvroOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {google.cloud.bigquery.v2.IAvroOptions} message AvroOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an AvroOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.AvroOptions} AvroOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.AvroOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AvroOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.AvroOptions} AvroOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) { + var error = $root.google.protobuf.BoolValue.verify(message.useAvroLogicalTypes, long + 1); + if (error) + return "useAvroLogicalTypes." + error; + } + return null; + }; + + /** + * Creates an AvroOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.AvroOptions} AvroOptions + */ + AvroOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.AvroOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.AvroOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.AvroOptions(); + if (object.useAvroLogicalTypes != null) { + if (!$util.isObject(object.useAvroLogicalTypes)) + throw TypeError(".google.cloud.bigquery.v2.AvroOptions.useAvroLogicalTypes: object expected"); + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.fromObject(object.useAvroLogicalTypes, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AvroOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {google.cloud.bigquery.v2.AvroOptions} message AvroOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.useAvroLogicalTypes = null; + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + object.useAvroLogicalTypes = $root.google.protobuf.BoolValue.toObject(message.useAvroLogicalTypes, options, q + 1); + return object; + }; + + /** + * Converts this AvroOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.AvroOptions + * @instance + * @returns {Object.} JSON object + */ + AvroOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvroOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.AvroOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.AvroOptions"; + }; + + return AvroOptions; + })(); + + v2.ParquetOptions = (function() { + + /** + * Properties of a ParquetOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IParquetOptions + * @property {google.protobuf.IBoolValue|null} [enumAsString] ParquetOptions enumAsString + * @property {google.protobuf.IBoolValue|null} [enableListInference] ParquetOptions enableListInference + * @property {google.cloud.bigquery.v2.MapTargetType|null} [mapTargetType] ParquetOptions mapTargetType + */ + + /** + * Constructs a new ParquetOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ParquetOptions. + * @implements IParquetOptions + * @constructor + * @param {google.cloud.bigquery.v2.IParquetOptions=} [properties] Properties to set + */ + function ParquetOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParquetOptions enumAsString. + * @member {google.protobuf.IBoolValue|null|undefined} enumAsString + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @instance + */ + ParquetOptions.prototype.enumAsString = null; + + /** + * ParquetOptions enableListInference. + * @member {google.protobuf.IBoolValue|null|undefined} enableListInference + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @instance + */ + ParquetOptions.prototype.enableListInference = null; + + /** + * ParquetOptions mapTargetType. + * @member {google.cloud.bigquery.v2.MapTargetType} mapTargetType + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @instance + */ + ParquetOptions.prototype.mapTargetType = 0; + + /** + * Creates a new ParquetOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {google.cloud.bigquery.v2.IParquetOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ParquetOptions} ParquetOptions instance + */ + ParquetOptions.create = function create(properties) { + return new ParquetOptions(properties); + }; + + /** + * Encodes the specified ParquetOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ParquetOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {google.cloud.bigquery.v2.IParquetOptions} message ParquetOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParquetOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.enumAsString != null && Object.hasOwnProperty.call(message, "enumAsString")) + $root.google.protobuf.BoolValue.encode(message.enumAsString, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.enableListInference != null && Object.hasOwnProperty.call(message, "enableListInference")) + $root.google.protobuf.BoolValue.encode(message.enableListInference, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.mapTargetType != null && Object.hasOwnProperty.call(message, "mapTargetType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mapTargetType); + return writer; + }; + + /** + * Encodes the specified ParquetOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ParquetOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {google.cloud.bigquery.v2.IParquetOptions} message ParquetOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParquetOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ParquetOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ParquetOptions} ParquetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParquetOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ParquetOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enumAsString = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.enableListInference = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.mapTargetType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ParquetOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ParquetOptions} ParquetOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParquetOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParquetOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParquetOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.enumAsString != null && Object.hasOwnProperty.call(message, "enumAsString")) { + var error = $root.google.protobuf.BoolValue.verify(message.enumAsString, long + 1); + if (error) + return "enumAsString." + error; + } + if (message.enableListInference != null && Object.hasOwnProperty.call(message, "enableListInference")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableListInference, long + 1); + if (error) + return "enableListInference." + error; + } + if (message.mapTargetType != null && Object.hasOwnProperty.call(message, "mapTargetType")) + switch (message.mapTargetType) { + default: + return "mapTargetType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ParquetOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ParquetOptions} ParquetOptions + */ + ParquetOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ParquetOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ParquetOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ParquetOptions(); + if (object.enumAsString != null) { + if (!$util.isObject(object.enumAsString)) + throw TypeError(".google.cloud.bigquery.v2.ParquetOptions.enumAsString: object expected"); + message.enumAsString = $root.google.protobuf.BoolValue.fromObject(object.enumAsString, long + 1); + } + if (object.enableListInference != null) { + if (!$util.isObject(object.enableListInference)) + throw TypeError(".google.cloud.bigquery.v2.ParquetOptions.enableListInference: object expected"); + message.enableListInference = $root.google.protobuf.BoolValue.fromObject(object.enableListInference, long + 1); + } + switch (object.mapTargetType) { + default: + if (typeof object.mapTargetType === "number") { + message.mapTargetType = object.mapTargetType; + break; + } + break; + case "MAP_TARGET_TYPE_UNSPECIFIED": + case 0: + message.mapTargetType = 0; + break; + case "ARRAY_OF_STRUCT": + case 1: + message.mapTargetType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ParquetOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {google.cloud.bigquery.v2.ParquetOptions} message ParquetOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParquetOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.enumAsString = null; + object.enableListInference = null; + object.mapTargetType = options.enums === String ? "MAP_TARGET_TYPE_UNSPECIFIED" : 0; + } + if (message.enumAsString != null && Object.hasOwnProperty.call(message, "enumAsString")) + object.enumAsString = $root.google.protobuf.BoolValue.toObject(message.enumAsString, options, q + 1); + if (message.enableListInference != null && Object.hasOwnProperty.call(message, "enableListInference")) + object.enableListInference = $root.google.protobuf.BoolValue.toObject(message.enableListInference, options, q + 1); + if (message.mapTargetType != null && Object.hasOwnProperty.call(message, "mapTargetType")) + object.mapTargetType = options.enums === String ? $root.google.cloud.bigquery.v2.MapTargetType[message.mapTargetType] === undefined ? message.mapTargetType : $root.google.cloud.bigquery.v2.MapTargetType[message.mapTargetType] : message.mapTargetType; + return object; + }; + + /** + * Converts this ParquetOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @instance + * @returns {Object.} JSON object + */ + ParquetOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParquetOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ParquetOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParquetOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ParquetOptions"; + }; + + return ParquetOptions; + })(); + + v2.CsvOptions = (function() { + + /** + * Properties of a CsvOptions. + * @memberof google.cloud.bigquery.v2 + * @interface ICsvOptions + * @property {string|null} [fieldDelimiter] CsvOptions fieldDelimiter + * @property {google.protobuf.IInt64Value|null} [skipLeadingRows] CsvOptions skipLeadingRows + * @property {google.protobuf.IStringValue|null} [quote] CsvOptions quote + * @property {google.protobuf.IBoolValue|null} [allowQuotedNewlines] CsvOptions allowQuotedNewlines + * @property {google.protobuf.IBoolValue|null} [allowJaggedRows] CsvOptions allowJaggedRows + * @property {string|null} [encoding] CsvOptions encoding + * @property {google.protobuf.IBoolValue|null} [preserveAsciiControlCharacters] CsvOptions preserveAsciiControlCharacters + * @property {google.protobuf.IStringValue|null} [nullMarker] CsvOptions nullMarker + * @property {Array.|null} [nullMarkers] CsvOptions nullMarkers + * @property {string|null} [sourceColumnMatch] CsvOptions sourceColumnMatch + */ + + /** + * Constructs a new CsvOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a CsvOptions. + * @implements ICsvOptions + * @constructor + * @param {google.cloud.bigquery.v2.ICsvOptions=} [properties] Properties to set + */ + function CsvOptions(properties) { + this.nullMarkers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CsvOptions fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.fieldDelimiter = ""; + + /** + * CsvOptions skipLeadingRows. + * @member {google.protobuf.IInt64Value|null|undefined} skipLeadingRows + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.skipLeadingRows = null; + + /** + * CsvOptions quote. + * @member {google.protobuf.IStringValue|null|undefined} quote + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.quote = null; + + /** + * CsvOptions allowQuotedNewlines. + * @member {google.protobuf.IBoolValue|null|undefined} allowQuotedNewlines + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.allowQuotedNewlines = null; + + /** + * CsvOptions allowJaggedRows. + * @member {google.protobuf.IBoolValue|null|undefined} allowJaggedRows + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.allowJaggedRows = null; + + /** + * CsvOptions encoding. + * @member {string} encoding + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.encoding = ""; + + /** + * CsvOptions preserveAsciiControlCharacters. + * @member {google.protobuf.IBoolValue|null|undefined} preserveAsciiControlCharacters + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.preserveAsciiControlCharacters = null; + + /** + * CsvOptions nullMarker. + * @member {google.protobuf.IStringValue|null|undefined} nullMarker + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.nullMarker = null; + + /** + * CsvOptions nullMarkers. + * @member {Array.} nullMarkers + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.nullMarkers = $util.emptyArray; + + /** + * CsvOptions sourceColumnMatch. + * @member {string} sourceColumnMatch + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + */ + CsvOptions.prototype.sourceColumnMatch = ""; + + /** + * Creates a new CsvOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {google.cloud.bigquery.v2.ICsvOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.CsvOptions} CsvOptions instance + */ + CsvOptions.create = function create(properties) { + return new CsvOptions(properties); + }; + + /** + * Encodes the specified CsvOptions message. Does not implicitly {@link google.cloud.bigquery.v2.CsvOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {google.cloud.bigquery.v2.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldDelimiter); + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + $root.google.protobuf.Int64Value.encode(message.skipLeadingRows, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + $root.google.protobuf.StringValue.encode(message.quote, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) + $root.google.protobuf.BoolValue.encode(message.allowQuotedNewlines, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) + $root.google.protobuf.BoolValue.encode(message.allowJaggedRows, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.encoding); + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) + $root.google.protobuf.BoolValue.encode(message.preserveAsciiControlCharacters, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) + $root.google.protobuf.StringValue.encode(message.nullMarker, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.nullMarkers != null && message.nullMarkers.length) + for (var i = 0; i < message.nullMarkers.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.nullMarkers[i]); + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceColumnMatch); + return writer; + }; + + /** + * Encodes the specified CsvOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CsvOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {google.cloud.bigquery.v2.ICsvOptions} message CsvOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CsvOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.CsvOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldDelimiter = reader.string(); + break; + } + case 2: { + message.skipLeadingRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.quote = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.allowQuotedNewlines = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.allowJaggedRows = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.encoding = reader.string(); + break; + } + case 7: { + message.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.nullMarker = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.nullMarkers && message.nullMarkers.length)) + message.nullMarkers = []; + message.nullMarkers.push(reader.string()); + break; + } + case 10: { + message.sourceColumnMatch = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CsvOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.CsvOptions} CsvOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CsvOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CsvOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CsvOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.skipLeadingRows, long + 1); + if (error) + return "skipLeadingRows." + error; + } + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) { + var error = $root.google.protobuf.StringValue.verify(message.quote, long + 1); + if (error) + return "quote." + error; + } + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowQuotedNewlines, long + 1); + if (error) + return "allowQuotedNewlines." + error; + } + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowJaggedRows, long + 1); + if (error) + return "allowJaggedRows." + error; + } + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) { + var error = $root.google.protobuf.BoolValue.verify(message.preserveAsciiControlCharacters, long + 1); + if (error) + return "preserveAsciiControlCharacters." + error; + } + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) { + var error = $root.google.protobuf.StringValue.verify(message.nullMarker, long + 1); + if (error) + return "nullMarker." + error; + } + if (message.nullMarkers != null && Object.hasOwnProperty.call(message, "nullMarkers")) { + if (!Array.isArray(message.nullMarkers)) + return "nullMarkers: array expected"; + for (var i = 0; i < message.nullMarkers.length; ++i) + if (!$util.isString(message.nullMarkers[i])) + return "nullMarkers: string[] expected"; + } + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + if (!$util.isString(message.sourceColumnMatch)) + return "sourceColumnMatch: string expected"; + return null; + }; + + /** + * Creates a CsvOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.CsvOptions} CsvOptions + */ + CsvOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.CsvOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.CsvOptions(); + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.skipLeadingRows != null) { + if (!$util.isObject(object.skipLeadingRows)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.skipLeadingRows: object expected"); + message.skipLeadingRows = $root.google.protobuf.Int64Value.fromObject(object.skipLeadingRows, long + 1); + } + if (object.quote != null) { + if (!$util.isObject(object.quote)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.quote: object expected"); + message.quote = $root.google.protobuf.StringValue.fromObject(object.quote, long + 1); + } + if (object.allowQuotedNewlines != null) { + if (!$util.isObject(object.allowQuotedNewlines)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.allowQuotedNewlines: object expected"); + message.allowQuotedNewlines = $root.google.protobuf.BoolValue.fromObject(object.allowQuotedNewlines, long + 1); + } + if (object.allowJaggedRows != null) { + if (!$util.isObject(object.allowJaggedRows)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.allowJaggedRows: object expected"); + message.allowJaggedRows = $root.google.protobuf.BoolValue.fromObject(object.allowJaggedRows, long + 1); + } + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.preserveAsciiControlCharacters != null) { + if (!$util.isObject(object.preserveAsciiControlCharacters)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.preserveAsciiControlCharacters: object expected"); + message.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.fromObject(object.preserveAsciiControlCharacters, long + 1); + } + if (object.nullMarker != null) { + if (!$util.isObject(object.nullMarker)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.nullMarker: object expected"); + message.nullMarker = $root.google.protobuf.StringValue.fromObject(object.nullMarker, long + 1); + } + if (object.nullMarkers) { + if (!Array.isArray(object.nullMarkers)) + throw TypeError(".google.cloud.bigquery.v2.CsvOptions.nullMarkers: array expected"); + message.nullMarkers = []; + for (var i = 0; i < object.nullMarkers.length; ++i) + message.nullMarkers[i] = String(object.nullMarkers[i]); + } + if (object.sourceColumnMatch != null) + message.sourceColumnMatch = String(object.sourceColumnMatch); + return message; + }; + + /** + * Creates a plain object from a CsvOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {google.cloud.bigquery.v2.CsvOptions} message CsvOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CsvOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.nullMarkers = []; + if (options.defaults) { + object.fieldDelimiter = ""; + object.skipLeadingRows = null; + object.quote = null; + object.allowQuotedNewlines = null; + object.allowJaggedRows = null; + object.encoding = ""; + object.preserveAsciiControlCharacters = null; + object.nullMarker = null; + object.sourceColumnMatch = ""; + } + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + object.skipLeadingRows = $root.google.protobuf.Int64Value.toObject(message.skipLeadingRows, options, q + 1); + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + object.quote = $root.google.protobuf.StringValue.toObject(message.quote, options, q + 1); + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) + object.allowQuotedNewlines = $root.google.protobuf.BoolValue.toObject(message.allowQuotedNewlines, options, q + 1); + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) + object.allowJaggedRows = $root.google.protobuf.BoolValue.toObject(message.allowJaggedRows, options, q + 1); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + object.encoding = message.encoding; + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) + object.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.toObject(message.preserveAsciiControlCharacters, options, q + 1); + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) + object.nullMarker = $root.google.protobuf.StringValue.toObject(message.nullMarker, options, q + 1); + if (message.nullMarkers && message.nullMarkers.length) { + object.nullMarkers = []; + for (var j = 0; j < message.nullMarkers.length; ++j) + object.nullMarkers[j] = message.nullMarkers[j]; + } + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + object.sourceColumnMatch = message.sourceColumnMatch; + return object; + }; + + /** + * Converts this CsvOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.CsvOptions + * @instance + * @returns {Object.} JSON object + */ + CsvOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CsvOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.CsvOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CsvOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.CsvOptions"; + }; + + return CsvOptions; + })(); + + v2.JsonOptions = (function() { + + /** + * Properties of a JsonOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IJsonOptions + * @property {string|null} [encoding] JsonOptions encoding + */ + + /** + * Constructs a new JsonOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JsonOptions. + * @implements IJsonOptions + * @constructor + * @param {google.cloud.bigquery.v2.IJsonOptions=} [properties] Properties to set + */ + function JsonOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JsonOptions encoding. + * @member {string} encoding + * @memberof google.cloud.bigquery.v2.JsonOptions + * @instance + */ + JsonOptions.prototype.encoding = ""; + + /** + * Creates a new JsonOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {google.cloud.bigquery.v2.IJsonOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JsonOptions} JsonOptions instance + */ + JsonOptions.create = function create(properties) { + return new JsonOptions(properties); + }; + + /** + * Encodes the specified JsonOptions message. Does not implicitly {@link google.cloud.bigquery.v2.JsonOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {google.cloud.bigquery.v2.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encoding); + return writer; + }; + + /** + * Encodes the specified JsonOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JsonOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {google.cloud.bigquery.v2.IJsonOptions} message JsonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JsonOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JsonOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.encoding = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JsonOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JsonOptions} JsonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JsonOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JsonOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JsonOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + return null; + }; + + /** + * Creates a JsonOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JsonOptions} JsonOptions + */ + JsonOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JsonOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JsonOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JsonOptions(); + if (object.encoding != null) + message.encoding = String(object.encoding); + return message; + }; + + /** + * Creates a plain object from a JsonOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {google.cloud.bigquery.v2.JsonOptions} message JsonOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JsonOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.encoding = ""; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + object.encoding = message.encoding; + return object; + }; + + /** + * Converts this JsonOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JsonOptions + * @instance + * @returns {Object.} JSON object + */ + JsonOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JsonOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JsonOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JsonOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JsonOptions"; + }; + + return JsonOptions; + })(); + + v2.BigtableProtoConfig = (function() { + + /** + * Properties of a BigtableProtoConfig. + * @memberof google.cloud.bigquery.v2 + * @interface IBigtableProtoConfig + * @property {string|null} [schemaBundleId] BigtableProtoConfig schemaBundleId + * @property {string|null} [protoMessageName] BigtableProtoConfig protoMessageName + */ + + /** + * Constructs a new BigtableProtoConfig. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BigtableProtoConfig. + * @implements IBigtableProtoConfig + * @constructor + * @param {google.cloud.bigquery.v2.IBigtableProtoConfig=} [properties] Properties to set + */ + function BigtableProtoConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigtableProtoConfig schemaBundleId. + * @member {string} schemaBundleId + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @instance + */ + BigtableProtoConfig.prototype.schemaBundleId = ""; + + /** + * BigtableProtoConfig protoMessageName. + * @member {string} protoMessageName + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @instance + */ + BigtableProtoConfig.prototype.protoMessageName = ""; + + /** + * Creates a new BigtableProtoConfig instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {google.cloud.bigquery.v2.IBigtableProtoConfig=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BigtableProtoConfig} BigtableProtoConfig instance + */ + BigtableProtoConfig.create = function create(properties) { + return new BigtableProtoConfig(properties); + }; + + /** + * Encodes the specified BigtableProtoConfig message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableProtoConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {google.cloud.bigquery.v2.IBigtableProtoConfig} message BigtableProtoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableProtoConfig.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.protoMessageName != null && Object.hasOwnProperty.call(message, "protoMessageName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.protoMessageName); + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaBundleId); + return writer; + }; + + /** + * Encodes the specified BigtableProtoConfig message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableProtoConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {google.cloud.bigquery.v2.IBigtableProtoConfig} message BigtableProtoConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableProtoConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigtableProtoConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BigtableProtoConfig} BigtableProtoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableProtoConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BigtableProtoConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.schemaBundleId = reader.string(); + break; + } + case 2: { + message.protoMessageName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigtableProtoConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BigtableProtoConfig} BigtableProtoConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableProtoConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigtableProtoConfig message. + * @function verify + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigtableProtoConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + if (!$util.isString(message.schemaBundleId)) + return "schemaBundleId: string expected"; + if (message.protoMessageName != null && Object.hasOwnProperty.call(message, "protoMessageName")) + if (!$util.isString(message.protoMessageName)) + return "protoMessageName: string expected"; + return null; + }; + + /** + * Creates a BigtableProtoConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BigtableProtoConfig} BigtableProtoConfig + */ + BigtableProtoConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BigtableProtoConfig) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BigtableProtoConfig: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BigtableProtoConfig(); + if (object.schemaBundleId != null) + message.schemaBundleId = String(object.schemaBundleId); + if (object.protoMessageName != null) + message.protoMessageName = String(object.protoMessageName); + return message; + }; + + /** + * Creates a plain object from a BigtableProtoConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {google.cloud.bigquery.v2.BigtableProtoConfig} message BigtableProtoConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigtableProtoConfig.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.protoMessageName = ""; + object.schemaBundleId = ""; + } + if (message.protoMessageName != null && Object.hasOwnProperty.call(message, "protoMessageName")) + object.protoMessageName = message.protoMessageName; + if (message.schemaBundleId != null && Object.hasOwnProperty.call(message, "schemaBundleId")) + object.schemaBundleId = message.schemaBundleId; + return object; + }; + + /** + * Converts this BigtableProtoConfig to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @instance + * @returns {Object.} JSON object + */ + BigtableProtoConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigtableProtoConfig + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BigtableProtoConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigtableProtoConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BigtableProtoConfig"; + }; + + return BigtableProtoConfig; + })(); + + v2.BigtableColumn = (function() { + + /** + * Properties of a BigtableColumn. + * @memberof google.cloud.bigquery.v2 + * @interface IBigtableColumn + * @property {google.protobuf.IBytesValue|null} [qualifierEncoded] BigtableColumn qualifierEncoded + * @property {google.protobuf.IStringValue|null} [qualifierString] BigtableColumn qualifierString + * @property {string|null} [fieldName] BigtableColumn fieldName + * @property {string|null} [type] BigtableColumn type + * @property {string|null} [encoding] BigtableColumn encoding + * @property {google.protobuf.IBoolValue|null} [onlyReadLatest] BigtableColumn onlyReadLatest + * @property {google.cloud.bigquery.v2.IBigtableProtoConfig|null} [protoConfig] BigtableColumn protoConfig + */ + + /** + * Constructs a new BigtableColumn. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BigtableColumn. + * @implements IBigtableColumn + * @constructor + * @param {google.cloud.bigquery.v2.IBigtableColumn=} [properties] Properties to set + */ + function BigtableColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigtableColumn qualifierEncoded. + * @member {google.protobuf.IBytesValue|null|undefined} qualifierEncoded + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.qualifierEncoded = null; + + /** + * BigtableColumn qualifierString. + * @member {google.protobuf.IStringValue|null|undefined} qualifierString + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.qualifierString = null; + + /** + * BigtableColumn fieldName. + * @member {string} fieldName + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.fieldName = ""; + + /** + * BigtableColumn type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.type = ""; + + /** + * BigtableColumn encoding. + * @member {string} encoding + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.encoding = ""; + + /** + * BigtableColumn onlyReadLatest. + * @member {google.protobuf.IBoolValue|null|undefined} onlyReadLatest + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.onlyReadLatest = null; + + /** + * BigtableColumn protoConfig. + * @member {google.cloud.bigquery.v2.IBigtableProtoConfig|null|undefined} protoConfig + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + */ + BigtableColumn.prototype.protoConfig = null; + + /** + * Creates a new BigtableColumn instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumn=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BigtableColumn} BigtableColumn instance + */ + BigtableColumn.create = function create(properties) { + return new BigtableColumn(properties); + }; + + /** + * Encodes the specified BigtableColumn message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumn} message BigtableColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumn.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.qualifierEncoded != null && Object.hasOwnProperty.call(message, "qualifierEncoded")) + $root.google.protobuf.BytesValue.encode(message.qualifierEncoded, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.qualifierString != null && Object.hasOwnProperty.call(message, "qualifierString")) + $root.google.protobuf.StringValue.encode(message.qualifierString, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fieldName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.encoding); + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) + $root.google.protobuf.BoolValue.encode(message.onlyReadLatest, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) + $root.google.cloud.bigquery.v2.BigtableProtoConfig.encode(message.protoConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigtableColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumn} message BigtableColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BigtableColumn} BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BigtableColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.qualifierEncoded = $root.google.protobuf.BytesValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.qualifierString = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.fieldName = reader.string(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 5: { + message.encoding = reader.string(); + break; + } + case 6: { + message.onlyReadLatest = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigtableColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BigtableColumn} BigtableColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigtableColumn message. + * @function verify + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigtableColumn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.qualifierEncoded != null && Object.hasOwnProperty.call(message, "qualifierEncoded")) { + var error = $root.google.protobuf.BytesValue.verify(message.qualifierEncoded, long + 1); + if (error) + return "qualifierEncoded." + error; + } + if (message.qualifierString != null && Object.hasOwnProperty.call(message, "qualifierString")) { + var error = $root.google.protobuf.StringValue.verify(message.qualifierString, long + 1); + if (error) + return "qualifierString." + error; + } + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) { + var error = $root.google.protobuf.BoolValue.verify(message.onlyReadLatest, long + 1); + if (error) + return "onlyReadLatest." + error; + } + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) { + var error = $root.google.cloud.bigquery.v2.BigtableProtoConfig.verify(message.protoConfig, long + 1); + if (error) + return "protoConfig." + error; + } + return null; + }; + + /** + * Creates a BigtableColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BigtableColumn} BigtableColumn + */ + BigtableColumn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BigtableColumn) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumn: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BigtableColumn(); + if (object.qualifierEncoded != null) { + if (!$util.isObject(object.qualifierEncoded)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumn.qualifierEncoded: object expected"); + message.qualifierEncoded = $root.google.protobuf.BytesValue.fromObject(object.qualifierEncoded, long + 1); + } + if (object.qualifierString != null) { + if (!$util.isObject(object.qualifierString)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumn.qualifierString: object expected"); + message.qualifierString = $root.google.protobuf.StringValue.fromObject(object.qualifierString, long + 1); + } + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + if (object.type != null) + message.type = String(object.type); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.onlyReadLatest != null) { + if (!$util.isObject(object.onlyReadLatest)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumn.onlyReadLatest: object expected"); + message.onlyReadLatest = $root.google.protobuf.BoolValue.fromObject(object.onlyReadLatest, long + 1); + } + if (object.protoConfig != null) { + if (!$util.isObject(object.protoConfig)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumn.protoConfig: object expected"); + message.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.fromObject(object.protoConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BigtableColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {google.cloud.bigquery.v2.BigtableColumn} message BigtableColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigtableColumn.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.qualifierEncoded = null; + object.qualifierString = null; + object.fieldName = ""; + object.type = ""; + object.encoding = ""; + object.onlyReadLatest = null; + object.protoConfig = null; + } + if (message.qualifierEncoded != null && Object.hasOwnProperty.call(message, "qualifierEncoded")) + object.qualifierEncoded = $root.google.protobuf.BytesValue.toObject(message.qualifierEncoded, options, q + 1); + if (message.qualifierString != null && Object.hasOwnProperty.call(message, "qualifierString")) + object.qualifierString = $root.google.protobuf.StringValue.toObject(message.qualifierString, options, q + 1); + if (message.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + object.fieldName = message.fieldName; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + object.encoding = message.encoding; + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) + object.onlyReadLatest = $root.google.protobuf.BoolValue.toObject(message.onlyReadLatest, options, q + 1); + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) + object.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.toObject(message.protoConfig, options, q + 1); + return object; + }; + + /** + * Converts this BigtableColumn to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @instance + * @returns {Object.} JSON object + */ + BigtableColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigtableColumn + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BigtableColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigtableColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BigtableColumn"; + }; + + return BigtableColumn; + })(); + + v2.BigtableColumnFamily = (function() { + + /** + * Properties of a BigtableColumnFamily. + * @memberof google.cloud.bigquery.v2 + * @interface IBigtableColumnFamily + * @property {string|null} [familyId] BigtableColumnFamily familyId + * @property {string|null} [type] BigtableColumnFamily type + * @property {string|null} [encoding] BigtableColumnFamily encoding + * @property {Array.|null} [columns] BigtableColumnFamily columns + * @property {google.protobuf.IBoolValue|null} [onlyReadLatest] BigtableColumnFamily onlyReadLatest + * @property {google.cloud.bigquery.v2.IBigtableProtoConfig|null} [protoConfig] BigtableColumnFamily protoConfig + */ + + /** + * Constructs a new BigtableColumnFamily. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BigtableColumnFamily. + * @implements IBigtableColumnFamily + * @constructor + * @param {google.cloud.bigquery.v2.IBigtableColumnFamily=} [properties] Properties to set + */ + function BigtableColumnFamily(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigtableColumnFamily familyId. + * @member {string} familyId + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.familyId = ""; + + /** + * BigtableColumnFamily type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.type = ""; + + /** + * BigtableColumnFamily encoding. + * @member {string} encoding + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.encoding = ""; + + /** + * BigtableColumnFamily columns. + * @member {Array.} columns + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.columns = $util.emptyArray; + + /** + * BigtableColumnFamily onlyReadLatest. + * @member {google.protobuf.IBoolValue|null|undefined} onlyReadLatest + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.onlyReadLatest = null; + + /** + * BigtableColumnFamily protoConfig. + * @member {google.cloud.bigquery.v2.IBigtableProtoConfig|null|undefined} protoConfig + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + */ + BigtableColumnFamily.prototype.protoConfig = null; + + /** + * Creates a new BigtableColumnFamily instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumnFamily=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BigtableColumnFamily} BigtableColumnFamily instance + */ + BigtableColumnFamily.create = function create(properties) { + return new BigtableColumnFamily(properties); + }; + + /** + * Encodes the specified BigtableColumnFamily message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumnFamily.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumnFamily} message BigtableColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumnFamily.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.familyId != null && Object.hasOwnProperty.call(message, "familyId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.familyId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.encoding); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.bigquery.v2.BigtableColumn.encode(message.columns[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) + $root.google.protobuf.BoolValue.encode(message.onlyReadLatest, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) + $root.google.cloud.bigquery.v2.BigtableProtoConfig.encode(message.protoConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigtableColumnFamily message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableColumnFamily.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {google.cloud.bigquery.v2.IBigtableColumnFamily} message BigtableColumnFamily message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableColumnFamily.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BigtableColumnFamily} BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumnFamily.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BigtableColumnFamily(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.familyId = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.encoding = reader.string(); + break; + } + case 4: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.bigquery.v2.BigtableColumn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.onlyReadLatest = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigtableColumnFamily message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BigtableColumnFamily} BigtableColumnFamily + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableColumnFamily.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigtableColumnFamily message. + * @function verify + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigtableColumnFamily.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.familyId != null && Object.hasOwnProperty.call(message, "familyId")) + if (!$util.isString(message.familyId)) + return "familyId: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.BigtableColumn.verify(message.columns[i], long + 1); + if (error) + return "columns." + error; + } + } + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) { + var error = $root.google.protobuf.BoolValue.verify(message.onlyReadLatest, long + 1); + if (error) + return "onlyReadLatest." + error; + } + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) { + var error = $root.google.cloud.bigquery.v2.BigtableProtoConfig.verify(message.protoConfig, long + 1); + if (error) + return "protoConfig." + error; + } + return null; + }; + + /** + * Creates a BigtableColumnFamily message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BigtableColumnFamily} BigtableColumnFamily + */ + BigtableColumnFamily.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BigtableColumnFamily) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumnFamily: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BigtableColumnFamily(); + if (object.familyId != null) + message.familyId = String(object.familyId); + if (object.type != null) + message.type = String(object.type); + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumnFamily.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (!$util.isObject(object.columns[i])) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumnFamily.columns: object expected"); + message.columns[i] = $root.google.cloud.bigquery.v2.BigtableColumn.fromObject(object.columns[i], long + 1); + } + } + if (object.onlyReadLatest != null) { + if (!$util.isObject(object.onlyReadLatest)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumnFamily.onlyReadLatest: object expected"); + message.onlyReadLatest = $root.google.protobuf.BoolValue.fromObject(object.onlyReadLatest, long + 1); + } + if (object.protoConfig != null) { + if (!$util.isObject(object.protoConfig)) + throw TypeError(".google.cloud.bigquery.v2.BigtableColumnFamily.protoConfig: object expected"); + message.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.fromObject(object.protoConfig, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BigtableColumnFamily message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {google.cloud.bigquery.v2.BigtableColumnFamily} message BigtableColumnFamily + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigtableColumnFamily.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.familyId = ""; + object.type = ""; + object.encoding = ""; + object.onlyReadLatest = null; + object.protoConfig = null; + } + if (message.familyId != null && Object.hasOwnProperty.call(message, "familyId")) + object.familyId = message.familyId; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + object.encoding = message.encoding; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.bigquery.v2.BigtableColumn.toObject(message.columns[j], options, q + 1); + } + if (message.onlyReadLatest != null && Object.hasOwnProperty.call(message, "onlyReadLatest")) + object.onlyReadLatest = $root.google.protobuf.BoolValue.toObject(message.onlyReadLatest, options, q + 1); + if (message.protoConfig != null && Object.hasOwnProperty.call(message, "protoConfig")) + object.protoConfig = $root.google.cloud.bigquery.v2.BigtableProtoConfig.toObject(message.protoConfig, options, q + 1); + return object; + }; + + /** + * Converts this BigtableColumnFamily to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @instance + * @returns {Object.} JSON object + */ + BigtableColumnFamily.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigtableColumnFamily + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BigtableColumnFamily + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigtableColumnFamily.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BigtableColumnFamily"; + }; + + return BigtableColumnFamily; + })(); + + v2.BigtableOptions = (function() { + + /** + * Properties of a BigtableOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IBigtableOptions + * @property {Array.|null} [columnFamilies] BigtableOptions columnFamilies + * @property {google.protobuf.IBoolValue|null} [ignoreUnspecifiedColumnFamilies] BigtableOptions ignoreUnspecifiedColumnFamilies + * @property {google.protobuf.IBoolValue|null} [readRowkeyAsString] BigtableOptions readRowkeyAsString + * @property {google.protobuf.IBoolValue|null} [outputColumnFamiliesAsJson] BigtableOptions outputColumnFamiliesAsJson + */ + + /** + * Constructs a new BigtableOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BigtableOptions. + * @implements IBigtableOptions + * @constructor + * @param {google.cloud.bigquery.v2.IBigtableOptions=} [properties] Properties to set + */ + function BigtableOptions(properties) { + this.columnFamilies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigtableOptions columnFamilies. + * @member {Array.} columnFamilies + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @instance + */ + BigtableOptions.prototype.columnFamilies = $util.emptyArray; + + /** + * BigtableOptions ignoreUnspecifiedColumnFamilies. + * @member {google.protobuf.IBoolValue|null|undefined} ignoreUnspecifiedColumnFamilies + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @instance + */ + BigtableOptions.prototype.ignoreUnspecifiedColumnFamilies = null; + + /** + * BigtableOptions readRowkeyAsString. + * @member {google.protobuf.IBoolValue|null|undefined} readRowkeyAsString + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @instance + */ + BigtableOptions.prototype.readRowkeyAsString = null; + + /** + * BigtableOptions outputColumnFamiliesAsJson. + * @member {google.protobuf.IBoolValue|null|undefined} outputColumnFamiliesAsJson + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @instance + */ + BigtableOptions.prototype.outputColumnFamiliesAsJson = null; + + /** + * Creates a new BigtableOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {google.cloud.bigquery.v2.IBigtableOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BigtableOptions} BigtableOptions instance + */ + BigtableOptions.create = function create(properties) { + return new BigtableOptions(properties); + }; + + /** + * Encodes the specified BigtableOptions message. Does not implicitly {@link google.cloud.bigquery.v2.BigtableOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {google.cloud.bigquery.v2.IBigtableOptions} message BigtableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.columnFamilies != null && message.columnFamilies.length) + for (var i = 0; i < message.columnFamilies.length; ++i) + $root.google.cloud.bigquery.v2.BigtableColumnFamily.encode(message.columnFamilies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.ignoreUnspecifiedColumnFamilies != null && Object.hasOwnProperty.call(message, "ignoreUnspecifiedColumnFamilies")) + $root.google.protobuf.BoolValue.encode(message.ignoreUnspecifiedColumnFamilies, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.readRowkeyAsString != null && Object.hasOwnProperty.call(message, "readRowkeyAsString")) + $root.google.protobuf.BoolValue.encode(message.readRowkeyAsString, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.outputColumnFamiliesAsJson != null && Object.hasOwnProperty.call(message, "outputColumnFamiliesAsJson")) + $root.google.protobuf.BoolValue.encode(message.outputColumnFamiliesAsJson, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified BigtableOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BigtableOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {google.cloud.bigquery.v2.IBigtableOptions} message BigtableOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigtableOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigtableOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BigtableOptions} BigtableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BigtableOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columnFamilies && message.columnFamilies.length)) + message.columnFamilies = []; + message.columnFamilies.push($root.google.cloud.bigquery.v2.BigtableColumnFamily.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.ignoreUnspecifiedColumnFamilies = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.readRowkeyAsString = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputColumnFamiliesAsJson = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigtableOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BigtableOptions} BigtableOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigtableOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigtableOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigtableOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.columnFamilies != null && Object.hasOwnProperty.call(message, "columnFamilies")) { + if (!Array.isArray(message.columnFamilies)) + return "columnFamilies: array expected"; + for (var i = 0; i < message.columnFamilies.length; ++i) { + var error = $root.google.cloud.bigquery.v2.BigtableColumnFamily.verify(message.columnFamilies[i], long + 1); + if (error) + return "columnFamilies." + error; + } + } + if (message.ignoreUnspecifiedColumnFamilies != null && Object.hasOwnProperty.call(message, "ignoreUnspecifiedColumnFamilies")) { + var error = $root.google.protobuf.BoolValue.verify(message.ignoreUnspecifiedColumnFamilies, long + 1); + if (error) + return "ignoreUnspecifiedColumnFamilies." + error; + } + if (message.readRowkeyAsString != null && Object.hasOwnProperty.call(message, "readRowkeyAsString")) { + var error = $root.google.protobuf.BoolValue.verify(message.readRowkeyAsString, long + 1); + if (error) + return "readRowkeyAsString." + error; + } + if (message.outputColumnFamiliesAsJson != null && Object.hasOwnProperty.call(message, "outputColumnFamiliesAsJson")) { + var error = $root.google.protobuf.BoolValue.verify(message.outputColumnFamiliesAsJson, long + 1); + if (error) + return "outputColumnFamiliesAsJson." + error; + } + return null; + }; + + /** + * Creates a BigtableOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BigtableOptions} BigtableOptions + */ + BigtableOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BigtableOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BigtableOptions(); + if (object.columnFamilies) { + if (!Array.isArray(object.columnFamilies)) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions.columnFamilies: array expected"); + message.columnFamilies = []; + for (var i = 0; i < object.columnFamilies.length; ++i) { + if (!$util.isObject(object.columnFamilies[i])) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions.columnFamilies: object expected"); + message.columnFamilies[i] = $root.google.cloud.bigquery.v2.BigtableColumnFamily.fromObject(object.columnFamilies[i], long + 1); + } + } + if (object.ignoreUnspecifiedColumnFamilies != null) { + if (!$util.isObject(object.ignoreUnspecifiedColumnFamilies)) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions.ignoreUnspecifiedColumnFamilies: object expected"); + message.ignoreUnspecifiedColumnFamilies = $root.google.protobuf.BoolValue.fromObject(object.ignoreUnspecifiedColumnFamilies, long + 1); + } + if (object.readRowkeyAsString != null) { + if (!$util.isObject(object.readRowkeyAsString)) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions.readRowkeyAsString: object expected"); + message.readRowkeyAsString = $root.google.protobuf.BoolValue.fromObject(object.readRowkeyAsString, long + 1); + } + if (object.outputColumnFamiliesAsJson != null) { + if (!$util.isObject(object.outputColumnFamiliesAsJson)) + throw TypeError(".google.cloud.bigquery.v2.BigtableOptions.outputColumnFamiliesAsJson: object expected"); + message.outputColumnFamiliesAsJson = $root.google.protobuf.BoolValue.fromObject(object.outputColumnFamiliesAsJson, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BigtableOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {google.cloud.bigquery.v2.BigtableOptions} message BigtableOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigtableOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.columnFamilies = []; + if (options.defaults) { + object.ignoreUnspecifiedColumnFamilies = null; + object.readRowkeyAsString = null; + object.outputColumnFamiliesAsJson = null; + } + if (message.columnFamilies && message.columnFamilies.length) { + object.columnFamilies = []; + for (var j = 0; j < message.columnFamilies.length; ++j) + object.columnFamilies[j] = $root.google.cloud.bigquery.v2.BigtableColumnFamily.toObject(message.columnFamilies[j], options, q + 1); + } + if (message.ignoreUnspecifiedColumnFamilies != null && Object.hasOwnProperty.call(message, "ignoreUnspecifiedColumnFamilies")) + object.ignoreUnspecifiedColumnFamilies = $root.google.protobuf.BoolValue.toObject(message.ignoreUnspecifiedColumnFamilies, options, q + 1); + if (message.readRowkeyAsString != null && Object.hasOwnProperty.call(message, "readRowkeyAsString")) + object.readRowkeyAsString = $root.google.protobuf.BoolValue.toObject(message.readRowkeyAsString, options, q + 1); + if (message.outputColumnFamiliesAsJson != null && Object.hasOwnProperty.call(message, "outputColumnFamiliesAsJson")) + object.outputColumnFamiliesAsJson = $root.google.protobuf.BoolValue.toObject(message.outputColumnFamiliesAsJson, options, q + 1); + return object; + }; + + /** + * Converts this BigtableOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @instance + * @returns {Object.} JSON object + */ + BigtableOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigtableOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BigtableOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigtableOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BigtableOptions"; + }; + + return BigtableOptions; + })(); + + v2.GoogleSheetsOptions = (function() { + + /** + * Properties of a GoogleSheetsOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IGoogleSheetsOptions + * @property {google.protobuf.IInt64Value|null} [skipLeadingRows] GoogleSheetsOptions skipLeadingRows + * @property {string|null} [range] GoogleSheetsOptions range + */ + + /** + * Constructs a new GoogleSheetsOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GoogleSheetsOptions. + * @implements IGoogleSheetsOptions + * @constructor + * @param {google.cloud.bigquery.v2.IGoogleSheetsOptions=} [properties] Properties to set + */ + function GoogleSheetsOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSheetsOptions skipLeadingRows. + * @member {google.protobuf.IInt64Value|null|undefined} skipLeadingRows + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @instance + */ + GoogleSheetsOptions.prototype.skipLeadingRows = null; + + /** + * GoogleSheetsOptions range. + * @member {string} range + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @instance + */ + GoogleSheetsOptions.prototype.range = ""; + + /** + * Creates a new GoogleSheetsOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {google.cloud.bigquery.v2.IGoogleSheetsOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GoogleSheetsOptions} GoogleSheetsOptions instance + */ + GoogleSheetsOptions.create = function create(properties) { + return new GoogleSheetsOptions(properties); + }; + + /** + * Encodes the specified GoogleSheetsOptions message. Does not implicitly {@link google.cloud.bigquery.v2.GoogleSheetsOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {google.cloud.bigquery.v2.IGoogleSheetsOptions} message GoogleSheetsOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSheetsOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + $root.google.protobuf.Int64Value.encode(message.skipLeadingRows, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.range); + return writer; + }; + + /** + * Encodes the specified GoogleSheetsOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GoogleSheetsOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {google.cloud.bigquery.v2.IGoogleSheetsOptions} message GoogleSheetsOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSheetsOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GoogleSheetsOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GoogleSheetsOptions} GoogleSheetsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSheetsOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GoogleSheetsOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.skipLeadingRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.range = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSheetsOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GoogleSheetsOptions} GoogleSheetsOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSheetsOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSheetsOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSheetsOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.skipLeadingRows, long + 1); + if (error) + return "skipLeadingRows." + error; + } + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + if (!$util.isString(message.range)) + return "range: string expected"; + return null; + }; + + /** + * Creates a GoogleSheetsOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GoogleSheetsOptions} GoogleSheetsOptions + */ + GoogleSheetsOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GoogleSheetsOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GoogleSheetsOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GoogleSheetsOptions(); + if (object.skipLeadingRows != null) { + if (!$util.isObject(object.skipLeadingRows)) + throw TypeError(".google.cloud.bigquery.v2.GoogleSheetsOptions.skipLeadingRows: object expected"); + message.skipLeadingRows = $root.google.protobuf.Int64Value.fromObject(object.skipLeadingRows, long + 1); + } + if (object.range != null) + message.range = String(object.range); + return message; + }; + + /** + * Creates a plain object from a GoogleSheetsOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {google.cloud.bigquery.v2.GoogleSheetsOptions} message GoogleSheetsOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSheetsOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.skipLeadingRows = null; + object.range = ""; + } + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + object.skipLeadingRows = $root.google.protobuf.Int64Value.toObject(message.skipLeadingRows, options, q + 1); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + object.range = message.range; + return object; + }; + + /** + * Converts this GoogleSheetsOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @instance + * @returns {Object.} JSON object + */ + GoogleSheetsOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSheetsOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GoogleSheetsOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSheetsOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GoogleSheetsOptions"; + }; + + return GoogleSheetsOptions; + })(); + + v2.ExternalDataConfiguration = (function() { + + /** + * Properties of an ExternalDataConfiguration. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalDataConfiguration + * @property {Array.|null} [sourceUris] ExternalDataConfiguration sourceUris + * @property {google.cloud.bigquery.v2.FileSetSpecType|null} [fileSetSpecType] ExternalDataConfiguration fileSetSpecType + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] ExternalDataConfiguration schema + * @property {string|null} [sourceFormat] ExternalDataConfiguration sourceFormat + * @property {google.protobuf.IInt32Value|null} [maxBadRecords] ExternalDataConfiguration maxBadRecords + * @property {google.protobuf.IBoolValue|null} [autodetect] ExternalDataConfiguration autodetect + * @property {google.protobuf.IBoolValue|null} [ignoreUnknownValues] ExternalDataConfiguration ignoreUnknownValues + * @property {string|null} [compression] ExternalDataConfiguration compression + * @property {google.cloud.bigquery.v2.ICsvOptions|null} [csvOptions] ExternalDataConfiguration csvOptions + * @property {google.cloud.bigquery.v2.IJsonOptions|null} [jsonOptions] ExternalDataConfiguration jsonOptions + * @property {google.cloud.bigquery.v2.IBigtableOptions|null} [bigtableOptions] ExternalDataConfiguration bigtableOptions + * @property {google.cloud.bigquery.v2.IGoogleSheetsOptions|null} [googleSheetsOptions] ExternalDataConfiguration googleSheetsOptions + * @property {google.cloud.bigquery.v2.IHivePartitioningOptions|null} [hivePartitioningOptions] ExternalDataConfiguration hivePartitioningOptions + * @property {string|null} [connectionId] ExternalDataConfiguration connectionId + * @property {Array.|null} [decimalTargetTypes] ExternalDataConfiguration decimalTargetTypes + * @property {google.cloud.bigquery.v2.IAvroOptions|null} [avroOptions] ExternalDataConfiguration avroOptions + * @property {google.cloud.bigquery.v2.JsonExtension|null} [jsonExtension] ExternalDataConfiguration jsonExtension + * @property {google.cloud.bigquery.v2.IParquetOptions|null} [parquetOptions] ExternalDataConfiguration parquetOptions + * @property {google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|null} [objectMetadata] ExternalDataConfiguration objectMetadata + * @property {google.protobuf.IStringValue|null} [referenceFileSchemaUri] ExternalDataConfiguration referenceFileSchemaUri + * @property {google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode|null} [metadataCacheMode] ExternalDataConfiguration metadataCacheMode + * @property {string|null} [timeZone] ExternalDataConfiguration timeZone + * @property {string|null} [dateFormat] ExternalDataConfiguration dateFormat + * @property {string|null} [datetimeFormat] ExternalDataConfiguration datetimeFormat + * @property {string|null} [timeFormat] ExternalDataConfiguration timeFormat + * @property {string|null} [timestampFormat] ExternalDataConfiguration timestampFormat + * @property {Array.|null} [timestampTargetPrecision] ExternalDataConfiguration timestampTargetPrecision + */ + + /** + * Constructs a new ExternalDataConfiguration. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalDataConfiguration. + * @implements IExternalDataConfiguration + * @constructor + * @param {google.cloud.bigquery.v2.IExternalDataConfiguration=} [properties] Properties to set + */ + function ExternalDataConfiguration(properties) { + this.sourceUris = []; + this.decimalTargetTypes = []; + this.timestampTargetPrecision = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalDataConfiguration sourceUris. + * @member {Array.} sourceUris + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.sourceUris = $util.emptyArray; + + /** + * ExternalDataConfiguration fileSetSpecType. + * @member {google.cloud.bigquery.v2.FileSetSpecType} fileSetSpecType + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.fileSetSpecType = 0; + + /** + * ExternalDataConfiguration schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.schema = null; + + /** + * ExternalDataConfiguration sourceFormat. + * @member {string} sourceFormat + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.sourceFormat = ""; + + /** + * ExternalDataConfiguration maxBadRecords. + * @member {google.protobuf.IInt32Value|null|undefined} maxBadRecords + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.maxBadRecords = null; + + /** + * ExternalDataConfiguration autodetect. + * @member {google.protobuf.IBoolValue|null|undefined} autodetect + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.autodetect = null; + + /** + * ExternalDataConfiguration ignoreUnknownValues. + * @member {google.protobuf.IBoolValue|null|undefined} ignoreUnknownValues + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.ignoreUnknownValues = null; + + /** + * ExternalDataConfiguration compression. + * @member {string} compression + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.compression = ""; + + /** + * ExternalDataConfiguration csvOptions. + * @member {google.cloud.bigquery.v2.ICsvOptions|null|undefined} csvOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.csvOptions = null; + + /** + * ExternalDataConfiguration jsonOptions. + * @member {google.cloud.bigquery.v2.IJsonOptions|null|undefined} jsonOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.jsonOptions = null; + + /** + * ExternalDataConfiguration bigtableOptions. + * @member {google.cloud.bigquery.v2.IBigtableOptions|null|undefined} bigtableOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.bigtableOptions = null; + + /** + * ExternalDataConfiguration googleSheetsOptions. + * @member {google.cloud.bigquery.v2.IGoogleSheetsOptions|null|undefined} googleSheetsOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.googleSheetsOptions = null; + + /** + * ExternalDataConfiguration hivePartitioningOptions. + * @member {google.cloud.bigquery.v2.IHivePartitioningOptions|null|undefined} hivePartitioningOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.hivePartitioningOptions = null; + + /** + * ExternalDataConfiguration connectionId. + * @member {string} connectionId + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.connectionId = ""; + + /** + * ExternalDataConfiguration decimalTargetTypes. + * @member {Array.} decimalTargetTypes + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.decimalTargetTypes = $util.emptyArray; + + /** + * ExternalDataConfiguration avroOptions. + * @member {google.cloud.bigquery.v2.IAvroOptions|null|undefined} avroOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.avroOptions = null; + + /** + * ExternalDataConfiguration jsonExtension. + * @member {google.cloud.bigquery.v2.JsonExtension} jsonExtension + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.jsonExtension = 0; + + /** + * ExternalDataConfiguration parquetOptions. + * @member {google.cloud.bigquery.v2.IParquetOptions|null|undefined} parquetOptions + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.parquetOptions = null; + + /** + * ExternalDataConfiguration objectMetadata. + * @member {google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata|null|undefined} objectMetadata + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.objectMetadata = null; + + /** + * ExternalDataConfiguration referenceFileSchemaUri. + * @member {google.protobuf.IStringValue|null|undefined} referenceFileSchemaUri + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.referenceFileSchemaUri = null; + + /** + * ExternalDataConfiguration metadataCacheMode. + * @member {google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode} metadataCacheMode + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.metadataCacheMode = 0; + + /** + * ExternalDataConfiguration timeZone. + * @member {string|null|undefined} timeZone + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.timeZone = null; + + /** + * ExternalDataConfiguration dateFormat. + * @member {string|null|undefined} dateFormat + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.dateFormat = null; + + /** + * ExternalDataConfiguration datetimeFormat. + * @member {string|null|undefined} datetimeFormat + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.datetimeFormat = null; + + /** + * ExternalDataConfiguration timeFormat. + * @member {string|null|undefined} timeFormat + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.timeFormat = null; + + /** + * ExternalDataConfiguration timestampFormat. + * @member {string|null|undefined} timestampFormat + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.timestampFormat = null; + + /** + * ExternalDataConfiguration timestampTargetPrecision. + * @member {Array.} timestampTargetPrecision + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + */ + ExternalDataConfiguration.prototype.timestampTargetPrecision = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_objectMetadata", { + get: $util.oneOfGetter($oneOfFields = ["objectMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_timeZone", { + get: $util.oneOfGetter($oneOfFields = ["timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_dateFormat", { + get: $util.oneOfGetter($oneOfFields = ["dateFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_datetimeFormat", { + get: $util.oneOfGetter($oneOfFields = ["datetimeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_timeFormat", { + get: $util.oneOfGetter($oneOfFields = ["timeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ExternalDataConfiguration.prototype, "_timestampFormat", { + get: $util.oneOfGetter($oneOfFields = ["timestampFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExternalDataConfiguration instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {google.cloud.bigquery.v2.IExternalDataConfiguration=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalDataConfiguration} ExternalDataConfiguration instance + */ + ExternalDataConfiguration.create = function create(properties) { + return new ExternalDataConfiguration(properties); + }; + + /** + * Encodes the specified ExternalDataConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDataConfiguration.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {google.cloud.bigquery.v2.IExternalDataConfiguration} message ExternalDataConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalDataConfiguration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceUris != null && message.sourceUris.length) + for (var i = 0; i < message.sourceUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceUris[i]); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceFormat); + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) + $root.google.protobuf.Int32Value.encode(message.maxBadRecords, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) + $root.google.protobuf.BoolValue.encode(message.autodetect, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) + $root.google.protobuf.BoolValue.encode(message.ignoreUnknownValues, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.compression); + if (message.csvOptions != null && Object.hasOwnProperty.call(message, "csvOptions")) + $root.google.cloud.bigquery.v2.CsvOptions.encode(message.csvOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.bigtableOptions != null && Object.hasOwnProperty.call(message, "bigtableOptions")) + $root.google.cloud.bigquery.v2.BigtableOptions.encode(message.bigtableOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.googleSheetsOptions != null && Object.hasOwnProperty.call(message, "googleSheetsOptions")) + $root.google.cloud.bigquery.v2.GoogleSheetsOptions.encode(message.googleSheetsOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) + $root.google.cloud.bigquery.v2.HivePartitioningOptions.encode(message.hivePartitioningOptions, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.connectionId); + if (message.decimalTargetTypes != null && message.decimalTargetTypes.length) { + writer.uint32(/* id 16, wireType 2 =*/130).fork(); + for (var i = 0; i < message.decimalTargetTypes.length; ++i) + writer.int32(message.decimalTargetTypes[i]); + writer.ldelim(); + } + if (message.avroOptions != null && Object.hasOwnProperty.call(message, "avroOptions")) + $root.google.cloud.bigquery.v2.AvroOptions.encode(message.avroOptions, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.jsonExtension); + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) + $root.google.cloud.bigquery.v2.ParquetOptions.encode(message.parquetOptions, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); + if (message.objectMetadata != null && Object.hasOwnProperty.call(message, "objectMetadata")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.objectMetadata); + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) + $root.google.protobuf.StringValue.encode(message.referenceFileSchemaUri, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.metadataCacheMode != null && Object.hasOwnProperty.call(message, "metadataCacheMode")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.metadataCacheMode); + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.fileSetSpecType); + if (message.jsonOptions != null && Object.hasOwnProperty.call(message, "jsonOptions")) + $root.google.cloud.bigquery.v2.JsonOptions.encode(message.jsonOptions, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.timeZone); + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.dateFormat); + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.datetimeFormat); + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.timeFormat); + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) + writer.uint32(/* id 31, wireType 2 =*/250).string(message.timestampFormat); + if (message.timestampTargetPrecision != null && message.timestampTargetPrecision.length) { + writer.uint32(/* id 32, wireType 2 =*/258).fork(); + for (var i = 0; i < message.timestampTargetPrecision.length; ++i) + writer.int32(message.timestampTargetPrecision[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ExternalDataConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalDataConfiguration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {google.cloud.bigquery.v2.IExternalDataConfiguration} message ExternalDataConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalDataConfiguration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalDataConfiguration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalDataConfiguration} ExternalDataConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalDataConfiguration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalDataConfiguration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sourceUris && message.sourceUris.length)) + message.sourceUris = []; + message.sourceUris.push(reader.string()); + break; + } + case 25: { + message.fileSetSpecType = reader.int32(); + break; + } + case 2: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.sourceFormat = reader.string(); + break; + } + case 4: { + message.maxBadRecords = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.autodetect = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.ignoreUnknownValues = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.compression = reader.string(); + break; + } + case 8: { + message.csvOptions = $root.google.cloud.bigquery.v2.CsvOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.jsonOptions = $root.google.cloud.bigquery.v2.JsonOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.bigtableOptions = $root.google.cloud.bigquery.v2.BigtableOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.googleSheetsOptions = $root.google.cloud.bigquery.v2.GoogleSheetsOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.connectionId = reader.string(); + break; + } + case 16: { + if (!(message.decimalTargetTypes && message.decimalTargetTypes.length)) + message.decimalTargetTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.decimalTargetTypes.push(reader.int32()); + } else + message.decimalTargetTypes.push(reader.int32()); + break; + } + case 17: { + message.avroOptions = $root.google.cloud.bigquery.v2.AvroOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.jsonExtension = reader.int32(); + break; + } + case 19: { + message.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.objectMetadata = reader.int32(); + break; + } + case 23: { + message.referenceFileSchemaUri = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.metadataCacheMode = reader.int32(); + break; + } + case 27: { + message.timeZone = reader.string(); + break; + } + case 28: { + message.dateFormat = reader.string(); + break; + } + case 29: { + message.datetimeFormat = reader.string(); + break; + } + case 30: { + message.timeFormat = reader.string(); + break; + } + case 31: { + message.timestampFormat = reader.string(); + break; + } + case 32: { + if (!(message.timestampTargetPrecision && message.timestampTargetPrecision.length)) + message.timestampTargetPrecision = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.timestampTargetPrecision.push(reader.int32()); + } else + message.timestampTargetPrecision.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalDataConfiguration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalDataConfiguration} ExternalDataConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalDataConfiguration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalDataConfiguration message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalDataConfiguration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.sourceUris != null && Object.hasOwnProperty.call(message, "sourceUris")) { + if (!Array.isArray(message.sourceUris)) + return "sourceUris: array expected"; + for (var i = 0; i < message.sourceUris.length; ++i) + if (!$util.isString(message.sourceUris[i])) + return "sourceUris: string[] expected"; + } + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + switch (message.fileSetSpecType) { + default: + return "fileSetSpecType: enum value expected"; + case 0: + case 1: + break; + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + if (!$util.isString(message.sourceFormat)) + return "sourceFormat: string expected"; + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) { + var error = $root.google.protobuf.Int32Value.verify(message.maxBadRecords, long + 1); + if (error) + return "maxBadRecords." + error; + } + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) { + var error = $root.google.protobuf.BoolValue.verify(message.autodetect, long + 1); + if (error) + return "autodetect." + error; + } + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) { + var error = $root.google.protobuf.BoolValue.verify(message.ignoreUnknownValues, long + 1); + if (error) + return "ignoreUnknownValues." + error; + } + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + if (!$util.isString(message.compression)) + return "compression: string expected"; + if (message.csvOptions != null && Object.hasOwnProperty.call(message, "csvOptions")) { + var error = $root.google.cloud.bigquery.v2.CsvOptions.verify(message.csvOptions, long + 1); + if (error) + return "csvOptions." + error; + } + if (message.jsonOptions != null && Object.hasOwnProperty.call(message, "jsonOptions")) { + var error = $root.google.cloud.bigquery.v2.JsonOptions.verify(message.jsonOptions, long + 1); + if (error) + return "jsonOptions." + error; + } + if (message.bigtableOptions != null && Object.hasOwnProperty.call(message, "bigtableOptions")) { + var error = $root.google.cloud.bigquery.v2.BigtableOptions.verify(message.bigtableOptions, long + 1); + if (error) + return "bigtableOptions." + error; + } + if (message.googleSheetsOptions != null && Object.hasOwnProperty.call(message, "googleSheetsOptions")) { + var error = $root.google.cloud.bigquery.v2.GoogleSheetsOptions.verify(message.googleSheetsOptions, long + 1); + if (error) + return "googleSheetsOptions." + error; + } + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) { + var error = $root.google.cloud.bigquery.v2.HivePartitioningOptions.verify(message.hivePartitioningOptions, long + 1); + if (error) + return "hivePartitioningOptions." + error; + } + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.decimalTargetTypes != null && Object.hasOwnProperty.call(message, "decimalTargetTypes")) { + if (!Array.isArray(message.decimalTargetTypes)) + return "decimalTargetTypes: array expected"; + for (var i = 0; i < message.decimalTargetTypes.length; ++i) + switch (message.decimalTargetTypes[i]) { + default: + return "decimalTargetTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.avroOptions != null && Object.hasOwnProperty.call(message, "avroOptions")) { + var error = $root.google.cloud.bigquery.v2.AvroOptions.verify(message.avroOptions, long + 1); + if (error) + return "avroOptions." + error; + } + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + switch (message.jsonExtension) { + default: + return "jsonExtension: enum value expected"; + case 0: + case 1: + break; + } + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) { + var error = $root.google.cloud.bigquery.v2.ParquetOptions.verify(message.parquetOptions, long + 1); + if (error) + return "parquetOptions." + error; + } + if (message.objectMetadata != null && Object.hasOwnProperty.call(message, "objectMetadata")) { + properties._objectMetadata = 1; + switch (message.objectMetadata) { + default: + return "objectMetadata: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) { + var error = $root.google.protobuf.StringValue.verify(message.referenceFileSchemaUri, long + 1); + if (error) + return "referenceFileSchemaUri." + error; + } + if (message.metadataCacheMode != null && Object.hasOwnProperty.call(message, "metadataCacheMode")) + switch (message.metadataCacheMode) { + default: + return "metadataCacheMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) { + properties._timeZone = 1; + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + } + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) { + properties._dateFormat = 1; + if (!$util.isString(message.dateFormat)) + return "dateFormat: string expected"; + } + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) { + properties._datetimeFormat = 1; + if (!$util.isString(message.datetimeFormat)) + return "datetimeFormat: string expected"; + } + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) { + properties._timeFormat = 1; + if (!$util.isString(message.timeFormat)) + return "timeFormat: string expected"; + } + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) { + properties._timestampFormat = 1; + if (!$util.isString(message.timestampFormat)) + return "timestampFormat: string expected"; + } + if (message.timestampTargetPrecision != null && Object.hasOwnProperty.call(message, "timestampTargetPrecision")) { + if (!Array.isArray(message.timestampTargetPrecision)) + return "timestampTargetPrecision: array expected"; + for (var i = 0; i < message.timestampTargetPrecision.length; ++i) + if (!$util.isInteger(message.timestampTargetPrecision[i])) + return "timestampTargetPrecision: integer[] expected"; + } + return null; + }; + + /** + * Creates an ExternalDataConfiguration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalDataConfiguration} ExternalDataConfiguration + */ + ExternalDataConfiguration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalDataConfiguration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalDataConfiguration(); + if (object.sourceUris) { + if (!Array.isArray(object.sourceUris)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.sourceUris: array expected"); + message.sourceUris = []; + for (var i = 0; i < object.sourceUris.length; ++i) + message.sourceUris[i] = String(object.sourceUris[i]); + } + switch (object.fileSetSpecType) { + default: + if (typeof object.fileSetSpecType === "number") { + message.fileSetSpecType = object.fileSetSpecType; + break; + } + break; + case "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH": + case 0: + message.fileSetSpecType = 0; + break; + case "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST": + case 1: + message.fileSetSpecType = 1; + break; + } + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.sourceFormat != null) + message.sourceFormat = String(object.sourceFormat); + if (object.maxBadRecords != null) { + if (!$util.isObject(object.maxBadRecords)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.maxBadRecords: object expected"); + message.maxBadRecords = $root.google.protobuf.Int32Value.fromObject(object.maxBadRecords, long + 1); + } + if (object.autodetect != null) { + if (!$util.isObject(object.autodetect)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.autodetect: object expected"); + message.autodetect = $root.google.protobuf.BoolValue.fromObject(object.autodetect, long + 1); + } + if (object.ignoreUnknownValues != null) { + if (!$util.isObject(object.ignoreUnknownValues)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.ignoreUnknownValues: object expected"); + message.ignoreUnknownValues = $root.google.protobuf.BoolValue.fromObject(object.ignoreUnknownValues, long + 1); + } + if (object.compression != null) + message.compression = String(object.compression); + if (object.csvOptions != null) { + if (!$util.isObject(object.csvOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.csvOptions: object expected"); + message.csvOptions = $root.google.cloud.bigquery.v2.CsvOptions.fromObject(object.csvOptions, long + 1); + } + if (object.jsonOptions != null) { + if (!$util.isObject(object.jsonOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.jsonOptions: object expected"); + message.jsonOptions = $root.google.cloud.bigquery.v2.JsonOptions.fromObject(object.jsonOptions, long + 1); + } + if (object.bigtableOptions != null) { + if (!$util.isObject(object.bigtableOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.bigtableOptions: object expected"); + message.bigtableOptions = $root.google.cloud.bigquery.v2.BigtableOptions.fromObject(object.bigtableOptions, long + 1); + } + if (object.googleSheetsOptions != null) { + if (!$util.isObject(object.googleSheetsOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.googleSheetsOptions: object expected"); + message.googleSheetsOptions = $root.google.cloud.bigquery.v2.GoogleSheetsOptions.fromObject(object.googleSheetsOptions, long + 1); + } + if (object.hivePartitioningOptions != null) { + if (!$util.isObject(object.hivePartitioningOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.hivePartitioningOptions: object expected"); + message.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.fromObject(object.hivePartitioningOptions, long + 1); + } + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.decimalTargetTypes) { + if (!Array.isArray(object.decimalTargetTypes)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.decimalTargetTypes: array expected"); + message.decimalTargetTypes = []; + for (var i = 0; i < object.decimalTargetTypes.length; ++i) + switch (object.decimalTargetTypes[i]) { + default: + if (typeof object.decimalTargetTypes[i] === "number") { + message.decimalTargetTypes[i] = object.decimalTargetTypes[i]; + break; + } + case "DECIMAL_TARGET_TYPE_UNSPECIFIED": + case 0: + message.decimalTargetTypes[i] = 0; + break; + case "NUMERIC": + case 1: + message.decimalTargetTypes[i] = 1; + break; + case "BIGNUMERIC": + case 2: + message.decimalTargetTypes[i] = 2; + break; + case "STRING": + case 3: + message.decimalTargetTypes[i] = 3; + break; + } + } + if (object.avroOptions != null) { + if (!$util.isObject(object.avroOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.avroOptions: object expected"); + message.avroOptions = $root.google.cloud.bigquery.v2.AvroOptions.fromObject(object.avroOptions, long + 1); + } + switch (object.jsonExtension) { + default: + if (typeof object.jsonExtension === "number") { + message.jsonExtension = object.jsonExtension; + break; + } + break; + case "JSON_EXTENSION_UNSPECIFIED": + case 0: + message.jsonExtension = 0; + break; + case "GEOJSON": + case 1: + message.jsonExtension = 1; + break; + } + if (object.parquetOptions != null) { + if (!$util.isObject(object.parquetOptions)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.parquetOptions: object expected"); + message.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.fromObject(object.parquetOptions, long + 1); + } + switch (object.objectMetadata) { + default: + if (typeof object.objectMetadata === "number") { + message.objectMetadata = object.objectMetadata; + break; + } + break; + case "OBJECT_METADATA_UNSPECIFIED": + case 0: + message.objectMetadata = 0; + break; + case "DIRECTORY": + case 1: + message.objectMetadata = 1; + break; + case "SIMPLE": + case 2: + message.objectMetadata = 2; + break; + } + if (object.referenceFileSchemaUri != null) { + if (!$util.isObject(object.referenceFileSchemaUri)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.referenceFileSchemaUri: object expected"); + message.referenceFileSchemaUri = $root.google.protobuf.StringValue.fromObject(object.referenceFileSchemaUri, long + 1); + } + switch (object.metadataCacheMode) { + default: + if (typeof object.metadataCacheMode === "number") { + message.metadataCacheMode = object.metadataCacheMode; + break; + } + break; + case "METADATA_CACHE_MODE_UNSPECIFIED": + case 0: + message.metadataCacheMode = 0; + break; + case "AUTOMATIC": + case 1: + message.metadataCacheMode = 1; + break; + case "MANUAL": + case 2: + message.metadataCacheMode = 2; + break; + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.dateFormat != null) + message.dateFormat = String(object.dateFormat); + if (object.datetimeFormat != null) + message.datetimeFormat = String(object.datetimeFormat); + if (object.timeFormat != null) + message.timeFormat = String(object.timeFormat); + if (object.timestampFormat != null) + message.timestampFormat = String(object.timestampFormat); + if (object.timestampTargetPrecision) { + if (!Array.isArray(object.timestampTargetPrecision)) + throw TypeError(".google.cloud.bigquery.v2.ExternalDataConfiguration.timestampTargetPrecision: array expected"); + message.timestampTargetPrecision = []; + for (var i = 0; i < object.timestampTargetPrecision.length; ++i) + message.timestampTargetPrecision[i] = object.timestampTargetPrecision[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ExternalDataConfiguration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {google.cloud.bigquery.v2.ExternalDataConfiguration} message ExternalDataConfiguration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalDataConfiguration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.sourceUris = []; + object.decimalTargetTypes = []; + object.timestampTargetPrecision = []; + } + if (options.defaults) { + object.schema = null; + object.sourceFormat = ""; + object.maxBadRecords = null; + object.autodetect = null; + object.ignoreUnknownValues = null; + object.compression = ""; + object.csvOptions = null; + object.bigtableOptions = null; + object.googleSheetsOptions = null; + object.hivePartitioningOptions = null; + object.connectionId = ""; + object.avroOptions = null; + object.jsonExtension = options.enums === String ? "JSON_EXTENSION_UNSPECIFIED" : 0; + object.parquetOptions = null; + object.referenceFileSchemaUri = null; + object.metadataCacheMode = options.enums === String ? "METADATA_CACHE_MODE_UNSPECIFIED" : 0; + object.fileSetSpecType = options.enums === String ? "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH" : 0; + object.jsonOptions = null; + } + if (message.sourceUris && message.sourceUris.length) { + object.sourceUris = []; + for (var j = 0; j < message.sourceUris.length; ++j) + object.sourceUris[j] = message.sourceUris[j]; + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + object.sourceFormat = message.sourceFormat; + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) + object.maxBadRecords = $root.google.protobuf.Int32Value.toObject(message.maxBadRecords, options, q + 1); + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) + object.autodetect = $root.google.protobuf.BoolValue.toObject(message.autodetect, options, q + 1); + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) + object.ignoreUnknownValues = $root.google.protobuf.BoolValue.toObject(message.ignoreUnknownValues, options, q + 1); + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + object.compression = message.compression; + if (message.csvOptions != null && Object.hasOwnProperty.call(message, "csvOptions")) + object.csvOptions = $root.google.cloud.bigquery.v2.CsvOptions.toObject(message.csvOptions, options, q + 1); + if (message.bigtableOptions != null && Object.hasOwnProperty.call(message, "bigtableOptions")) + object.bigtableOptions = $root.google.cloud.bigquery.v2.BigtableOptions.toObject(message.bigtableOptions, options, q + 1); + if (message.googleSheetsOptions != null && Object.hasOwnProperty.call(message, "googleSheetsOptions")) + object.googleSheetsOptions = $root.google.cloud.bigquery.v2.GoogleSheetsOptions.toObject(message.googleSheetsOptions, options, q + 1); + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) + object.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.toObject(message.hivePartitioningOptions, options, q + 1); + if (message.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + object.connectionId = message.connectionId; + if (message.decimalTargetTypes && message.decimalTargetTypes.length) { + object.decimalTargetTypes = []; + for (var j = 0; j < message.decimalTargetTypes.length; ++j) + object.decimalTargetTypes[j] = options.enums === String ? $root.google.cloud.bigquery.v2.DecimalTargetType[message.decimalTargetTypes[j]] === undefined ? message.decimalTargetTypes[j] : $root.google.cloud.bigquery.v2.DecimalTargetType[message.decimalTargetTypes[j]] : message.decimalTargetTypes[j]; + } + if (message.avroOptions != null && Object.hasOwnProperty.call(message, "avroOptions")) + object.avroOptions = $root.google.cloud.bigquery.v2.AvroOptions.toObject(message.avroOptions, options, q + 1); + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + object.jsonExtension = options.enums === String ? $root.google.cloud.bigquery.v2.JsonExtension[message.jsonExtension] === undefined ? message.jsonExtension : $root.google.cloud.bigquery.v2.JsonExtension[message.jsonExtension] : message.jsonExtension; + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) + object.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.toObject(message.parquetOptions, options, q + 1); + if (message.objectMetadata != null && Object.hasOwnProperty.call(message, "objectMetadata")) { + object.objectMetadata = options.enums === String ? $root.google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata[message.objectMetadata] === undefined ? message.objectMetadata : $root.google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata[message.objectMetadata] : message.objectMetadata; + if (options.oneofs) + object._objectMetadata = "objectMetadata"; + } + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) + object.referenceFileSchemaUri = $root.google.protobuf.StringValue.toObject(message.referenceFileSchemaUri, options, q + 1); + if (message.metadataCacheMode != null && Object.hasOwnProperty.call(message, "metadataCacheMode")) + object.metadataCacheMode = options.enums === String ? $root.google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode[message.metadataCacheMode] === undefined ? message.metadataCacheMode : $root.google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode[message.metadataCacheMode] : message.metadataCacheMode; + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + object.fileSetSpecType = options.enums === String ? $root.google.cloud.bigquery.v2.FileSetSpecType[message.fileSetSpecType] === undefined ? message.fileSetSpecType : $root.google.cloud.bigquery.v2.FileSetSpecType[message.fileSetSpecType] : message.fileSetSpecType; + if (message.jsonOptions != null && Object.hasOwnProperty.call(message, "jsonOptions")) + object.jsonOptions = $root.google.cloud.bigquery.v2.JsonOptions.toObject(message.jsonOptions, options, q + 1); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) { + object.timeZone = message.timeZone; + if (options.oneofs) + object._timeZone = "timeZone"; + } + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) { + object.dateFormat = message.dateFormat; + if (options.oneofs) + object._dateFormat = "dateFormat"; + } + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) { + object.datetimeFormat = message.datetimeFormat; + if (options.oneofs) + object._datetimeFormat = "datetimeFormat"; + } + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) { + object.timeFormat = message.timeFormat; + if (options.oneofs) + object._timeFormat = "timeFormat"; + } + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) { + object.timestampFormat = message.timestampFormat; + if (options.oneofs) + object._timestampFormat = "timestampFormat"; + } + if (message.timestampTargetPrecision && message.timestampTargetPrecision.length) { + object.timestampTargetPrecision = []; + for (var j = 0; j < message.timestampTargetPrecision.length; ++j) + object.timestampTargetPrecision[j] = message.timestampTargetPrecision[j]; + } + return object; + }; + + /** + * Converts this ExternalDataConfiguration to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @instance + * @returns {Object.} JSON object + */ + ExternalDataConfiguration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalDataConfiguration + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalDataConfiguration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalDataConfiguration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalDataConfiguration"; + }; + + /** + * ObjectMetadata enum. + * @name google.cloud.bigquery.v2.ExternalDataConfiguration.ObjectMetadata + * @enum {number} + * @property {number} OBJECT_METADATA_UNSPECIFIED=0 OBJECT_METADATA_UNSPECIFIED value + * @property {number} DIRECTORY=1 DIRECTORY value + * @property {number} SIMPLE=2 SIMPLE value + */ + ExternalDataConfiguration.ObjectMetadata = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OBJECT_METADATA_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIRECTORY"] = 1; + values[valuesById[2] = "SIMPLE"] = 2; + return values; + })(); + + /** + * MetadataCacheMode enum. + * @name google.cloud.bigquery.v2.ExternalDataConfiguration.MetadataCacheMode + * @enum {number} + * @property {number} METADATA_CACHE_MODE_UNSPECIFIED=0 METADATA_CACHE_MODE_UNSPECIFIED value + * @property {number} AUTOMATIC=1 AUTOMATIC value + * @property {number} MANUAL=2 MANUAL value + */ + ExternalDataConfiguration.MetadataCacheMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATA_CACHE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATIC"] = 1; + values[valuesById[2] = "MANUAL"] = 2; + return values; + })(); + + return ExternalDataConfiguration; + })(); + + /** + * FileSetSpecType enum. + * @name google.cloud.bigquery.v2.FileSetSpecType + * @enum {number} + * @property {number} FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH=0 FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH value + * @property {number} FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST=1 FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST value + */ + v2.FileSetSpecType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH"] = 0; + values[valuesById[1] = "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST"] = 1; + return values; + })(); + + v2.HivePartitioningOptions = (function() { + + /** + * Properties of a HivePartitioningOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IHivePartitioningOptions + * @property {string|null} [mode] HivePartitioningOptions mode + * @property {string|null} [sourceUriPrefix] HivePartitioningOptions sourceUriPrefix + * @property {google.protobuf.IBoolValue|null} [requirePartitionFilter] HivePartitioningOptions requirePartitionFilter + * @property {Array.|null} [fields] HivePartitioningOptions fields + */ + + /** + * Constructs a new HivePartitioningOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a HivePartitioningOptions. + * @implements IHivePartitioningOptions + * @constructor + * @param {google.cloud.bigquery.v2.IHivePartitioningOptions=} [properties] Properties to set + */ + function HivePartitioningOptions(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HivePartitioningOptions mode. + * @member {string} mode + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @instance + */ + HivePartitioningOptions.prototype.mode = ""; + + /** + * HivePartitioningOptions sourceUriPrefix. + * @member {string} sourceUriPrefix + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @instance + */ + HivePartitioningOptions.prototype.sourceUriPrefix = ""; + + /** + * HivePartitioningOptions requirePartitionFilter. + * @member {google.protobuf.IBoolValue|null|undefined} requirePartitionFilter + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @instance + */ + HivePartitioningOptions.prototype.requirePartitionFilter = null; + + /** + * HivePartitioningOptions fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @instance + */ + HivePartitioningOptions.prototype.fields = $util.emptyArray; + + /** + * Creates a new HivePartitioningOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {google.cloud.bigquery.v2.IHivePartitioningOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.HivePartitioningOptions} HivePartitioningOptions instance + */ + HivePartitioningOptions.create = function create(properties) { + return new HivePartitioningOptions(properties); + }; + + /** + * Encodes the specified HivePartitioningOptions message. Does not implicitly {@link google.cloud.bigquery.v2.HivePartitioningOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {google.cloud.bigquery.v2.IHivePartitioningOptions} message HivePartitioningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HivePartitioningOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mode); + if (message.sourceUriPrefix != null && Object.hasOwnProperty.call(message, "sourceUriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceUriPrefix); + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + $root.google.protobuf.BoolValue.encode(message.requirePartitionFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fields[i]); + return writer; + }; + + /** + * Encodes the specified HivePartitioningOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.HivePartitioningOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {google.cloud.bigquery.v2.IHivePartitioningOptions} message HivePartitioningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HivePartitioningOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HivePartitioningOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.HivePartitioningOptions} HivePartitioningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HivePartitioningOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.HivePartitioningOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mode = reader.string(); + break; + } + case 2: { + message.sourceUriPrefix = reader.string(); + break; + } + case 3: { + message.requirePartitionFilter = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HivePartitioningOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.HivePartitioningOptions} HivePartitioningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HivePartitioningOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HivePartitioningOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HivePartitioningOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + if (!$util.isString(message.mode)) + return "mode: string expected"; + if (message.sourceUriPrefix != null && Object.hasOwnProperty.call(message, "sourceUriPrefix")) + if (!$util.isString(message.sourceUriPrefix)) + return "sourceUriPrefix: string expected"; + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) { + var error = $root.google.protobuf.BoolValue.verify(message.requirePartitionFilter, long + 1); + if (error) + return "requirePartitionFilter." + error; + } + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) + if (!$util.isString(message.fields[i])) + return "fields: string[] expected"; + } + return null; + }; + + /** + * Creates a HivePartitioningOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.HivePartitioningOptions} HivePartitioningOptions + */ + HivePartitioningOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.HivePartitioningOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.HivePartitioningOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.HivePartitioningOptions(); + if (object.mode != null) + message.mode = String(object.mode); + if (object.sourceUriPrefix != null) + message.sourceUriPrefix = String(object.sourceUriPrefix); + if (object.requirePartitionFilter != null) { + if (!$util.isObject(object.requirePartitionFilter)) + throw TypeError(".google.cloud.bigquery.v2.HivePartitioningOptions.requirePartitionFilter: object expected"); + message.requirePartitionFilter = $root.google.protobuf.BoolValue.fromObject(object.requirePartitionFilter, long + 1); + } + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.v2.HivePartitioningOptions.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) + message.fields[i] = String(object.fields[i]); + } + return message; + }; + + /** + * Creates a plain object from a HivePartitioningOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {google.cloud.bigquery.v2.HivePartitioningOptions} message HivePartitioningOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HivePartitioningOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.mode = ""; + object.sourceUriPrefix = ""; + object.requirePartitionFilter = null; + } + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + object.mode = message.mode; + if (message.sourceUriPrefix != null && Object.hasOwnProperty.call(message, "sourceUriPrefix")) + object.sourceUriPrefix = message.sourceUriPrefix; + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + object.requirePartitionFilter = $root.google.protobuf.BoolValue.toObject(message.requirePartitionFilter, options, q + 1); + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = message.fields[j]; + } + return object; + }; + + /** + * Converts this HivePartitioningOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @instance + * @returns {Object.} JSON object + */ + HivePartitioningOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HivePartitioningOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.HivePartitioningOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HivePartitioningOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.HivePartitioningOptions"; + }; + + return HivePartitioningOptions; + })(); + + /** + * JsonExtension enum. + * @name google.cloud.bigquery.v2.JsonExtension + * @enum {number} + * @property {number} JSON_EXTENSION_UNSPECIFIED=0 JSON_EXTENSION_UNSPECIFIED value + * @property {number} GEOJSON=1 GEOJSON value + */ + v2.JsonExtension = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_EXTENSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "GEOJSON"] = 1; + return values; + })(); + + /** + * MapTargetType enum. + * @name google.cloud.bigquery.v2.MapTargetType + * @enum {number} + * @property {number} MAP_TARGET_TYPE_UNSPECIFIED=0 MAP_TARGET_TYPE_UNSPECIFIED value + * @property {number} ARRAY_OF_STRUCT=1 ARRAY_OF_STRUCT value + */ + v2.MapTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MAP_TARGET_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ARRAY_OF_STRUCT"] = 1; + return values; + })(); + + v2.GenAiFunctionErrorStats = (function() { + + /** + * Properties of a GenAiFunctionErrorStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiFunctionErrorStats + * @property {Array.|null} [errors] GenAiFunctionErrorStats errors + * @property {number|Long|null} [numFailedRows] GenAiFunctionErrorStats numFailedRows + */ + + /** + * Constructs a new GenAiFunctionErrorStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiFunctionErrorStats. + * @implements IGenAiFunctionErrorStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiFunctionErrorStats=} [properties] Properties to set + */ + function GenAiFunctionErrorStats(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiFunctionErrorStats errors. + * @member {Array.} errors + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @instance + */ + GenAiFunctionErrorStats.prototype.errors = $util.emptyArray; + + /** + * GenAiFunctionErrorStats numFailedRows. + * @member {number|Long} numFailedRows + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @instance + */ + GenAiFunctionErrorStats.prototype.numFailedRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new GenAiFunctionErrorStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionErrorStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiFunctionErrorStats} GenAiFunctionErrorStats instance + */ + GenAiFunctionErrorStats.create = function create(properties) { + return new GenAiFunctionErrorStats(properties); + }; + + /** + * Encodes the specified GenAiFunctionErrorStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionErrorStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionErrorStats} message GenAiFunctionErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionErrorStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errors[i]); + if (message.numFailedRows != null && Object.hasOwnProperty.call(message, "numFailedRows")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.numFailedRows); + return writer; + }; + + /** + * Encodes the specified GenAiFunctionErrorStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionErrorStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionErrorStats} message GenAiFunctionErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionErrorStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiFunctionErrorStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiFunctionErrorStats} GenAiFunctionErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionErrorStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push(reader.string()); + break; + } + case 5: { + message.numFailedRows = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiFunctionErrorStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiFunctionErrorStats} GenAiFunctionErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionErrorStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiFunctionErrorStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiFunctionErrorStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) + if (!$util.isString(message.errors[i])) + return "errors: string[] expected"; + } + if (message.numFailedRows != null && Object.hasOwnProperty.call(message, "numFailedRows")) + if (!$util.isInteger(message.numFailedRows) && !(message.numFailedRows && $util.isInteger(message.numFailedRows.low) && $util.isInteger(message.numFailedRows.high))) + return "numFailedRows: integer|Long expected"; + return null; + }; + + /** + * Creates a GenAiFunctionErrorStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiFunctionErrorStats} GenAiFunctionErrorStats + */ + GenAiFunctionErrorStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionErrorStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionErrorStats.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) + message.errors[i] = String(object.errors[i]); + } + if (object.numFailedRows != null) + if ($util.Long) + message.numFailedRows = $util.Long.fromValue(object.numFailedRows, false); + else if (typeof object.numFailedRows === "string") + message.numFailedRows = parseInt(object.numFailedRows, 10); + else if (typeof object.numFailedRows === "number") + message.numFailedRows = object.numFailedRows; + else if (typeof object.numFailedRows === "object") + message.numFailedRows = new $util.LongBits(object.numFailedRows.low >>> 0, object.numFailedRows.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GenAiFunctionErrorStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {google.cloud.bigquery.v2.GenAiFunctionErrorStats} message GenAiFunctionErrorStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiFunctionErrorStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numFailedRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numFailedRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = message.errors[j]; + } + if (message.numFailedRows != null && Object.hasOwnProperty.call(message, "numFailedRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numFailedRows = typeof message.numFailedRows === "number" ? BigInt(message.numFailedRows) : $util.Long.fromBits(message.numFailedRows.low >>> 0, message.numFailedRows.high >>> 0, false).toBigInt(); + else if (typeof message.numFailedRows === "number") + object.numFailedRows = options.longs === String ? String(message.numFailedRows) : message.numFailedRows; + else + object.numFailedRows = options.longs === String ? $util.Long.prototype.toString.call(message.numFailedRows) : options.longs === Number ? new $util.LongBits(message.numFailedRows.low >>> 0, message.numFailedRows.high >>> 0).toNumber() : message.numFailedRows; + return object; + }; + + /** + * Converts this GenAiFunctionErrorStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @instance + * @returns {Object.} JSON object + */ + GenAiFunctionErrorStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiFunctionErrorStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiFunctionErrorStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiFunctionErrorStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiFunctionErrorStats"; + }; + + return GenAiFunctionErrorStats; + })(); + + v2.GenAiFunctionCostOptimizationStats = (function() { + + /** + * Properties of a GenAiFunctionCostOptimizationStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiFunctionCostOptimizationStats + * @property {number|Long|null} [numCostOptimizedRows] GenAiFunctionCostOptimizationStats numCostOptimizedRows + * @property {string|null} [message] GenAiFunctionCostOptimizationStats message + */ + + /** + * Constructs a new GenAiFunctionCostOptimizationStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiFunctionCostOptimizationStats. + * @implements IGenAiFunctionCostOptimizationStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats=} [properties] Properties to set + */ + function GenAiFunctionCostOptimizationStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiFunctionCostOptimizationStats numCostOptimizedRows. + * @member {number|Long|null|undefined} numCostOptimizedRows + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @instance + */ + GenAiFunctionCostOptimizationStats.prototype.numCostOptimizedRows = null; + + /** + * GenAiFunctionCostOptimizationStats message. + * @member {string|null|undefined} message + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @instance + */ + GenAiFunctionCostOptimizationStats.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionCostOptimizationStats.prototype, "_numCostOptimizedRows", { + get: $util.oneOfGetter($oneOfFields = ["numCostOptimizedRows"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionCostOptimizationStats.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiFunctionCostOptimizationStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats} GenAiFunctionCostOptimizationStats instance + */ + GenAiFunctionCostOptimizationStats.create = function create(properties) { + return new GenAiFunctionCostOptimizationStats(properties); + }; + + /** + * Encodes the specified GenAiFunctionCostOptimizationStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats} message GenAiFunctionCostOptimizationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionCostOptimizationStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.numCostOptimizedRows != null && Object.hasOwnProperty.call(message, "numCostOptimizedRows")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.numCostOptimizedRows); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified GenAiFunctionCostOptimizationStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats} message GenAiFunctionCostOptimizationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionCostOptimizationStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiFunctionCostOptimizationStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats} GenAiFunctionCostOptimizationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionCostOptimizationStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.numCostOptimizedRows = reader.int64(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiFunctionCostOptimizationStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats} GenAiFunctionCostOptimizationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionCostOptimizationStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiFunctionCostOptimizationStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiFunctionCostOptimizationStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.numCostOptimizedRows != null && Object.hasOwnProperty.call(message, "numCostOptimizedRows")) { + properties._numCostOptimizedRows = 1; + if (!$util.isInteger(message.numCostOptimizedRows) && !(message.numCostOptimizedRows && $util.isInteger(message.numCostOptimizedRows.low) && $util.isInteger(message.numCostOptimizedRows.high))) + return "numCostOptimizedRows: integer|Long expected"; + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates a GenAiFunctionCostOptimizationStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats} GenAiFunctionCostOptimizationStats + */ + GenAiFunctionCostOptimizationStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats(); + if (object.numCostOptimizedRows != null) + if ($util.Long) + message.numCostOptimizedRows = $util.Long.fromValue(object.numCostOptimizedRows, false); + else if (typeof object.numCostOptimizedRows === "string") + message.numCostOptimizedRows = parseInt(object.numCostOptimizedRows, 10); + else if (typeof object.numCostOptimizedRows === "number") + message.numCostOptimizedRows = object.numCostOptimizedRows; + else if (typeof object.numCostOptimizedRows === "object") + message.numCostOptimizedRows = new $util.LongBits(object.numCostOptimizedRows.low >>> 0, object.numCostOptimizedRows.high >>> 0).toNumber(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a GenAiFunctionCostOptimizationStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats} message GenAiFunctionCostOptimizationStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiFunctionCostOptimizationStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.numCostOptimizedRows != null && Object.hasOwnProperty.call(message, "numCostOptimizedRows")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numCostOptimizedRows = typeof message.numCostOptimizedRows === "number" ? BigInt(message.numCostOptimizedRows) : $util.Long.fromBits(message.numCostOptimizedRows.low >>> 0, message.numCostOptimizedRows.high >>> 0, false).toBigInt(); + else if (typeof message.numCostOptimizedRows === "number") + object.numCostOptimizedRows = options.longs === String ? String(message.numCostOptimizedRows) : message.numCostOptimizedRows; + else + object.numCostOptimizedRows = options.longs === String ? $util.Long.prototype.toString.call(message.numCostOptimizedRows) : options.longs === Number ? new $util.LongBits(message.numCostOptimizedRows.low >>> 0, message.numCostOptimizedRows.high >>> 0).toNumber() : message.numCostOptimizedRows; + if (options.oneofs) + object._numCostOptimizedRows = "numCostOptimizedRows"; + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this GenAiFunctionCostOptimizationStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @instance + * @returns {Object.} JSON object + */ + GenAiFunctionCostOptimizationStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiFunctionCostOptimizationStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiFunctionCostOptimizationStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats"; + }; + + return GenAiFunctionCostOptimizationStats; + })(); + + v2.GenAiFunctionCacheStats = (function() { + + /** + * Properties of a GenAiFunctionCacheStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiFunctionCacheStats + * @property {number|Long|null} [numCacheHitRows] GenAiFunctionCacheStats numCacheHitRows + */ + + /** + * Constructs a new GenAiFunctionCacheStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiFunctionCacheStats. + * @implements IGenAiFunctionCacheStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiFunctionCacheStats=} [properties] Properties to set + */ + function GenAiFunctionCacheStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiFunctionCacheStats numCacheHitRows. + * @member {number|Long|null|undefined} numCacheHitRows + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @instance + */ + GenAiFunctionCacheStats.prototype.numCacheHitRows = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionCacheStats.prototype, "_numCacheHitRows", { + get: $util.oneOfGetter($oneOfFields = ["numCacheHitRows"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiFunctionCacheStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCacheStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiFunctionCacheStats} GenAiFunctionCacheStats instance + */ + GenAiFunctionCacheStats.create = function create(properties) { + return new GenAiFunctionCacheStats(properties); + }; + + /** + * Encodes the specified GenAiFunctionCacheStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCacheStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCacheStats} message GenAiFunctionCacheStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionCacheStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.numCacheHitRows != null && Object.hasOwnProperty.call(message, "numCacheHitRows")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.numCacheHitRows); + return writer; + }; + + /** + * Encodes the specified GenAiFunctionCacheStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionCacheStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionCacheStats} message GenAiFunctionCacheStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionCacheStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiFunctionCacheStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiFunctionCacheStats} GenAiFunctionCacheStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionCacheStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.numCacheHitRows = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiFunctionCacheStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiFunctionCacheStats} GenAiFunctionCacheStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionCacheStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiFunctionCacheStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiFunctionCacheStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.numCacheHitRows != null && Object.hasOwnProperty.call(message, "numCacheHitRows")) { + properties._numCacheHitRows = 1; + if (!$util.isInteger(message.numCacheHitRows) && !(message.numCacheHitRows && $util.isInteger(message.numCacheHitRows.low) && $util.isInteger(message.numCacheHitRows.high))) + return "numCacheHitRows: integer|Long expected"; + } + return null; + }; + + /** + * Creates a GenAiFunctionCacheStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiFunctionCacheStats} GenAiFunctionCacheStats + */ + GenAiFunctionCacheStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionCacheStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats(); + if (object.numCacheHitRows != null) + if ($util.Long) + message.numCacheHitRows = $util.Long.fromValue(object.numCacheHitRows, false); + else if (typeof object.numCacheHitRows === "string") + message.numCacheHitRows = parseInt(object.numCacheHitRows, 10); + else if (typeof object.numCacheHitRows === "number") + message.numCacheHitRows = object.numCacheHitRows; + else if (typeof object.numCacheHitRows === "object") + message.numCacheHitRows = new $util.LongBits(object.numCacheHitRows.low >>> 0, object.numCacheHitRows.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a GenAiFunctionCacheStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {google.cloud.bigquery.v2.GenAiFunctionCacheStats} message GenAiFunctionCacheStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiFunctionCacheStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.numCacheHitRows != null && Object.hasOwnProperty.call(message, "numCacheHitRows")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numCacheHitRows = typeof message.numCacheHitRows === "number" ? BigInt(message.numCacheHitRows) : $util.Long.fromBits(message.numCacheHitRows.low >>> 0, message.numCacheHitRows.high >>> 0, false).toBigInt(); + else if (typeof message.numCacheHitRows === "number") + object.numCacheHitRows = options.longs === String ? String(message.numCacheHitRows) : message.numCacheHitRows; + else + object.numCacheHitRows = options.longs === String ? $util.Long.prototype.toString.call(message.numCacheHitRows) : options.longs === Number ? new $util.LongBits(message.numCacheHitRows.low >>> 0, message.numCacheHitRows.high >>> 0).toNumber() : message.numCacheHitRows; + if (options.oneofs) + object._numCacheHitRows = "numCacheHitRows"; + } + return object; + }; + + /** + * Converts this GenAiFunctionCacheStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @instance + * @returns {Object.} JSON object + */ + GenAiFunctionCacheStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiFunctionCacheStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiFunctionCacheStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiFunctionCacheStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiFunctionCacheStats"; + }; + + return GenAiFunctionCacheStats; + })(); + + v2.GenAiFunctionStats = (function() { + + /** + * Properties of a GenAiFunctionStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiFunctionStats + * @property {string|null} [functionName] GenAiFunctionStats functionName + * @property {string|null} [prompt] GenAiFunctionStats prompt + * @property {number|Long|null} [numProcessedRows] GenAiFunctionStats numProcessedRows + * @property {google.cloud.bigquery.v2.IGenAiFunctionErrorStats|null} [errorStats] GenAiFunctionStats errorStats + * @property {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats|null} [costOptimizationStats] GenAiFunctionStats costOptimizationStats + * @property {google.cloud.bigquery.v2.IGenAiFunctionCacheStats|null} [cacheStats] GenAiFunctionStats cacheStats + */ + + /** + * Constructs a new GenAiFunctionStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiFunctionStats. + * @implements IGenAiFunctionStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiFunctionStats=} [properties] Properties to set + */ + function GenAiFunctionStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiFunctionStats functionName. + * @member {string|null|undefined} functionName + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.functionName = null; + + /** + * GenAiFunctionStats prompt. + * @member {string|null|undefined} prompt + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.prompt = null; + + /** + * GenAiFunctionStats numProcessedRows. + * @member {number|Long|null|undefined} numProcessedRows + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.numProcessedRows = null; + + /** + * GenAiFunctionStats errorStats. + * @member {google.cloud.bigquery.v2.IGenAiFunctionErrorStats|null|undefined} errorStats + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.errorStats = null; + + /** + * GenAiFunctionStats costOptimizationStats. + * @member {google.cloud.bigquery.v2.IGenAiFunctionCostOptimizationStats|null|undefined} costOptimizationStats + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.costOptimizationStats = null; + + /** + * GenAiFunctionStats cacheStats. + * @member {google.cloud.bigquery.v2.IGenAiFunctionCacheStats|null|undefined} cacheStats + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + */ + GenAiFunctionStats.prototype.cacheStats = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_functionName", { + get: $util.oneOfGetter($oneOfFields = ["functionName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_prompt", { + get: $util.oneOfGetter($oneOfFields = ["prompt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_numProcessedRows", { + get: $util.oneOfGetter($oneOfFields = ["numProcessedRows"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_errorStats", { + get: $util.oneOfGetter($oneOfFields = ["errorStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_costOptimizationStats", { + get: $util.oneOfGetter($oneOfFields = ["costOptimizationStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiFunctionStats.prototype, "_cacheStats", { + get: $util.oneOfGetter($oneOfFields = ["cacheStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiFunctionStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiFunctionStats} GenAiFunctionStats instance + */ + GenAiFunctionStats.create = function create(properties) { + return new GenAiFunctionStats(properties); + }; + + /** + * Encodes the specified GenAiFunctionStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionStats} message GenAiFunctionStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.functionName != null && Object.hasOwnProperty.call(message, "functionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.functionName); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt); + if (message.numProcessedRows != null && Object.hasOwnProperty.call(message, "numProcessedRows")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.numProcessedRows); + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) + $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats.encode(message.errorStats, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.costOptimizationStats != null && Object.hasOwnProperty.call(message, "costOptimizationStats")) + $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.encode(message.costOptimizationStats, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.cacheStats != null && Object.hasOwnProperty.call(message, "cacheStats")) + $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats.encode(message.cacheStats, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenAiFunctionStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiFunctionStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiFunctionStats} message GenAiFunctionStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiFunctionStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiFunctionStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiFunctionStats} GenAiFunctionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiFunctionStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.functionName = reader.string(); + break; + } + case 2: { + message.prompt = reader.string(); + break; + } + case 3: { + message.numProcessedRows = reader.int64(); + break; + } + case 4: { + message.errorStats = $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.costOptimizationStats = $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.cacheStats = $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiFunctionStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiFunctionStats} GenAiFunctionStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiFunctionStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiFunctionStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiFunctionStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.functionName != null && Object.hasOwnProperty.call(message, "functionName")) { + properties._functionName = 1; + if (!$util.isString(message.functionName)) + return "functionName: string expected"; + } + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) { + properties._prompt = 1; + if (!$util.isString(message.prompt)) + return "prompt: string expected"; + } + if (message.numProcessedRows != null && Object.hasOwnProperty.call(message, "numProcessedRows")) { + properties._numProcessedRows = 1; + if (!$util.isInteger(message.numProcessedRows) && !(message.numProcessedRows && $util.isInteger(message.numProcessedRows.low) && $util.isInteger(message.numProcessedRows.high))) + return "numProcessedRows: integer|Long expected"; + } + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) { + properties._errorStats = 1; + { + var error = $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats.verify(message.errorStats, long + 1); + if (error) + return "errorStats." + error; + } + } + if (message.costOptimizationStats != null && Object.hasOwnProperty.call(message, "costOptimizationStats")) { + properties._costOptimizationStats = 1; + { + var error = $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.verify(message.costOptimizationStats, long + 1); + if (error) + return "costOptimizationStats." + error; + } + } + if (message.cacheStats != null && Object.hasOwnProperty.call(message, "cacheStats")) { + properties._cacheStats = 1; + { + var error = $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats.verify(message.cacheStats, long + 1); + if (error) + return "cacheStats." + error; + } + } + return null; + }; + + /** + * Creates a GenAiFunctionStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiFunctionStats} GenAiFunctionStats + */ + GenAiFunctionStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiFunctionStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiFunctionStats(); + if (object.functionName != null) + message.functionName = String(object.functionName); + if (object.prompt != null) + message.prompt = String(object.prompt); + if (object.numProcessedRows != null) + if ($util.Long) + message.numProcessedRows = $util.Long.fromValue(object.numProcessedRows, false); + else if (typeof object.numProcessedRows === "string") + message.numProcessedRows = parseInt(object.numProcessedRows, 10); + else if (typeof object.numProcessedRows === "number") + message.numProcessedRows = object.numProcessedRows; + else if (typeof object.numProcessedRows === "object") + message.numProcessedRows = new $util.LongBits(object.numProcessedRows.low >>> 0, object.numProcessedRows.high >>> 0).toNumber(); + if (object.errorStats != null) { + if (!$util.isObject(object.errorStats)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionStats.errorStats: object expected"); + message.errorStats = $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats.fromObject(object.errorStats, long + 1); + } + if (object.costOptimizationStats != null) { + if (!$util.isObject(object.costOptimizationStats)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionStats.costOptimizationStats: object expected"); + message.costOptimizationStats = $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.fromObject(object.costOptimizationStats, long + 1); + } + if (object.cacheStats != null) { + if (!$util.isObject(object.cacheStats)) + throw TypeError(".google.cloud.bigquery.v2.GenAiFunctionStats.cacheStats: object expected"); + message.cacheStats = $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats.fromObject(object.cacheStats, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GenAiFunctionStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {google.cloud.bigquery.v2.GenAiFunctionStats} message GenAiFunctionStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiFunctionStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.functionName != null && Object.hasOwnProperty.call(message, "functionName")) { + object.functionName = message.functionName; + if (options.oneofs) + object._functionName = "functionName"; + } + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) { + object.prompt = message.prompt; + if (options.oneofs) + object._prompt = "prompt"; + } + if (message.numProcessedRows != null && Object.hasOwnProperty.call(message, "numProcessedRows")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numProcessedRows = typeof message.numProcessedRows === "number" ? BigInt(message.numProcessedRows) : $util.Long.fromBits(message.numProcessedRows.low >>> 0, message.numProcessedRows.high >>> 0, false).toBigInt(); + else if (typeof message.numProcessedRows === "number") + object.numProcessedRows = options.longs === String ? String(message.numProcessedRows) : message.numProcessedRows; + else + object.numProcessedRows = options.longs === String ? $util.Long.prototype.toString.call(message.numProcessedRows) : options.longs === Number ? new $util.LongBits(message.numProcessedRows.low >>> 0, message.numProcessedRows.high >>> 0).toNumber() : message.numProcessedRows; + if (options.oneofs) + object._numProcessedRows = "numProcessedRows"; + } + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) { + object.errorStats = $root.google.cloud.bigquery.v2.GenAiFunctionErrorStats.toObject(message.errorStats, options, q + 1); + if (options.oneofs) + object._errorStats = "errorStats"; + } + if (message.costOptimizationStats != null && Object.hasOwnProperty.call(message, "costOptimizationStats")) { + object.costOptimizationStats = $root.google.cloud.bigquery.v2.GenAiFunctionCostOptimizationStats.toObject(message.costOptimizationStats, options, q + 1); + if (options.oneofs) + object._costOptimizationStats = "costOptimizationStats"; + } + if (message.cacheStats != null && Object.hasOwnProperty.call(message, "cacheStats")) { + object.cacheStats = $root.google.cloud.bigquery.v2.GenAiFunctionCacheStats.toObject(message.cacheStats, options, q + 1); + if (options.oneofs) + object._cacheStats = "cacheStats"; + } + return object; + }; + + /** + * Converts this GenAiFunctionStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @instance + * @returns {Object.} JSON object + */ + GenAiFunctionStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiFunctionStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiFunctionStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiFunctionStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiFunctionStats"; + }; + + return GenAiFunctionStats; + })(); + + v2.GenAiErrorStats = (function() { + + /** + * Properties of a GenAiErrorStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiErrorStats + * @property {Array.|null} [errors] GenAiErrorStats errors + */ + + /** + * Constructs a new GenAiErrorStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiErrorStats. + * @implements IGenAiErrorStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiErrorStats=} [properties] Properties to set + */ + function GenAiErrorStats(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiErrorStats errors. + * @member {Array.} errors + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @instance + */ + GenAiErrorStats.prototype.errors = $util.emptyArray; + + /** + * Creates a new GenAiErrorStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiErrorStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiErrorStats} GenAiErrorStats instance + */ + GenAiErrorStats.create = function create(properties) { + return new GenAiErrorStats(properties); + }; + + /** + * Encodes the specified GenAiErrorStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiErrorStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiErrorStats} message GenAiErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiErrorStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.errors[i]); + return writer; + }; + + /** + * Encodes the specified GenAiErrorStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiErrorStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiErrorStats} message GenAiErrorStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiErrorStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiErrorStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiErrorStats} GenAiErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiErrorStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiErrorStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiErrorStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiErrorStats} GenAiErrorStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiErrorStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiErrorStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiErrorStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) + if (!$util.isString(message.errors[i])) + return "errors: string[] expected"; + } + return null; + }; + + /** + * Creates a GenAiErrorStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiErrorStats} GenAiErrorStats + */ + GenAiErrorStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiErrorStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiErrorStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiErrorStats(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.bigquery.v2.GenAiErrorStats.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) + message.errors[i] = String(object.errors[i]); + } + return message; + }; + + /** + * Creates a plain object from a GenAiErrorStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {google.cloud.bigquery.v2.GenAiErrorStats} message GenAiErrorStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiErrorStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = message.errors[j]; + } + return object; + }; + + /** + * Converts this GenAiErrorStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @instance + * @returns {Object.} JSON object + */ + GenAiErrorStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiErrorStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiErrorStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiErrorStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiErrorStats"; + }; + + return GenAiErrorStats; + })(); + + v2.GenAiStats = (function() { + + /** + * Properties of a GenAiStats. + * @memberof google.cloud.bigquery.v2 + * @interface IGenAiStats + * @property {google.cloud.bigquery.v2.IGenAiErrorStats|null} [errorStats] GenAiStats errorStats + * @property {Array.|null} [functionStats] GenAiStats functionStats + */ + + /** + * Constructs a new GenAiStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GenAiStats. + * @implements IGenAiStats + * @constructor + * @param {google.cloud.bigquery.v2.IGenAiStats=} [properties] Properties to set + */ + function GenAiStats(properties) { + this.functionStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiStats errorStats. + * @member {google.cloud.bigquery.v2.IGenAiErrorStats|null|undefined} errorStats + * @memberof google.cloud.bigquery.v2.GenAiStats + * @instance + */ + GenAiStats.prototype.errorStats = null; + + /** + * GenAiStats functionStats. + * @member {Array.} functionStats + * @memberof google.cloud.bigquery.v2.GenAiStats + * @instance + */ + GenAiStats.prototype.functionStats = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GenAiStats.prototype, "_errorStats", { + get: $util.oneOfGetter($oneOfFields = ["errorStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GenAiStats} GenAiStats instance + */ + GenAiStats.create = function create(properties) { + return new GenAiStats(properties); + }; + + /** + * Encodes the specified GenAiStats message. Does not implicitly {@link google.cloud.bigquery.v2.GenAiStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiStats} message GenAiStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) + $root.google.cloud.bigquery.v2.GenAiErrorStats.encode(message.errorStats, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.functionStats != null && message.functionStats.length) + for (var i = 0; i < message.functionStats.length; ++i) + $root.google.cloud.bigquery.v2.GenAiFunctionStats.encode(message.functionStats[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenAiStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GenAiStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {google.cloud.bigquery.v2.IGenAiStats} message GenAiStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GenAiStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GenAiStats} GenAiStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GenAiStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.errorStats = $root.google.cloud.bigquery.v2.GenAiErrorStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.functionStats && message.functionStats.length)) + message.functionStats = []; + message.functionStats.push($root.google.cloud.bigquery.v2.GenAiFunctionStats.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GenAiStats} GenAiStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) { + properties._errorStats = 1; + { + var error = $root.google.cloud.bigquery.v2.GenAiErrorStats.verify(message.errorStats, long + 1); + if (error) + return "errorStats." + error; + } + } + if (message.functionStats != null && Object.hasOwnProperty.call(message, "functionStats")) { + if (!Array.isArray(message.functionStats)) + return "functionStats: array expected"; + for (var i = 0; i < message.functionStats.length; ++i) { + var error = $root.google.cloud.bigquery.v2.GenAiFunctionStats.verify(message.functionStats[i], long + 1); + if (error) + return "functionStats." + error; + } + } + return null; + }; + + /** + * Creates a GenAiStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GenAiStats} GenAiStats + */ + GenAiStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GenAiStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GenAiStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GenAiStats(); + if (object.errorStats != null) { + if (!$util.isObject(object.errorStats)) + throw TypeError(".google.cloud.bigquery.v2.GenAiStats.errorStats: object expected"); + message.errorStats = $root.google.cloud.bigquery.v2.GenAiErrorStats.fromObject(object.errorStats, long + 1); + } + if (object.functionStats) { + if (!Array.isArray(object.functionStats)) + throw TypeError(".google.cloud.bigquery.v2.GenAiStats.functionStats: array expected"); + message.functionStats = []; + for (var i = 0; i < object.functionStats.length; ++i) { + if (!$util.isObject(object.functionStats[i])) + throw TypeError(".google.cloud.bigquery.v2.GenAiStats.functionStats: object expected"); + message.functionStats[i] = $root.google.cloud.bigquery.v2.GenAiFunctionStats.fromObject(object.functionStats[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GenAiStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {google.cloud.bigquery.v2.GenAiStats} message GenAiStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.functionStats = []; + if (message.errorStats != null && Object.hasOwnProperty.call(message, "errorStats")) { + object.errorStats = $root.google.cloud.bigquery.v2.GenAiErrorStats.toObject(message.errorStats, options, q + 1); + if (options.oneofs) + object._errorStats = "errorStats"; + } + if (message.functionStats && message.functionStats.length) { + object.functionStats = []; + for (var j = 0; j < message.functionStats.length; ++j) + object.functionStats[j] = $root.google.cloud.bigquery.v2.GenAiFunctionStats.toObject(message.functionStats[j], options, q + 1); + } + return object; + }; + + /** + * Converts this GenAiStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GenAiStats + * @instance + * @returns {Object.} JSON object + */ + GenAiStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GenAiStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GenAiStats"; + }; + + return GenAiStats; + })(); + + v2.JobService = (function() { + + /** + * Constructs a new JobService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function JobService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (JobService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobService; + + /** + * Creates new JobService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.JobService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {JobService} RPC service. Useful where requests and/or responses are streamed. + */ + JobService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|cancelJob}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.JobCancelResponse} [response] JobCancelResponse + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.CancelJobCallback} callback Node-style callback called with the error, if any, and JobCancelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.cancelJob = function cancelJob(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancelJob, $root.google.cloud.bigquery.v2.CancelJobRequest, $root.google.cloud.bigquery.v2.JobCancelResponse, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|getJob}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.getJob = function getJob(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getJob, $root.google.cloud.bigquery.v2.GetJobRequest, $root.google.cloud.bigquery.v2.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|insertJob}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef InsertJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Job} [response] Job + */ + + /** + * Calls InsertJob. + * @function insertJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IInsertJobRequest} request InsertJobRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.InsertJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.insertJob = function insertJob(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insertJob, $root.google.cloud.bigquery.v2.InsertJobRequest, $root.google.cloud.bigquery.v2.Job, request, callback); + }, "name", { value: "InsertJob" }); + + /** + * Calls InsertJob. + * @function insertJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IInsertJobRequest} request InsertJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|deleteJob}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.deleteJob = function deleteJob(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteJob, $root.google.cloud.bigquery.v2.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|listJobs}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.JobList} [response] JobList + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.ListJobsCallback} callback Node-style callback called with the error, if any, and JobList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.listJobs = function listJobs(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listJobs, $root.google.cloud.bigquery.v2.ListJobsRequest, $root.google.cloud.bigquery.v2.JobList, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|getQueryResults}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef GetQueryResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.GetQueryResultsResponse} [response] GetQueryResultsResponse + */ + + /** + * Calls GetQueryResults. + * @function getQueryResults + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest} request GetQueryResultsRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.GetQueryResultsCallback} callback Node-style callback called with the error, if any, and GetQueryResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.getQueryResults = function getQueryResults(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getQueryResults, $root.google.cloud.bigquery.v2.GetQueryResultsRequest, $root.google.cloud.bigquery.v2.GetQueryResultsResponse, request, callback); + }, "name", { value: "GetQueryResults" }); + + /** + * Calls GetQueryResults. + * @function getQueryResults + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest} request GetQueryResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.JobService|query}. + * @memberof google.cloud.bigquery.v2.JobService + * @typedef QueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.QueryResponse} [response] QueryResponse + */ + + /** + * Calls Query. + * @function query + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IPostQueryRequest} request PostQueryRequest message or plain object + * @param {google.cloud.bigquery.v2.JobService.QueryCallback} callback Node-style callback called with the error, if any, and QueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobService.prototype.query = function query(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, query, $root.google.cloud.bigquery.v2.PostQueryRequest, $root.google.cloud.bigquery.v2.QueryResponse, request, callback); + }, "name", { value: "Query" }); + + /** + * Calls Query. + * @function query + * @memberof google.cloud.bigquery.v2.JobService + * @instance + * @param {google.cloud.bigquery.v2.IPostQueryRequest} request PostQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return JobService; + })(); + + v2.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.bigquery.v2 + * @interface IJob + * @property {string|null} [kind] Job kind + * @property {string|null} [etag] Job etag + * @property {string|null} [id] Job id + * @property {string|null} [selfLink] Job selfLink + * @property {string|null} [userEmail] Job userEmail + * @property {google.cloud.bigquery.v2.IJobConfiguration|null} [configuration] Job configuration + * @property {google.cloud.bigquery.v2.IJobReference|null} [jobReference] Job jobReference + * @property {google.cloud.bigquery.v2.IJobStatistics|null} [statistics] Job statistics + * @property {google.cloud.bigquery.v2.IJobStatus|null} [status] Job status + * @property {string|null} [principalSubject] Job principalSubject + * @property {google.cloud.bigquery.v2.IJobCreationReason|null} [jobCreationReason] Job jobCreationReason + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.bigquery.v2.IJob=} [properties] Properties to set + */ + function Job(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.kind = ""; + + /** + * Job etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.etag = ""; + + /** + * Job id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.id = ""; + + /** + * Job selfLink. + * @member {string} selfLink + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.selfLink = ""; + + /** + * Job userEmail. + * @member {string} userEmail + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.userEmail = ""; + + /** + * Job configuration. + * @member {google.cloud.bigquery.v2.IJobConfiguration|null|undefined} configuration + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.configuration = null; + + /** + * Job jobReference. + * @member {google.cloud.bigquery.v2.IJobReference|null|undefined} jobReference + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.jobReference = null; + + /** + * Job statistics. + * @member {google.cloud.bigquery.v2.IJobStatistics|null|undefined} statistics + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.statistics = null; + + /** + * Job status. + * @member {google.cloud.bigquery.v2.IJobStatus|null|undefined} status + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.principalSubject = ""; + + /** + * Job jobCreationReason. + * @member {google.cloud.bigquery.v2.IJobCreationReason|null|undefined} jobCreationReason + * @memberof google.cloud.bigquery.v2.Job + * @instance + */ + Job.prototype.jobCreationReason = null; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {google.cloud.bigquery.v2.IJob=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.bigquery.v2.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {google.cloud.bigquery.v2.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.selfLink); + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.userEmail); + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) + $root.google.cloud.bigquery.v2.JobConfiguration.encode(message.configuration, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + $root.google.cloud.bigquery.v2.JobReference.encode(message.jobReference, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) + $root.google.cloud.bigquery.v2.JobStatistics.encode(message.statistics, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.bigquery.v2.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.principalSubject); + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) + $root.google.cloud.bigquery.v2.JobCreationReason.encode(message.jobCreationReason, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {google.cloud.bigquery.v2.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Job(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.selfLink = reader.string(); + break; + } + case 5: { + message.userEmail = reader.string(); + break; + } + case 6: { + message.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.statistics = $root.google.cloud.bigquery.v2.JobStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.status = $root.google.cloud.bigquery.v2.JobStatus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.principalSubject = reader.string(); + break; + } + case 14: { + message.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) { + var error = $root.google.cloud.bigquery.v2.JobConfiguration.verify(message.configuration, long + 1); + if (error) + return "configuration." + error; + } + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) { + var error = $root.google.cloud.bigquery.v2.JobReference.verify(message.jobReference, long + 1); + if (error) + return "jobReference." + error; + } + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics.verify(message.statistics, long + 1); + if (error) + return "statistics." + error; + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { + var error = $root.google.cloud.bigquery.v2.JobStatus.verify(message.status, long + 1); + if (error) + return "status." + error; + } + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) { + var error = $root.google.cloud.bigquery.v2.JobCreationReason.verify(message.jobCreationReason, long + 1); + if (error) + return "jobCreationReason." + error; + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Job} Job + */ + Job.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Job) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Job: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Job(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.configuration != null) { + if (!$util.isObject(object.configuration)) + throw TypeError(".google.cloud.bigquery.v2.Job.configuration: object expected"); + message.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.fromObject(object.configuration, long + 1); + } + if (object.jobReference != null) { + if (!$util.isObject(object.jobReference)) + throw TypeError(".google.cloud.bigquery.v2.Job.jobReference: object expected"); + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.fromObject(object.jobReference, long + 1); + } + if (object.statistics != null) { + if (!$util.isObject(object.statistics)) + throw TypeError(".google.cloud.bigquery.v2.Job.statistics: object expected"); + message.statistics = $root.google.cloud.bigquery.v2.JobStatistics.fromObject(object.statistics, long + 1); + } + if (object.status != null) { + if (!$util.isObject(object.status)) + throw TypeError(".google.cloud.bigquery.v2.Job.status: object expected"); + message.status = $root.google.cloud.bigquery.v2.JobStatus.fromObject(object.status, long + 1); + } + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + if (object.jobCreationReason != null) { + if (!$util.isObject(object.jobCreationReason)) + throw TypeError(".google.cloud.bigquery.v2.Job.jobCreationReason: object expected"); + message.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.fromObject(object.jobCreationReason, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {google.cloud.bigquery.v2.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.id = ""; + object.selfLink = ""; + object.userEmail = ""; + object.configuration = null; + object.jobReference = null; + object.statistics = null; + object.status = null; + object.principalSubject = ""; + object.jobCreationReason = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + object.selfLink = message.selfLink; + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + object.userEmail = message.userEmail; + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) + object.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.toObject(message.configuration, options, q + 1); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + object.jobReference = $root.google.cloud.bigquery.v2.JobReference.toObject(message.jobReference, options, q + 1); + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) + object.statistics = $root.google.cloud.bigquery.v2.JobStatistics.toObject(message.statistics, options, q + 1); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.cloud.bigquery.v2.JobStatus.toObject(message.status, options, q + 1); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + object.principalSubject = message.principalSubject; + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) + object.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.toObject(message.jobCreationReason, options, q + 1); + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Job"; + }; + + return Job; + })(); + + v2.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.bigquery.v2 + * @interface ICancelJobRequest + * @property {string|null} [projectId] CancelJobRequest projectId + * @property {string|null} [jobId] CancelJobRequest jobId + * @property {string|null} [location] CancelJobRequest location + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.bigquery.v2.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.projectId = ""; + + /** + * CancelJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.jobId = ""; + + /** + * CancelJobRequest location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.location = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {google.cloud.bigquery.v2.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {google.cloud.bigquery.v2.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {google.cloud.bigquery.v2.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.CancelJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.CancelJobRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.CancelJobRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.CancelJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {google.cloud.bigquery.v2.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + object.jobId = message.jobId; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v2.JobCancelResponse = (function() { + + /** + * Properties of a JobCancelResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IJobCancelResponse + * @property {string|null} [kind] JobCancelResponse kind + * @property {google.cloud.bigquery.v2.IJob|null} [job] JobCancelResponse job + */ + + /** + * Constructs a new JobCancelResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobCancelResponse. + * @implements IJobCancelResponse + * @constructor + * @param {google.cloud.bigquery.v2.IJobCancelResponse=} [properties] Properties to set + */ + function JobCancelResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobCancelResponse kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @instance + */ + JobCancelResponse.prototype.kind = ""; + + /** + * JobCancelResponse job. + * @member {google.cloud.bigquery.v2.IJob|null|undefined} job + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @instance + */ + JobCancelResponse.prototype.job = null; + + /** + * Creates a new JobCancelResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {google.cloud.bigquery.v2.IJobCancelResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobCancelResponse} JobCancelResponse instance + */ + JobCancelResponse.create = function create(properties) { + return new JobCancelResponse(properties); + }; + + /** + * Encodes the specified JobCancelResponse message. Does not implicitly {@link google.cloud.bigquery.v2.JobCancelResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {google.cloud.bigquery.v2.IJobCancelResponse} message JobCancelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobCancelResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.bigquery.v2.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobCancelResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobCancelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {google.cloud.bigquery.v2.IJobCancelResponse} message JobCancelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobCancelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobCancelResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobCancelResponse} JobCancelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobCancelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobCancelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.bigquery.v2.Job.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobCancelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobCancelResponse} JobCancelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobCancelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobCancelResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobCancelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.job != null && Object.hasOwnProperty.call(message, "job")) { + var error = $root.google.cloud.bigquery.v2.Job.verify(message.job, long + 1); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a JobCancelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobCancelResponse} JobCancelResponse + */ + JobCancelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobCancelResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobCancelResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobCancelResponse(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.job != null) { + if (!$util.isObject(object.job)) + throw TypeError(".google.cloud.bigquery.v2.JobCancelResponse.job: object expected"); + message.job = $root.google.cloud.bigquery.v2.Job.fromObject(object.job, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JobCancelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {google.cloud.bigquery.v2.JobCancelResponse} message JobCancelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobCancelResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.kind = ""; + object.job = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + object.job = $root.google.cloud.bigquery.v2.Job.toObject(message.job, options, q + 1); + return object; + }; + + /** + * Converts this JobCancelResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @instance + * @returns {Object.} JSON object + */ + JobCancelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobCancelResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobCancelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobCancelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobCancelResponse"; + }; + + return JobCancelResponse; + })(); + + v2.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetJobRequest + * @property {string|null} [projectId] GetJobRequest projectId + * @property {string|null} [jobId] GetJobRequest jobId + * @property {string|null} [location] GetJobRequest location + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @instance + */ + GetJobRequest.prototype.projectId = ""; + + /** + * GetJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @instance + */ + GetJobRequest.prototype.jobId = ""; + + /** + * GetJobRequest location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @instance + */ + GetJobRequest.prototype.location = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {google.cloud.bigquery.v2.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {google.cloud.bigquery.v2.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {google.cloud.bigquery.v2.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetJobRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetJobRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {google.cloud.bigquery.v2.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + object.jobId = message.jobId; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v2.InsertJobRequest = (function() { + + /** + * Properties of an InsertJobRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IInsertJobRequest + * @property {string|null} [projectId] InsertJobRequest projectId + * @property {google.cloud.bigquery.v2.IJob|null} [job] InsertJobRequest job + */ + + /** + * Constructs a new InsertJobRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an InsertJobRequest. + * @implements IInsertJobRequest + * @constructor + * @param {google.cloud.bigquery.v2.IInsertJobRequest=} [properties] Properties to set + */ + function InsertJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @instance + */ + InsertJobRequest.prototype.projectId = ""; + + /** + * InsertJobRequest job. + * @member {google.cloud.bigquery.v2.IJob|null|undefined} job + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @instance + */ + InsertJobRequest.prototype.job = null; + + /** + * Creates a new InsertJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertJobRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.InsertJobRequest} InsertJobRequest instance + */ + InsertJobRequest.create = function create(properties) { + return new InsertJobRequest(properties); + }; + + /** + * Encodes the specified InsertJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertJobRequest} message InsertJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertJobRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.bigquery.v2.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertJobRequest} message InsertJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an InsertJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.InsertJobRequest} InsertJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertJobRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.InsertJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.job = $root.google.cloud.bigquery.v2.Job.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsertJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.InsertJobRequest} InsertJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertJobRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertJobRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.job != null && Object.hasOwnProperty.call(message, "job")) { + var error = $root.google.cloud.bigquery.v2.Job.verify(message.job, long + 1); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates an InsertJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.InsertJobRequest} InsertJobRequest + */ + InsertJobRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.InsertJobRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.InsertJobRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.InsertJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.job != null) { + if (!$util.isObject(object.job)) + throw TypeError(".google.cloud.bigquery.v2.InsertJobRequest.job: object expected"); + message.job = $root.google.cloud.bigquery.v2.Job.fromObject(object.job, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InsertJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {google.cloud.bigquery.v2.InsertJobRequest} message InsertJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertJobRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.job = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + object.job = $root.google.cloud.bigquery.v2.Job.toObject(message.job, options, q + 1); + return object; + }; + + /** + * Converts this InsertJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @instance + * @returns {Object.} JSON object + */ + InsertJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertJobRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.InsertJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.InsertJobRequest"; + }; + + return InsertJobRequest; + })(); + + v2.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteJobRequest + * @property {string|null} [projectId] DeleteJobRequest projectId + * @property {string|null} [jobId] DeleteJobRequest jobId + * @property {string|null} [location] DeleteJobRequest location + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.projectId = ""; + + /** + * DeleteJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.jobId = ""; + + /** + * DeleteJobRequest location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.location = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteJobRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteJobRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + object.jobId = message.jobId; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v2.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListJobsRequest + * @property {string|null} [projectId] ListJobsRequest projectId + * @property {boolean|null} [allUsers] ListJobsRequest allUsers + * @property {google.protobuf.IInt32Value|null} [maxResults] ListJobsRequest maxResults + * @property {number|Long|null} [minCreationTime] ListJobsRequest minCreationTime + * @property {google.protobuf.IUInt64Value|null} [maxCreationTime] ListJobsRequest maxCreationTime + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {google.cloud.bigquery.v2.ListJobsRequest.Projection|null} [projection] ListJobsRequest projection + * @property {Array.|null} [stateFilter] ListJobsRequest stateFilter + * @property {string|null} [parentJobId] ListJobsRequest parentJobId + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + this.stateFilter = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.projectId = ""; + + /** + * ListJobsRequest allUsers. + * @member {boolean} allUsers + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.allUsers = false; + + /** + * ListJobsRequest maxResults. + * @member {google.protobuf.IInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.maxResults = null; + + /** + * ListJobsRequest minCreationTime. + * @member {number|Long} minCreationTime + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.minCreationTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ListJobsRequest maxCreationTime. + * @member {google.protobuf.IUInt64Value|null|undefined} maxCreationTime + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.maxCreationTime = null; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest projection. + * @member {google.cloud.bigquery.v2.ListJobsRequest.Projection} projection + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.projection = 0; + + /** + * ListJobsRequest stateFilter. + * @member {Array.} stateFilter + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.stateFilter = $util.emptyArray; + + /** + * ListJobsRequest parentJobId. + * @member {string} parentJobId + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parentJobId = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {google.cloud.bigquery.v2.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {google.cloud.bigquery.v2.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.allUsers != null && Object.hasOwnProperty.call(message, "allUsers")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allUsers); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.Int32Value.encode(message.maxResults, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.minCreationTime != null && Object.hasOwnProperty.call(message, "minCreationTime")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.minCreationTime); + if (message.maxCreationTime != null && Object.hasOwnProperty.call(message, "maxCreationTime")) + $root.google.protobuf.UInt64Value.encode(message.maxCreationTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.projection != null && Object.hasOwnProperty.call(message, "projection")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.projection); + if (message.stateFilter != null && message.stateFilter.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.stateFilter.length; ++i) + writer.int32(message.stateFilter[i]); + writer.ldelim(); + } + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.parentJobId); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {google.cloud.bigquery.v2.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.allUsers = reader.bool(); + break; + } + case 3: { + message.maxResults = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.minCreationTime = reader.uint64(); + break; + } + case 5: { + message.maxCreationTime = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.projection = reader.int32(); + break; + } + case 8: { + if (!(message.stateFilter && message.stateFilter.length)) + message.stateFilter = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.stateFilter.push(reader.int32()); + } else + message.stateFilter.push(reader.int32()); + break; + } + case 9: { + message.parentJobId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.allUsers != null && Object.hasOwnProperty.call(message, "allUsers")) + if (typeof message.allUsers !== "boolean") + return "allUsers: boolean expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.Int32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.minCreationTime != null && Object.hasOwnProperty.call(message, "minCreationTime")) + if (!$util.isInteger(message.minCreationTime) && !(message.minCreationTime && $util.isInteger(message.minCreationTime.low) && $util.isInteger(message.minCreationTime.high))) + return "minCreationTime: integer|Long expected"; + if (message.maxCreationTime != null && Object.hasOwnProperty.call(message, "maxCreationTime")) { + var error = $root.google.protobuf.UInt64Value.verify(message.maxCreationTime, long + 1); + if (error) + return "maxCreationTime." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.projection != null && Object.hasOwnProperty.call(message, "projection")) + switch (message.projection) { + default: + return "projection: enum value expected"; + case 0: + case 0: + case 1: + case 1: + break; + } + if (message.stateFilter != null && Object.hasOwnProperty.call(message, "stateFilter")) { + if (!Array.isArray(message.stateFilter)) + return "stateFilter: array expected"; + for (var i = 0; i < message.stateFilter.length; ++i) + switch (message.stateFilter[i]) { + default: + return "stateFilter: enum value[] expected"; + case 0: + case 0: + case 1: + case 1: + case 2: + case 2: + break; + } + } + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + if (!$util.isString(message.parentJobId)) + return "parentJobId: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListJobsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListJobsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListJobsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.allUsers != null) + message.allUsers = Boolean(object.allUsers); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.ListJobsRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.Int32Value.fromObject(object.maxResults, long + 1); + } + if (object.minCreationTime != null) + if ($util.Long) + message.minCreationTime = $util.Long.fromValue(object.minCreationTime, true); + else if (typeof object.minCreationTime === "string") + message.minCreationTime = parseInt(object.minCreationTime, 10); + else if (typeof object.minCreationTime === "number") + message.minCreationTime = object.minCreationTime; + else if (typeof object.minCreationTime === "object") + message.minCreationTime = new $util.LongBits(object.minCreationTime.low >>> 0, object.minCreationTime.high >>> 0).toNumber(true); + if (object.maxCreationTime != null) { + if (!$util.isObject(object.maxCreationTime)) + throw TypeError(".google.cloud.bigquery.v2.ListJobsRequest.maxCreationTime: object expected"); + message.maxCreationTime = $root.google.protobuf.UInt64Value.fromObject(object.maxCreationTime, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.projection) { + default: + if (typeof object.projection === "number") { + message.projection = object.projection; + break; + } + break; + case "minimal": + case 0: + message.projection = 0; + break; + case "MINIMAL": + case 0: + message.projection = 0; + break; + case "full": + case 1: + message.projection = 1; + break; + case "FULL": + case 1: + message.projection = 1; + break; + } + if (object.stateFilter) { + if (!Array.isArray(object.stateFilter)) + throw TypeError(".google.cloud.bigquery.v2.ListJobsRequest.stateFilter: array expected"); + message.stateFilter = []; + for (var i = 0; i < object.stateFilter.length; ++i) + switch (object.stateFilter[i]) { + default: + if (typeof object.stateFilter[i] === "number") { + message.stateFilter[i] = object.stateFilter[i]; + break; + } + case "done": + case 0: + message.stateFilter[i] = 0; + break; + case "DONE": + case 0: + message.stateFilter[i] = 0; + break; + case "pending": + case 1: + message.stateFilter[i] = 1; + break; + case "PENDING": + case 1: + message.stateFilter[i] = 1; + break; + case "running": + case 2: + message.stateFilter[i] = 2; + break; + case "RUNNING": + case 2: + message.stateFilter[i] = 2; + break; + } + } + if (object.parentJobId != null) + message.parentJobId = String(object.parentJobId); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {google.cloud.bigquery.v2.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.stateFilter = []; + if (options.defaults) { + object.projectId = ""; + object.allUsers = false; + object.maxResults = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.minCreationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.minCreationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.maxCreationTime = null; + object.pageToken = ""; + object.projection = options.enums === String ? "minimal" : 0; + object.parentJobId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.allUsers != null && Object.hasOwnProperty.call(message, "allUsers")) + object.allUsers = message.allUsers; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.Int32Value.toObject(message.maxResults, options, q + 1); + if (message.minCreationTime != null && Object.hasOwnProperty.call(message, "minCreationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minCreationTime = typeof message.minCreationTime === "number" ? BigInt(message.minCreationTime) : $util.Long.fromBits(message.minCreationTime.low >>> 0, message.minCreationTime.high >>> 0, true).toBigInt(); + else if (typeof message.minCreationTime === "number") + object.minCreationTime = options.longs === String ? String(message.minCreationTime) : message.minCreationTime; + else + object.minCreationTime = options.longs === String ? $util.Long.prototype.toString.call(message.minCreationTime) : options.longs === Number ? new $util.LongBits(message.minCreationTime.low >>> 0, message.minCreationTime.high >>> 0).toNumber(true) : message.minCreationTime; + if (message.maxCreationTime != null && Object.hasOwnProperty.call(message, "maxCreationTime")) + object.maxCreationTime = $root.google.protobuf.UInt64Value.toObject(message.maxCreationTime, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.projection != null && Object.hasOwnProperty.call(message, "projection")) + object.projection = options.enums === String ? $root.google.cloud.bigquery.v2.ListJobsRequest.Projection[message.projection] === undefined ? message.projection : $root.google.cloud.bigquery.v2.ListJobsRequest.Projection[message.projection] : message.projection; + if (message.stateFilter && message.stateFilter.length) { + object.stateFilter = []; + for (var j = 0; j < message.stateFilter.length; ++j) + object.stateFilter[j] = options.enums === String ? $root.google.cloud.bigquery.v2.ListJobsRequest.StateFilter[message.stateFilter[j]] === undefined ? message.stateFilter[j] : $root.google.cloud.bigquery.v2.ListJobsRequest.StateFilter[message.stateFilter[j]] : message.stateFilter[j]; + } + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + object.parentJobId = message.parentJobId; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListJobsRequest"; + }; + + /** + * Projection enum. + * @name google.cloud.bigquery.v2.ListJobsRequest.Projection + * @enum {number} + * @property {number} minimal=0 minimal value + * @property {number} MINIMAL=0 MINIMAL value + * @property {number} full=1 full value + * @property {number} FULL=1 FULL value + */ + ListJobsRequest.Projection = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "minimal"] = 0; + values["MINIMAL"] = 0; + values[valuesById[1] = "full"] = 1; + values["FULL"] = 1; + return values; + })(); + + /** + * StateFilter enum. + * @name google.cloud.bigquery.v2.ListJobsRequest.StateFilter + * @enum {number} + * @property {number} done=0 done value + * @property {number} DONE=0 DONE value + * @property {number} pending=1 pending value + * @property {number} PENDING=1 PENDING value + * @property {number} running=2 running value + * @property {number} RUNNING=2 RUNNING value + */ + ListJobsRequest.StateFilter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "done"] = 0; + values["DONE"] = 0; + values[valuesById[1] = "pending"] = 1; + values["PENDING"] = 1; + values[valuesById[2] = "running"] = 2; + values["RUNNING"] = 2; + return values; + })(); + + return ListJobsRequest; + })(); + + v2.ListFormatJob = (function() { + + /** + * Properties of a ListFormatJob. + * @memberof google.cloud.bigquery.v2 + * @interface IListFormatJob + * @property {string|null} [id] ListFormatJob id + * @property {string|null} [kind] ListFormatJob kind + * @property {google.cloud.bigquery.v2.IJobReference|null} [jobReference] ListFormatJob jobReference + * @property {string|null} [state] ListFormatJob state + * @property {google.cloud.bigquery.v2.IErrorProto|null} [errorResult] ListFormatJob errorResult + * @property {google.cloud.bigquery.v2.IJobStatistics|null} [statistics] ListFormatJob statistics + * @property {google.cloud.bigquery.v2.IJobConfiguration|null} [configuration] ListFormatJob configuration + * @property {google.cloud.bigquery.v2.IJobStatus|null} [status] ListFormatJob status + * @property {string|null} [userEmail] ListFormatJob userEmail + * @property {string|null} [principalSubject] ListFormatJob principalSubject + */ + + /** + * Constructs a new ListFormatJob. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListFormatJob. + * @implements IListFormatJob + * @constructor + * @param {google.cloud.bigquery.v2.IListFormatJob=} [properties] Properties to set + */ + function ListFormatJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFormatJob id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.id = ""; + + /** + * ListFormatJob kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.kind = ""; + + /** + * ListFormatJob jobReference. + * @member {google.cloud.bigquery.v2.IJobReference|null|undefined} jobReference + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.jobReference = null; + + /** + * ListFormatJob state. + * @member {string} state + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.state = ""; + + /** + * ListFormatJob errorResult. + * @member {google.cloud.bigquery.v2.IErrorProto|null|undefined} errorResult + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.errorResult = null; + + /** + * ListFormatJob statistics. + * @member {google.cloud.bigquery.v2.IJobStatistics|null|undefined} statistics + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.statistics = null; + + /** + * ListFormatJob configuration. + * @member {google.cloud.bigquery.v2.IJobConfiguration|null|undefined} configuration + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.configuration = null; + + /** + * ListFormatJob status. + * @member {google.cloud.bigquery.v2.IJobStatus|null|undefined} status + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.status = null; + + /** + * ListFormatJob userEmail. + * @member {string} userEmail + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.userEmail = ""; + + /** + * ListFormatJob principalSubject. + * @member {string} principalSubject + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + */ + ListFormatJob.prototype.principalSubject = ""; + + /** + * Creates a new ListFormatJob instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {google.cloud.bigquery.v2.IListFormatJob=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListFormatJob} ListFormatJob instance + */ + ListFormatJob.create = function create(properties) { + return new ListFormatJob(properties); + }; + + /** + * Encodes the specified ListFormatJob message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {google.cloud.bigquery.v2.IListFormatJob} message ListFormatJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatJob.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + $root.google.cloud.bigquery.v2.JobReference.encode(message.jobReference, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.state); + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errorResult, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) + $root.google.cloud.bigquery.v2.JobStatistics.encode(message.statistics, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) + $root.google.cloud.bigquery.v2.JobConfiguration.encode(message.configuration, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.bigquery.v2.JobStatus.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.userEmail); + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.principalSubject); + return writer; + }; + + /** + * Encodes the specified ListFormatJob message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {google.cloud.bigquery.v2.IListFormatJob} message ListFormatJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListFormatJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListFormatJob} ListFormatJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatJob.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListFormatJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.state = reader.string(); + break; + } + case 5: { + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.statistics = $root.google.cloud.bigquery.v2.JobStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.status = $root.google.cloud.bigquery.v2.JobStatus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.userEmail = reader.string(); + break; + } + case 10: { + message.principalSubject = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFormatJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListFormatJob} ListFormatJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFormatJob message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFormatJob.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) { + var error = $root.google.cloud.bigquery.v2.JobReference.verify(message.jobReference, long + 1); + if (error) + return "jobReference." + error; + } + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (!$util.isString(message.state)) + return "state: string expected"; + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errorResult, long + 1); + if (error) + return "errorResult." + error; + } + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics.verify(message.statistics, long + 1); + if (error) + return "statistics." + error; + } + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) { + var error = $root.google.cloud.bigquery.v2.JobConfiguration.verify(message.configuration, long + 1); + if (error) + return "configuration." + error; + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { + var error = $root.google.cloud.bigquery.v2.JobStatus.verify(message.status, long + 1); + if (error) + return "status." + error; + } + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + if (!$util.isString(message.principalSubject)) + return "principalSubject: string expected"; + return null; + }; + + /** + * Creates a ListFormatJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListFormatJob} ListFormatJob + */ + ListFormatJob.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListFormatJob) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListFormatJob(); + if (object.id != null) + message.id = String(object.id); + if (object.kind != null) + message.kind = String(object.kind); + if (object.jobReference != null) { + if (!$util.isObject(object.jobReference)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob.jobReference: object expected"); + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.fromObject(object.jobReference, long + 1); + } + if (object.state != null) + message.state = String(object.state); + if (object.errorResult != null) { + if (!$util.isObject(object.errorResult)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob.errorResult: object expected"); + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errorResult, long + 1); + } + if (object.statistics != null) { + if (!$util.isObject(object.statistics)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob.statistics: object expected"); + message.statistics = $root.google.cloud.bigquery.v2.JobStatistics.fromObject(object.statistics, long + 1); + } + if (object.configuration != null) { + if (!$util.isObject(object.configuration)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob.configuration: object expected"); + message.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.fromObject(object.configuration, long + 1); + } + if (object.status != null) { + if (!$util.isObject(object.status)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatJob.status: object expected"); + message.status = $root.google.cloud.bigquery.v2.JobStatus.fromObject(object.status, long + 1); + } + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.principalSubject != null) + message.principalSubject = String(object.principalSubject); + return message; + }; + + /** + * Creates a plain object from a ListFormatJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {google.cloud.bigquery.v2.ListFormatJob} message ListFormatJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFormatJob.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.id = ""; + object.kind = ""; + object.jobReference = null; + object.state = ""; + object.errorResult = null; + object.statistics = null; + object.configuration = null; + object.status = null; + object.userEmail = ""; + object.principalSubject = ""; + } + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + object.jobReference = $root.google.cloud.bigquery.v2.JobReference.toObject(message.jobReference, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + object.state = message.state; + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + object.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errorResult, options, q + 1); + if (message.statistics != null && Object.hasOwnProperty.call(message, "statistics")) + object.statistics = $root.google.cloud.bigquery.v2.JobStatistics.toObject(message.statistics, options, q + 1); + if (message.configuration != null && Object.hasOwnProperty.call(message, "configuration")) + object.configuration = $root.google.cloud.bigquery.v2.JobConfiguration.toObject(message.configuration, options, q + 1); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.cloud.bigquery.v2.JobStatus.toObject(message.status, options, q + 1); + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + object.userEmail = message.userEmail; + if (message.principalSubject != null && Object.hasOwnProperty.call(message, "principalSubject")) + object.principalSubject = message.principalSubject; + return object; + }; + + /** + * Converts this ListFormatJob to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @instance + * @returns {Object.} JSON object + */ + ListFormatJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFormatJob + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListFormatJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFormatJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListFormatJob"; + }; + + return ListFormatJob; + })(); + + v2.JobList = (function() { + + /** + * Properties of a JobList. + * @memberof google.cloud.bigquery.v2 + * @interface IJobList + * @property {string|null} [etag] JobList etag + * @property {string|null} [kind] JobList kind + * @property {string|null} [nextPageToken] JobList nextPageToken + * @property {Array.|null} [jobs] JobList jobs + * @property {Array.|null} [unreachable] JobList unreachable + */ + + /** + * Constructs a new JobList. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobList. + * @implements IJobList + * @constructor + * @param {google.cloud.bigquery.v2.IJobList=} [properties] Properties to set + */ + function JobList(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobList etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.JobList + * @instance + */ + JobList.prototype.etag = ""; + + /** + * JobList kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.JobList + * @instance + */ + JobList.prototype.kind = ""; + + /** + * JobList nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.JobList + * @instance + */ + JobList.prototype.nextPageToken = ""; + + /** + * JobList jobs. + * @member {Array.} jobs + * @memberof google.cloud.bigquery.v2.JobList + * @instance + */ + JobList.prototype.jobs = $util.emptyArray; + + /** + * JobList unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.bigquery.v2.JobList + * @instance + */ + JobList.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new JobList instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {google.cloud.bigquery.v2.IJobList=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobList} JobList instance + */ + JobList.create = function create(properties) { + return new JobList(properties); + }; + + /** + * Encodes the specified JobList message. Does not implicitly {@link google.cloud.bigquery.v2.JobList.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {google.cloud.bigquery.v2.IJobList} message JobList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobList.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.etag); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.bigquery.v2.ListFormatJob.encode(message.jobs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified JobList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {google.cloud.bigquery.v2.IJobList} message JobList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobList} JobList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobList.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.etag = reader.string(); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.bigquery.v2.ListFormatJob.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobList} JobList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobList message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobList.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.jobs != null && Object.hasOwnProperty.call(message, "jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ListFormatJob.verify(message.jobs[i], long + 1); + if (error) + return "jobs." + error; + } + } + if (message.unreachable != null && Object.hasOwnProperty.call(message, "unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a JobList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobList} JobList + */ + JobList.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobList) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobList: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobList(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.bigquery.v2.JobList.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (!$util.isObject(object.jobs[i])) + throw TypeError(".google.cloud.bigquery.v2.JobList.jobs: object expected"); + message.jobs[i] = $root.google.cloud.bigquery.v2.ListFormatJob.fromObject(object.jobs[i], long + 1); + } + } + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.bigquery.v2.JobList.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {google.cloud.bigquery.v2.JobList} message JobList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobList.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) { + object.etag = ""; + object.kind = ""; + object.nextPageToken = ""; + } + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.bigquery.v2.ListFormatJob.toObject(message.jobs[j], options, q + 1); + } + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this JobList to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobList + * @instance + * @returns {Object.} JSON object + */ + JobList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobList + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobList"; + }; + + return JobList; + })(); + + v2.GetQueryResultsRequest = (function() { + + /** + * Properties of a GetQueryResultsRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetQueryResultsRequest + * @property {string|null} [projectId] GetQueryResultsRequest projectId + * @property {string|null} [jobId] GetQueryResultsRequest jobId + * @property {google.protobuf.IUInt64Value|null} [startIndex] GetQueryResultsRequest startIndex + * @property {string|null} [pageToken] GetQueryResultsRequest pageToken + * @property {google.protobuf.IUInt32Value|null} [maxResults] GetQueryResultsRequest maxResults + * @property {google.protobuf.IUInt32Value|null} [timeoutMs] GetQueryResultsRequest timeoutMs + * @property {string|null} [location] GetQueryResultsRequest location + * @property {google.cloud.bigquery.v2.IDataFormatOptions|null} [formatOptions] GetQueryResultsRequest formatOptions + */ + + /** + * Constructs a new GetQueryResultsRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetQueryResultsRequest. + * @implements IGetQueryResultsRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest=} [properties] Properties to set + */ + function GetQueryResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQueryResultsRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.projectId = ""; + + /** + * GetQueryResultsRequest jobId. + * @member {string} jobId + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.jobId = ""; + + /** + * GetQueryResultsRequest startIndex. + * @member {google.protobuf.IUInt64Value|null|undefined} startIndex + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.startIndex = null; + + /** + * GetQueryResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.pageToken = ""; + + /** + * GetQueryResultsRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.maxResults = null; + + /** + * GetQueryResultsRequest timeoutMs. + * @member {google.protobuf.IUInt32Value|null|undefined} timeoutMs + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.timeoutMs = null; + + /** + * GetQueryResultsRequest location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.location = ""; + + /** + * GetQueryResultsRequest formatOptions. + * @member {google.cloud.bigquery.v2.IDataFormatOptions|null|undefined} formatOptions + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + */ + GetQueryResultsRequest.prototype.formatOptions = null; + + /** + * Creates a new GetQueryResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetQueryResultsRequest} GetQueryResultsRequest instance + */ + GetQueryResultsRequest.create = function create(properties) { + return new GetQueryResultsRequest(properties); + }; + + /** + * Encodes the specified GetQueryResultsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest} message GetQueryResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQueryResultsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + $root.google.protobuf.UInt64Value.encode(message.startIndex, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) + $root.google.protobuf.UInt32Value.encode(message.timeoutMs, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.location); + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) + $root.google.cloud.bigquery.v2.DataFormatOptions.encode(message.formatOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetQueryResultsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsRequest} message GetQueryResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQueryResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetQueryResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetQueryResultsRequest} GetQueryResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQueryResultsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetQueryResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.startIndex = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.timeoutMs = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.location = reader.string(); + break; + } + case 8: { + message.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetQueryResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetQueryResultsRequest} GetQueryResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQueryResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQueryResultsRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQueryResultsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) { + var error = $root.google.protobuf.UInt64Value.verify(message.startIndex, long + 1); + if (error) + return "startIndex." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) { + var error = $root.google.protobuf.UInt32Value.verify(message.timeoutMs, long + 1); + if (error) + return "timeoutMs." + error; + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) { + var error = $root.google.cloud.bigquery.v2.DataFormatOptions.verify(message.formatOptions, long + 1); + if (error) + return "formatOptions." + error; + } + return null; + }; + + /** + * Creates a GetQueryResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetQueryResultsRequest} GetQueryResultsRequest + */ + GetQueryResultsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetQueryResultsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetQueryResultsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.startIndex != null) { + if (!$util.isObject(object.startIndex)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsRequest.startIndex: object expected"); + message.startIndex = $root.google.protobuf.UInt64Value.fromObject(object.startIndex, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.timeoutMs != null) { + if (!$util.isObject(object.timeoutMs)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsRequest.timeoutMs: object expected"); + message.timeoutMs = $root.google.protobuf.UInt32Value.fromObject(object.timeoutMs, long + 1); + } + if (object.location != null) + message.location = String(object.location); + if (object.formatOptions != null) { + if (!$util.isObject(object.formatOptions)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsRequest.formatOptions: object expected"); + message.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.fromObject(object.formatOptions, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GetQueryResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {google.cloud.bigquery.v2.GetQueryResultsRequest} message GetQueryResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQueryResultsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.startIndex = null; + object.pageToken = ""; + object.maxResults = null; + object.timeoutMs = null; + object.location = ""; + object.formatOptions = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + object.jobId = message.jobId; + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + object.startIndex = $root.google.protobuf.UInt64Value.toObject(message.startIndex, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) + object.timeoutMs = $root.google.protobuf.UInt32Value.toObject(message.timeoutMs, options, q + 1); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) + object.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.toObject(message.formatOptions, options, q + 1); + return object; + }; + + /** + * Converts this GetQueryResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @instance + * @returns {Object.} JSON object + */ + GetQueryResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetQueryResultsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetQueryResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQueryResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetQueryResultsRequest"; + }; + + return GetQueryResultsRequest; + })(); + + v2.GetQueryResultsResponse = (function() { + + /** + * Properties of a GetQueryResultsResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IGetQueryResultsResponse + * @property {string|null} [kind] GetQueryResultsResponse kind + * @property {string|null} [etag] GetQueryResultsResponse etag + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] GetQueryResultsResponse schema + * @property {google.cloud.bigquery.v2.IJobReference|null} [jobReference] GetQueryResultsResponse jobReference + * @property {google.protobuf.IUInt64Value|null} [totalRows] GetQueryResultsResponse totalRows + * @property {string|null} [pageToken] GetQueryResultsResponse pageToken + * @property {Array.|null} [rows] GetQueryResultsResponse rows + * @property {google.protobuf.IInt64Value|null} [totalBytesProcessed] GetQueryResultsResponse totalBytesProcessed + * @property {google.protobuf.IBoolValue|null} [jobComplete] GetQueryResultsResponse jobComplete + * @property {Array.|null} [errors] GetQueryResultsResponse errors + * @property {google.protobuf.IBoolValue|null} [cacheHit] GetQueryResultsResponse cacheHit + * @property {google.protobuf.IInt64Value|null} [numDmlAffectedRows] GetQueryResultsResponse numDmlAffectedRows + */ + + /** + * Constructs a new GetQueryResultsResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetQueryResultsResponse. + * @implements IGetQueryResultsResponse + * @constructor + * @param {google.cloud.bigquery.v2.IGetQueryResultsResponse=} [properties] Properties to set + */ + function GetQueryResultsResponse(properties) { + this.rows = []; + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQueryResultsResponse kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.kind = ""; + + /** + * GetQueryResultsResponse etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.etag = ""; + + /** + * GetQueryResultsResponse schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.schema = null; + + /** + * GetQueryResultsResponse jobReference. + * @member {google.cloud.bigquery.v2.IJobReference|null|undefined} jobReference + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.jobReference = null; + + /** + * GetQueryResultsResponse totalRows. + * @member {google.protobuf.IUInt64Value|null|undefined} totalRows + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.totalRows = null; + + /** + * GetQueryResultsResponse pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.pageToken = ""; + + /** + * GetQueryResultsResponse rows. + * @member {Array.} rows + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.rows = $util.emptyArray; + + /** + * GetQueryResultsResponse totalBytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} totalBytesProcessed + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.totalBytesProcessed = null; + + /** + * GetQueryResultsResponse jobComplete. + * @member {google.protobuf.IBoolValue|null|undefined} jobComplete + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.jobComplete = null; + + /** + * GetQueryResultsResponse errors. + * @member {Array.} errors + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.errors = $util.emptyArray; + + /** + * GetQueryResultsResponse cacheHit. + * @member {google.protobuf.IBoolValue|null|undefined} cacheHit + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.cacheHit = null; + + /** + * GetQueryResultsResponse numDmlAffectedRows. + * @member {google.protobuf.IInt64Value|null|undefined} numDmlAffectedRows + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + */ + GetQueryResultsResponse.prototype.numDmlAffectedRows = null; + + /** + * Creates a new GetQueryResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetQueryResultsResponse} GetQueryResultsResponse instance + */ + GetQueryResultsResponse.create = function create(properties) { + return new GetQueryResultsResponse(properties); + }; + + /** + * Encodes the specified GetQueryResultsResponse message. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsResponse} message GetQueryResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQueryResultsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + $root.google.cloud.bigquery.v2.JobReference.encode(message.jobReference, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + $root.google.protobuf.UInt64Value.encode(message.totalRows, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.Struct.encode(message.rows[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.totalBytesProcessed, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) + $root.google.protobuf.BoolValue.encode(message.jobComplete, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errors[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + $root.google.protobuf.BoolValue.encode(message.cacheHit, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + $root.google.protobuf.Int64Value.encode(message.numDmlAffectedRows, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetQueryResultsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetQueryResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {google.cloud.bigquery.v2.IGetQueryResultsResponse} message GetQueryResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQueryResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetQueryResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetQueryResultsResponse} GetQueryResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQueryResultsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetQueryResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.totalRows = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.totalBytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.jobComplete = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + message.cacheHit = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetQueryResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetQueryResultsResponse} GetQueryResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQueryResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQueryResultsResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQueryResultsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) { + var error = $root.google.cloud.bigquery.v2.JobReference.verify(message.jobReference, long + 1); + if (error) + return "jobReference." + error; + } + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) { + var error = $root.google.protobuf.UInt64Value.verify(message.totalRows, long + 1); + if (error) + return "totalRows." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.rows[i], long + 1); + if (error) + return "rows." + error; + } + } + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalBytesProcessed, long + 1); + if (error) + return "totalBytesProcessed." + error; + } + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) { + var error = $root.google.protobuf.BoolValue.verify(message.jobComplete, long + 1); + if (error) + return "jobComplete." + error; + } + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) { + var error = $root.google.protobuf.BoolValue.verify(message.cacheHit, long + 1); + if (error) + return "cacheHit." + error; + } + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.numDmlAffectedRows, long + 1); + if (error) + return "numDmlAffectedRows." + error; + } + return null; + }; + + /** + * Creates a GetQueryResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetQueryResultsResponse} GetQueryResultsResponse + */ + GetQueryResultsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetQueryResultsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetQueryResultsResponse(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.jobReference != null) { + if (!$util.isObject(object.jobReference)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.jobReference: object expected"); + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.fromObject(object.jobReference, long + 1); + } + if (object.totalRows != null) { + if (!$util.isObject(object.totalRows)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.totalRows: object expected"); + message.totalRows = $root.google.protobuf.UInt64Value.fromObject(object.totalRows, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (!$util.isObject(object.rows[i])) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.rows: object expected"); + message.rows[i] = $root.google.protobuf.Struct.fromObject(object.rows[i], long + 1); + } + } + if (object.totalBytesProcessed != null) { + if (!$util.isObject(object.totalBytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.totalBytesProcessed: object expected"); + message.totalBytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.totalBytesProcessed, long + 1); + } + if (object.jobComplete != null) { + if (!$util.isObject(object.jobComplete)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.jobComplete: object expected"); + message.jobComplete = $root.google.protobuf.BoolValue.fromObject(object.jobComplete, long + 1); + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (!$util.isObject(object.errors[i])) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.errors: object expected"); + message.errors[i] = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errors[i], long + 1); + } + } + if (object.cacheHit != null) { + if (!$util.isObject(object.cacheHit)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.cacheHit: object expected"); + message.cacheHit = $root.google.protobuf.BoolValue.fromObject(object.cacheHit, long + 1); + } + if (object.numDmlAffectedRows != null) { + if (!$util.isObject(object.numDmlAffectedRows)) + throw TypeError(".google.cloud.bigquery.v2.GetQueryResultsResponse.numDmlAffectedRows: object expected"); + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.fromObject(object.numDmlAffectedRows, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GetQueryResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {google.cloud.bigquery.v2.GetQueryResultsResponse} message GetQueryResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQueryResultsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.rows = []; + object.errors = []; + } + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.schema = null; + object.jobReference = null; + object.totalRows = null; + object.pageToken = ""; + object.totalBytesProcessed = null; + object.jobComplete = null; + object.cacheHit = null; + object.numDmlAffectedRows = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + object.jobReference = $root.google.cloud.bigquery.v2.JobReference.toObject(message.jobReference, options, q + 1); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + object.totalRows = $root.google.protobuf.UInt64Value.toObject(message.totalRows, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.Struct.toObject(message.rows[j], options, q + 1); + } + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + object.totalBytesProcessed = $root.google.protobuf.Int64Value.toObject(message.totalBytesProcessed, options, q + 1); + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) + object.jobComplete = $root.google.protobuf.BoolValue.toObject(message.jobComplete, options, q + 1); + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errors[j], options, q + 1); + } + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + object.cacheHit = $root.google.protobuf.BoolValue.toObject(message.cacheHit, options, q + 1); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + object.numDmlAffectedRows = $root.google.protobuf.Int64Value.toObject(message.numDmlAffectedRows, options, q + 1); + return object; + }; + + /** + * Converts this GetQueryResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @instance + * @returns {Object.} JSON object + */ + GetQueryResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetQueryResultsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetQueryResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQueryResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetQueryResultsResponse"; + }; + + return GetQueryResultsResponse; + })(); + + v2.PostQueryRequest = (function() { + + /** + * Properties of a PostQueryRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IPostQueryRequest + * @property {string|null} [projectId] PostQueryRequest projectId + * @property {google.cloud.bigquery.v2.IQueryRequest|null} [queryRequest] PostQueryRequest queryRequest + */ + + /** + * Constructs a new PostQueryRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PostQueryRequest. + * @implements IPostQueryRequest + * @constructor + * @param {google.cloud.bigquery.v2.IPostQueryRequest=} [properties] Properties to set + */ + function PostQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostQueryRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @instance + */ + PostQueryRequest.prototype.projectId = ""; + + /** + * PostQueryRequest queryRequest. + * @member {google.cloud.bigquery.v2.IQueryRequest|null|undefined} queryRequest + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @instance + */ + PostQueryRequest.prototype.queryRequest = null; + + /** + * Creates a new PostQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {google.cloud.bigquery.v2.IPostQueryRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PostQueryRequest} PostQueryRequest instance + */ + PostQueryRequest.create = function create(properties) { + return new PostQueryRequest(properties); + }; + + /** + * Encodes the specified PostQueryRequest message. Does not implicitly {@link google.cloud.bigquery.v2.PostQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {google.cloud.bigquery.v2.IPostQueryRequest} message PostQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostQueryRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.queryRequest != null && Object.hasOwnProperty.call(message, "queryRequest")) + $root.google.cloud.bigquery.v2.QueryRequest.encode(message.queryRequest, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PostQueryRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PostQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {google.cloud.bigquery.v2.IPostQueryRequest} message PostQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PostQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PostQueryRequest} PostQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostQueryRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PostQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.queryRequest = $root.google.cloud.bigquery.v2.QueryRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PostQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PostQueryRequest} PostQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostQueryRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostQueryRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.queryRequest != null && Object.hasOwnProperty.call(message, "queryRequest")) { + var error = $root.google.cloud.bigquery.v2.QueryRequest.verify(message.queryRequest, long + 1); + if (error) + return "queryRequest." + error; + } + return null; + }; + + /** + * Creates a PostQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PostQueryRequest} PostQueryRequest + */ + PostQueryRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PostQueryRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PostQueryRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PostQueryRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.queryRequest != null) { + if (!$util.isObject(object.queryRequest)) + throw TypeError(".google.cloud.bigquery.v2.PostQueryRequest.queryRequest: object expected"); + message.queryRequest = $root.google.cloud.bigquery.v2.QueryRequest.fromObject(object.queryRequest, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PostQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {google.cloud.bigquery.v2.PostQueryRequest} message PostQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostQueryRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.queryRequest = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.queryRequest != null && Object.hasOwnProperty.call(message, "queryRequest")) + object.queryRequest = $root.google.cloud.bigquery.v2.QueryRequest.toObject(message.queryRequest, options, q + 1); + return object; + }; + + /** + * Converts this PostQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @instance + * @returns {Object.} JSON object + */ + PostQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostQueryRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PostQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PostQueryRequest"; + }; + + return PostQueryRequest; + })(); + + v2.QueryRequest = (function() { + + /** + * Properties of a QueryRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryRequest + * @property {string|null} [kind] QueryRequest kind + * @property {string|null} [query] QueryRequest query + * @property {google.protobuf.IUInt32Value|null} [maxResults] QueryRequest maxResults + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [defaultDataset] QueryRequest defaultDataset + * @property {google.protobuf.IUInt32Value|null} [timeoutMs] QueryRequest timeoutMs + * @property {number|Long|null} [jobTimeoutMs] QueryRequest jobTimeoutMs + * @property {number|null} [maxSlots] QueryRequest maxSlots + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [destinationEncryptionConfiguration] QueryRequest destinationEncryptionConfiguration + * @property {boolean|null} [dryRun] QueryRequest dryRun + * @property {google.protobuf.IBoolValue|null} [useQueryCache] QueryRequest useQueryCache + * @property {google.protobuf.IBoolValue|null} [useLegacySql] QueryRequest useLegacySql + * @property {string|null} [parameterMode] QueryRequest parameterMode + * @property {Array.|null} [queryParameters] QueryRequest queryParameters + * @property {string|null} [location] QueryRequest location + * @property {google.cloud.bigquery.v2.IDataFormatOptions|null} [formatOptions] QueryRequest formatOptions + * @property {Array.|null} [connectionProperties] QueryRequest connectionProperties + * @property {Object.|null} [labels] QueryRequest labels + * @property {google.protobuf.IInt64Value|null} [maximumBytesBilled] QueryRequest maximumBytesBilled + * @property {string|null} [requestId] QueryRequest requestId + * @property {google.protobuf.IBoolValue|null} [createSession] QueryRequest createSession + * @property {google.cloud.bigquery.v2.QueryRequest.JobCreationMode|null} [jobCreationMode] QueryRequest jobCreationMode + * @property {string|null} [reservation] QueryRequest reservation + * @property {boolean|null} [writeIncrementalResults] QueryRequest writeIncrementalResults + */ + + /** + * Constructs a new QueryRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryRequest. + * @implements IQueryRequest + * @constructor + * @param {google.cloud.bigquery.v2.IQueryRequest=} [properties] Properties to set + */ + function QueryRequest(properties) { + this.queryParameters = []; + this.connectionProperties = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryRequest kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.kind = ""; + + /** + * QueryRequest query. + * @member {string} query + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.query = ""; + + /** + * QueryRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.maxResults = null; + + /** + * QueryRequest defaultDataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} defaultDataset + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.defaultDataset = null; + + /** + * QueryRequest timeoutMs. + * @member {google.protobuf.IUInt32Value|null|undefined} timeoutMs + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.timeoutMs = null; + + /** + * QueryRequest jobTimeoutMs. + * @member {number|Long|null|undefined} jobTimeoutMs + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.jobTimeoutMs = null; + + /** + * QueryRequest maxSlots. + * @member {number|null|undefined} maxSlots + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.maxSlots = null; + + /** + * QueryRequest destinationEncryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} destinationEncryptionConfiguration + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.destinationEncryptionConfiguration = null; + + /** + * QueryRequest dryRun. + * @member {boolean} dryRun + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.dryRun = false; + + /** + * QueryRequest useQueryCache. + * @member {google.protobuf.IBoolValue|null|undefined} useQueryCache + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.useQueryCache = null; + + /** + * QueryRequest useLegacySql. + * @member {google.protobuf.IBoolValue|null|undefined} useLegacySql + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.useLegacySql = null; + + /** + * QueryRequest parameterMode. + * @member {string} parameterMode + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.parameterMode = ""; + + /** + * QueryRequest queryParameters. + * @member {Array.} queryParameters + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.queryParameters = $util.emptyArray; + + /** + * QueryRequest location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.location = ""; + + /** + * QueryRequest formatOptions. + * @member {google.cloud.bigquery.v2.IDataFormatOptions|null|undefined} formatOptions + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.formatOptions = null; + + /** + * QueryRequest connectionProperties. + * @member {Array.} connectionProperties + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.connectionProperties = $util.emptyArray; + + /** + * QueryRequest labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.labels = $util.emptyObject; + + /** + * QueryRequest maximumBytesBilled. + * @member {google.protobuf.IInt64Value|null|undefined} maximumBytesBilled + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.maximumBytesBilled = null; + + /** + * QueryRequest requestId. + * @member {string} requestId + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.requestId = ""; + + /** + * QueryRequest createSession. + * @member {google.protobuf.IBoolValue|null|undefined} createSession + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.createSession = null; + + /** + * QueryRequest jobCreationMode. + * @member {google.cloud.bigquery.v2.QueryRequest.JobCreationMode} jobCreationMode + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.jobCreationMode = 0; + + /** + * QueryRequest reservation. + * @member {string|null|undefined} reservation + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.reservation = null; + + /** + * QueryRequest writeIncrementalResults. + * @member {boolean} writeIncrementalResults + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + */ + QueryRequest.prototype.writeIncrementalResults = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryRequest.prototype, "_jobTimeoutMs", { + get: $util.oneOfGetter($oneOfFields = ["jobTimeoutMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryRequest.prototype, "_maxSlots", { + get: $util.oneOfGetter($oneOfFields = ["maxSlots"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryRequest.prototype, "_reservation", { + get: $util.oneOfGetter($oneOfFields = ["reservation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {google.cloud.bigquery.v2.IQueryRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryRequest} QueryRequest instance + */ + QueryRequest.create = function create(properties) { + return new QueryRequest(properties); + }; + + /** + * Encodes the specified QueryRequest message. Does not implicitly {@link google.cloud.bigquery.v2.QueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {google.cloud.bigquery.v2.IQueryRequest} message QueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.defaultDataset, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) + $root.google.protobuf.UInt32Value.encode(message.timeoutMs, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.dryRun); + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) + $root.google.protobuf.BoolValue.encode(message.useQueryCache, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + $root.google.protobuf.BoolValue.encode(message.useLegacySql, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.parameterMode); + if (message.queryParameters != null && message.queryParameters.length) + for (var i = 0; i < message.queryParameters.length; ++i) + $root.google.cloud.bigquery.v2.QueryParameter.encode(message.queryParameters[i], writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.location); + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) + $root.google.cloud.bigquery.v2.DataFormatOptions.encode(message.formatOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.connectionProperties != null && message.connectionProperties.length) + for (var i = 0; i < message.connectionProperties.length; ++i) + $root.google.cloud.bigquery.v2.ConnectionProperty.encode(message.connectionProperties[i], writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) + $root.google.protobuf.Int64Value.encode(message.maximumBytesBilled, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.requestId); + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + $root.google.protobuf.BoolValue.encode(message.createSession, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.jobCreationMode != null && Object.hasOwnProperty.call(message, "jobCreationMode")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.jobCreationMode); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.reservation); + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.writeIncrementalResults); + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) + writer.uint32(/* id 26, wireType 0 =*/208).int64(message.jobTimeoutMs); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.destinationEncryptionConfiguration, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.maxSlots); + return writer; + }; + + /** + * Encodes the specified QueryRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {google.cloud.bigquery.v2.IQueryRequest} message QueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryRequest} QueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.timeoutMs = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.jobTimeoutMs = reader.int64(); + break; + } + case 28: { + message.maxSlots = reader.int32(); + break; + } + case 27: { + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.dryRun = reader.bool(); + break; + } + case 9: { + message.useQueryCache = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.useLegacySql = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.parameterMode = reader.string(); + break; + } + case 12: { + if (!(message.queryParameters && message.queryParameters.length)) + message.queryParameters = []; + message.queryParameters.push($root.google.cloud.bigquery.v2.QueryParameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 13: { + message.location = reader.string(); + break; + } + case 15: { + message.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + if (!(message.connectionProperties && message.connectionProperties.length)) + message.connectionProperties = []; + message.connectionProperties.push($root.google.cloud.bigquery.v2.ConnectionProperty.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 17: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 18: { + message.maximumBytesBilled = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.requestId = reader.string(); + break; + } + case 20: { + message.createSession = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.jobCreationMode = reader.int32(); + break; + } + case 24: { + message.reservation = reader.string(); + break; + } + case 25: { + message.writeIncrementalResults = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryRequest} QueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.defaultDataset, long + 1); + if (error) + return "defaultDataset." + error; + } + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) { + var error = $root.google.protobuf.UInt32Value.verify(message.timeoutMs, long + 1); + if (error) + return "timeoutMs." + error; + } + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) { + properties._jobTimeoutMs = 1; + if (!$util.isInteger(message.jobTimeoutMs) && !(message.jobTimeoutMs && $util.isInteger(message.jobTimeoutMs.low) && $util.isInteger(message.jobTimeoutMs.high))) + return "jobTimeoutMs: integer|Long expected"; + } + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) { + properties._maxSlots = 1; + if (!$util.isInteger(message.maxSlots)) + return "maxSlots: integer expected"; + } + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.destinationEncryptionConfiguration, long + 1); + if (error) + return "destinationEncryptionConfiguration." + error; + } + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + if (typeof message.dryRun !== "boolean") + return "dryRun: boolean expected"; + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) { + var error = $root.google.protobuf.BoolValue.verify(message.useQueryCache, long + 1); + if (error) + return "useQueryCache." + error; + } + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) { + var error = $root.google.protobuf.BoolValue.verify(message.useLegacySql, long + 1); + if (error) + return "useLegacySql." + error; + } + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + if (!$util.isString(message.parameterMode)) + return "parameterMode: string expected"; + if (message.queryParameters != null && Object.hasOwnProperty.call(message, "queryParameters")) { + if (!Array.isArray(message.queryParameters)) + return "queryParameters: array expected"; + for (var i = 0; i < message.queryParameters.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameter.verify(message.queryParameters[i], long + 1); + if (error) + return "queryParameters." + error; + } + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) { + var error = $root.google.cloud.bigquery.v2.DataFormatOptions.verify(message.formatOptions, long + 1); + if (error) + return "formatOptions." + error; + } + if (message.connectionProperties != null && Object.hasOwnProperty.call(message, "connectionProperties")) { + if (!Array.isArray(message.connectionProperties)) + return "connectionProperties: array expected"; + for (var i = 0; i < message.connectionProperties.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ConnectionProperty.verify(message.connectionProperties[i], long + 1); + if (error) + return "connectionProperties." + error; + } + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) { + var error = $root.google.protobuf.Int64Value.verify(message.maximumBytesBilled, long + 1); + if (error) + return "maximumBytesBilled." + error; + } + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) { + var error = $root.google.protobuf.BoolValue.verify(message.createSession, long + 1); + if (error) + return "createSession." + error; + } + if (message.jobCreationMode != null && Object.hasOwnProperty.call(message, "jobCreationMode")) + switch (message.jobCreationMode) { + default: + return "jobCreationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) { + properties._reservation = 1; + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + } + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + if (typeof message.writeIncrementalResults !== "boolean") + return "writeIncrementalResults: boolean expected"; + return null; + }; + + /** + * Creates a QueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryRequest} QueryRequest + */ + QueryRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryRequest(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.query != null) + message.query = String(object.query); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.defaultDataset != null) { + if (!$util.isObject(object.defaultDataset)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.defaultDataset: object expected"); + message.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.defaultDataset, long + 1); + } + if (object.timeoutMs != null) { + if (!$util.isObject(object.timeoutMs)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.timeoutMs: object expected"); + message.timeoutMs = $root.google.protobuf.UInt32Value.fromObject(object.timeoutMs, long + 1); + } + if (object.jobTimeoutMs != null) + if ($util.Long) + message.jobTimeoutMs = $util.Long.fromValue(object.jobTimeoutMs, false); + else if (typeof object.jobTimeoutMs === "string") + message.jobTimeoutMs = parseInt(object.jobTimeoutMs, 10); + else if (typeof object.jobTimeoutMs === "number") + message.jobTimeoutMs = object.jobTimeoutMs; + else if (typeof object.jobTimeoutMs === "object") + message.jobTimeoutMs = new $util.LongBits(object.jobTimeoutMs.low >>> 0, object.jobTimeoutMs.high >>> 0).toNumber(); + if (object.maxSlots != null) + message.maxSlots = object.maxSlots | 0; + if (object.destinationEncryptionConfiguration != null) { + if (!$util.isObject(object.destinationEncryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.destinationEncryptionConfiguration: object expected"); + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.destinationEncryptionConfiguration, long + 1); + } + if (object.dryRun != null) + message.dryRun = Boolean(object.dryRun); + if (object.useQueryCache != null) { + if (!$util.isObject(object.useQueryCache)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.useQueryCache: object expected"); + message.useQueryCache = $root.google.protobuf.BoolValue.fromObject(object.useQueryCache, long + 1); + } + if (object.useLegacySql != null) { + if (!$util.isObject(object.useLegacySql)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.useLegacySql: object expected"); + message.useLegacySql = $root.google.protobuf.BoolValue.fromObject(object.useLegacySql, long + 1); + } + if (object.parameterMode != null) + message.parameterMode = String(object.parameterMode); + if (object.queryParameters) { + if (!Array.isArray(object.queryParameters)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.queryParameters: array expected"); + message.queryParameters = []; + for (var i = 0; i < object.queryParameters.length; ++i) { + if (!$util.isObject(object.queryParameters[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.queryParameters: object expected"); + message.queryParameters[i] = $root.google.cloud.bigquery.v2.QueryParameter.fromObject(object.queryParameters[i], long + 1); + } + } + if (object.location != null) + message.location = String(object.location); + if (object.formatOptions != null) { + if (!$util.isObject(object.formatOptions)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.formatOptions: object expected"); + message.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.fromObject(object.formatOptions, long + 1); + } + if (object.connectionProperties) { + if (!Array.isArray(object.connectionProperties)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.connectionProperties: array expected"); + message.connectionProperties = []; + for (var i = 0; i < object.connectionProperties.length; ++i) { + if (!$util.isObject(object.connectionProperties[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.connectionProperties: object expected"); + message.connectionProperties[i] = $root.google.cloud.bigquery.v2.ConnectionProperty.fromObject(object.connectionProperties[i], long + 1); + } + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.maximumBytesBilled != null) { + if (!$util.isObject(object.maximumBytesBilled)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.maximumBytesBilled: object expected"); + message.maximumBytesBilled = $root.google.protobuf.Int64Value.fromObject(object.maximumBytesBilled, long + 1); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.createSession != null) { + if (!$util.isObject(object.createSession)) + throw TypeError(".google.cloud.bigquery.v2.QueryRequest.createSession: object expected"); + message.createSession = $root.google.protobuf.BoolValue.fromObject(object.createSession, long + 1); + } + switch (object.jobCreationMode) { + default: + if (typeof object.jobCreationMode === "number") { + message.jobCreationMode = object.jobCreationMode; + break; + } + break; + case "JOB_CREATION_MODE_UNSPECIFIED": + case 0: + message.jobCreationMode = 0; + break; + case "JOB_CREATION_REQUIRED": + case 1: + message.jobCreationMode = 1; + break; + case "JOB_CREATION_OPTIONAL": + case 2: + message.jobCreationMode = 2; + break; + } + if (object.reservation != null) + message.reservation = String(object.reservation); + if (object.writeIncrementalResults != null) + message.writeIncrementalResults = Boolean(object.writeIncrementalResults); + return message; + }; + + /** + * Creates a plain object from a QueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {google.cloud.bigquery.v2.QueryRequest} message QueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.queryParameters = []; + object.connectionProperties = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.kind = ""; + object.query = ""; + object.maxResults = null; + object.defaultDataset = null; + object.timeoutMs = null; + object.dryRun = false; + object.useQueryCache = null; + object.useLegacySql = null; + object.parameterMode = ""; + object.location = ""; + object.formatOptions = null; + object.maximumBytesBilled = null; + object.requestId = ""; + object.createSession = null; + object.jobCreationMode = options.enums === String ? "JOB_CREATION_MODE_UNSPECIFIED" : 0; + object.writeIncrementalResults = false; + object.destinationEncryptionConfiguration = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = message.query; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) + object.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.defaultDataset, options, q + 1); + if (message.timeoutMs != null && Object.hasOwnProperty.call(message, "timeoutMs")) + object.timeoutMs = $root.google.protobuf.UInt32Value.toObject(message.timeoutMs, options, q + 1); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + object.dryRun = message.dryRun; + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) + object.useQueryCache = $root.google.protobuf.BoolValue.toObject(message.useQueryCache, options, q + 1); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + object.useLegacySql = $root.google.protobuf.BoolValue.toObject(message.useLegacySql, options, q + 1); + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + object.parameterMode = message.parameterMode; + if (message.queryParameters && message.queryParameters.length) { + object.queryParameters = []; + for (var j = 0; j < message.queryParameters.length; ++j) + object.queryParameters[j] = $root.google.cloud.bigquery.v2.QueryParameter.toObject(message.queryParameters[j], options, q + 1); + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.formatOptions != null && Object.hasOwnProperty.call(message, "formatOptions")) + object.formatOptions = $root.google.cloud.bigquery.v2.DataFormatOptions.toObject(message.formatOptions, options, q + 1); + if (message.connectionProperties && message.connectionProperties.length) { + object.connectionProperties = []; + for (var j = 0; j < message.connectionProperties.length; ++j) + object.connectionProperties[j] = $root.google.cloud.bigquery.v2.ConnectionProperty.toObject(message.connectionProperties[j], options, q + 1); + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) + object.maximumBytesBilled = $root.google.protobuf.Int64Value.toObject(message.maximumBytesBilled, options, q + 1); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + object.requestId = message.requestId; + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + object.createSession = $root.google.protobuf.BoolValue.toObject(message.createSession, options, q + 1); + if (message.jobCreationMode != null && Object.hasOwnProperty.call(message, "jobCreationMode")) + object.jobCreationMode = options.enums === String ? $root.google.cloud.bigquery.v2.QueryRequest.JobCreationMode[message.jobCreationMode] === undefined ? message.jobCreationMode : $root.google.cloud.bigquery.v2.QueryRequest.JobCreationMode[message.jobCreationMode] : message.jobCreationMode; + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) { + object.reservation = message.reservation; + if (options.oneofs) + object._reservation = "reservation"; + } + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + object.writeIncrementalResults = message.writeIncrementalResults; + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.jobTimeoutMs = typeof message.jobTimeoutMs === "number" ? BigInt(message.jobTimeoutMs) : $util.Long.fromBits(message.jobTimeoutMs.low >>> 0, message.jobTimeoutMs.high >>> 0, false).toBigInt(); + else if (typeof message.jobTimeoutMs === "number") + object.jobTimeoutMs = options.longs === String ? String(message.jobTimeoutMs) : message.jobTimeoutMs; + else + object.jobTimeoutMs = options.longs === String ? $util.Long.prototype.toString.call(message.jobTimeoutMs) : options.longs === Number ? new $util.LongBits(message.jobTimeoutMs.low >>> 0, message.jobTimeoutMs.high >>> 0).toNumber() : message.jobTimeoutMs; + if (options.oneofs) + object._jobTimeoutMs = "jobTimeoutMs"; + } + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + object.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.destinationEncryptionConfiguration, options, q + 1); + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) { + object.maxSlots = message.maxSlots; + if (options.oneofs) + object._maxSlots = "maxSlots"; + } + return object; + }; + + /** + * Converts this QueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryRequest + * @instance + * @returns {Object.} JSON object + */ + QueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryRequest"; + }; + + /** + * JobCreationMode enum. + * @name google.cloud.bigquery.v2.QueryRequest.JobCreationMode + * @enum {number} + * @property {number} JOB_CREATION_MODE_UNSPECIFIED=0 JOB_CREATION_MODE_UNSPECIFIED value + * @property {number} JOB_CREATION_REQUIRED=1 JOB_CREATION_REQUIRED value + * @property {number} JOB_CREATION_OPTIONAL=2 JOB_CREATION_OPTIONAL value + */ + QueryRequest.JobCreationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_CREATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_CREATION_REQUIRED"] = 1; + values[valuesById[2] = "JOB_CREATION_OPTIONAL"] = 2; + return values; + })(); + + return QueryRequest; + })(); + + v2.QueryResponse = (function() { + + /** + * Properties of a QueryResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryResponse + * @property {string|null} [kind] QueryResponse kind + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] QueryResponse schema + * @property {google.cloud.bigquery.v2.IJobReference|null} [jobReference] QueryResponse jobReference + * @property {google.cloud.bigquery.v2.IJobCreationReason|null} [jobCreationReason] QueryResponse jobCreationReason + * @property {string|null} [queryId] QueryResponse queryId + * @property {string|null} [location] QueryResponse location + * @property {google.protobuf.IUInt64Value|null} [totalRows] QueryResponse totalRows + * @property {string|null} [pageToken] QueryResponse pageToken + * @property {Array.|null} [rows] QueryResponse rows + * @property {google.protobuf.IInt64Value|null} [totalBytesProcessed] QueryResponse totalBytesProcessed + * @property {number|Long|null} [totalBytesBilled] QueryResponse totalBytesBilled + * @property {number|Long|null} [totalSlotMs] QueryResponse totalSlotMs + * @property {google.protobuf.IBoolValue|null} [jobComplete] QueryResponse jobComplete + * @property {Array.|null} [errors] QueryResponse errors + * @property {google.protobuf.IBoolValue|null} [cacheHit] QueryResponse cacheHit + * @property {google.protobuf.IInt64Value|null} [numDmlAffectedRows] QueryResponse numDmlAffectedRows + * @property {google.cloud.bigquery.v2.ISessionInfo|null} [sessionInfo] QueryResponse sessionInfo + * @property {google.cloud.bigquery.v2.IDmlStats|null} [dmlStats] QueryResponse dmlStats + * @property {number|Long|null} [creationTime] QueryResponse creationTime + * @property {number|Long|null} [startTime] QueryResponse startTime + * @property {number|Long|null} [endTime] QueryResponse endTime + */ + + /** + * Constructs a new QueryResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryResponse. + * @implements IQueryResponse + * @constructor + * @param {google.cloud.bigquery.v2.IQueryResponse=} [properties] Properties to set + */ + function QueryResponse(properties) { + this.rows = []; + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryResponse kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.kind = ""; + + /** + * QueryResponse schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.schema = null; + + /** + * QueryResponse jobReference. + * @member {google.cloud.bigquery.v2.IJobReference|null|undefined} jobReference + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.jobReference = null; + + /** + * QueryResponse jobCreationReason. + * @member {google.cloud.bigquery.v2.IJobCreationReason|null|undefined} jobCreationReason + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.jobCreationReason = null; + + /** + * QueryResponse queryId. + * @member {string} queryId + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.queryId = ""; + + /** + * QueryResponse location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.location = ""; + + /** + * QueryResponse totalRows. + * @member {google.protobuf.IUInt64Value|null|undefined} totalRows + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.totalRows = null; + + /** + * QueryResponse pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.pageToken = ""; + + /** + * QueryResponse rows. + * @member {Array.} rows + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.rows = $util.emptyArray; + + /** + * QueryResponse totalBytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} totalBytesProcessed + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.totalBytesProcessed = null; + + /** + * QueryResponse totalBytesBilled. + * @member {number|Long|null|undefined} totalBytesBilled + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.totalBytesBilled = null; + + /** + * QueryResponse totalSlotMs. + * @member {number|Long|null|undefined} totalSlotMs + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.totalSlotMs = null; + + /** + * QueryResponse jobComplete. + * @member {google.protobuf.IBoolValue|null|undefined} jobComplete + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.jobComplete = null; + + /** + * QueryResponse errors. + * @member {Array.} errors + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.errors = $util.emptyArray; + + /** + * QueryResponse cacheHit. + * @member {google.protobuf.IBoolValue|null|undefined} cacheHit + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.cacheHit = null; + + /** + * QueryResponse numDmlAffectedRows. + * @member {google.protobuf.IInt64Value|null|undefined} numDmlAffectedRows + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.numDmlAffectedRows = null; + + /** + * QueryResponse sessionInfo. + * @member {google.cloud.bigquery.v2.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.sessionInfo = null; + + /** + * QueryResponse dmlStats. + * @member {google.cloud.bigquery.v2.IDmlStats|null|undefined} dmlStats + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.dmlStats = null; + + /** + * QueryResponse creationTime. + * @member {number|Long|null|undefined} creationTime + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.creationTime = null; + + /** + * QueryResponse startTime. + * @member {number|Long|null|undefined} startTime + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.startTime = null; + + /** + * QueryResponse endTime. + * @member {number|Long|null|undefined} endTime + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + */ + QueryResponse.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResponse.prototype, "_totalBytesBilled", { + get: $util.oneOfGetter($oneOfFields = ["totalBytesBilled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResponse.prototype, "_totalSlotMs", { + get: $util.oneOfGetter($oneOfFields = ["totalSlotMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResponse.prototype, "_creationTime", { + get: $util.oneOfGetter($oneOfFields = ["creationTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResponse.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryResponse.prototype, "_endTime", { + get: $util.oneOfGetter($oneOfFields = ["endTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {google.cloud.bigquery.v2.IQueryResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryResponse} QueryResponse instance + */ + QueryResponse.create = function create(properties) { + return new QueryResponse(properties); + }; + + /** + * Encodes the specified QueryResponse message. Does not implicitly {@link google.cloud.bigquery.v2.QueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {google.cloud.bigquery.v2.IQueryResponse} message QueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + $root.google.cloud.bigquery.v2.JobReference.encode(message.jobReference, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + $root.google.protobuf.UInt64Value.encode(message.totalRows, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.Struct.encode(message.rows[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.totalBytesProcessed, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) + $root.google.protobuf.BoolValue.encode(message.jobComplete, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errors[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + $root.google.protobuf.BoolValue.encode(message.cacheHit, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + $root.google.protobuf.Int64Value.encode(message.numDmlAffectedRows, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.bigquery.v2.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) + $root.google.cloud.bigquery.v2.DmlStats.encode(message.dmlStats, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.queryId != null && Object.hasOwnProperty.call(message, "queryId")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.queryId); + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) + $root.google.cloud.bigquery.v2.JobCreationReason.encode(message.jobCreationReason, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.totalBytesBilled); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.totalSlotMs); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.location); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.creationTime); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 20, wireType 0 =*/160).int64(message.startTime); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 21, wireType 0 =*/168).int64(message.endTime); + return writer; + }; + + /** + * Encodes the specified QueryResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {google.cloud.bigquery.v2.IQueryResponse} message QueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryResponse} QueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.queryId = reader.string(); + break; + } + case 18: { + message.location = reader.string(); + break; + } + case 4: { + message.totalRows = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.totalBytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.totalBytesBilled = reader.int64(); + break; + } + case 17: { + message.totalSlotMs = reader.int64(); + break; + } + case 8: { + message.jobComplete = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.cacheHit = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.creationTime = reader.int64(); + break; + } + case 20: { + message.startTime = reader.int64(); + break; + } + case 21: { + message.endTime = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryResponse} QueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) { + var error = $root.google.cloud.bigquery.v2.JobReference.verify(message.jobReference, long + 1); + if (error) + return "jobReference." + error; + } + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) { + var error = $root.google.cloud.bigquery.v2.JobCreationReason.verify(message.jobCreationReason, long + 1); + if (error) + return "jobCreationReason." + error; + } + if (message.queryId != null && Object.hasOwnProperty.call(message, "queryId")) + if (!$util.isString(message.queryId)) + return "queryId: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) { + var error = $root.google.protobuf.UInt64Value.verify(message.totalRows, long + 1); + if (error) + return "totalRows." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.rows[i], long + 1); + if (error) + return "rows." + error; + } + } + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalBytesProcessed, long + 1); + if (error) + return "totalBytesProcessed." + error; + } + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) { + properties._totalBytesBilled = 1; + if (!$util.isInteger(message.totalBytesBilled) && !(message.totalBytesBilled && $util.isInteger(message.totalBytesBilled.low) && $util.isInteger(message.totalBytesBilled.high))) + return "totalBytesBilled: integer|Long expected"; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) { + properties._totalSlotMs = 1; + if (!$util.isInteger(message.totalSlotMs) && !(message.totalSlotMs && $util.isInteger(message.totalSlotMs.low) && $util.isInteger(message.totalSlotMs.high))) + return "totalSlotMs: integer|Long expected"; + } + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) { + var error = $root.google.protobuf.BoolValue.verify(message.jobComplete, long + 1); + if (error) + return "jobComplete." + error; + } + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) { + var error = $root.google.protobuf.BoolValue.verify(message.cacheHit, long + 1); + if (error) + return "cacheHit." + error; + } + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.numDmlAffectedRows, long + 1); + if (error) + return "numDmlAffectedRows." + error; + } + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) { + var error = $root.google.cloud.bigquery.v2.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) { + var error = $root.google.cloud.bigquery.v2.DmlStats.verify(message.dmlStats, long + 1); + if (error) + return "dmlStats." + error; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) { + properties._creationTime = 1; + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + properties._startTime = 1; + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + } + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + properties._endTime = 1; + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + } + return null; + }; + + /** + * Creates a QueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryResponse} QueryResponse + */ + QueryResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryResponse(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.jobReference != null) { + if (!$util.isObject(object.jobReference)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.jobReference: object expected"); + message.jobReference = $root.google.cloud.bigquery.v2.JobReference.fromObject(object.jobReference, long + 1); + } + if (object.jobCreationReason != null) { + if (!$util.isObject(object.jobCreationReason)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.jobCreationReason: object expected"); + message.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.fromObject(object.jobCreationReason, long + 1); + } + if (object.queryId != null) + message.queryId = String(object.queryId); + if (object.location != null) + message.location = String(object.location); + if (object.totalRows != null) { + if (!$util.isObject(object.totalRows)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.totalRows: object expected"); + message.totalRows = $root.google.protobuf.UInt64Value.fromObject(object.totalRows, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (!$util.isObject(object.rows[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.rows: object expected"); + message.rows[i] = $root.google.protobuf.Struct.fromObject(object.rows[i], long + 1); + } + } + if (object.totalBytesProcessed != null) { + if (!$util.isObject(object.totalBytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.totalBytesProcessed: object expected"); + message.totalBytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.totalBytesProcessed, long + 1); + } + if (object.totalBytesBilled != null) + if ($util.Long) + message.totalBytesBilled = $util.Long.fromValue(object.totalBytesBilled, false); + else if (typeof object.totalBytesBilled === "string") + message.totalBytesBilled = parseInt(object.totalBytesBilled, 10); + else if (typeof object.totalBytesBilled === "number") + message.totalBytesBilled = object.totalBytesBilled; + else if (typeof object.totalBytesBilled === "object") + message.totalBytesBilled = new $util.LongBits(object.totalBytesBilled.low >>> 0, object.totalBytesBilled.high >>> 0).toNumber(); + if (object.totalSlotMs != null) + if ($util.Long) + message.totalSlotMs = $util.Long.fromValue(object.totalSlotMs, false); + else if (typeof object.totalSlotMs === "string") + message.totalSlotMs = parseInt(object.totalSlotMs, 10); + else if (typeof object.totalSlotMs === "number") + message.totalSlotMs = object.totalSlotMs; + else if (typeof object.totalSlotMs === "object") + message.totalSlotMs = new $util.LongBits(object.totalSlotMs.low >>> 0, object.totalSlotMs.high >>> 0).toNumber(); + if (object.jobComplete != null) { + if (!$util.isObject(object.jobComplete)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.jobComplete: object expected"); + message.jobComplete = $root.google.protobuf.BoolValue.fromObject(object.jobComplete, long + 1); + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (!$util.isObject(object.errors[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.errors: object expected"); + message.errors[i] = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errors[i], long + 1); + } + } + if (object.cacheHit != null) { + if (!$util.isObject(object.cacheHit)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.cacheHit: object expected"); + message.cacheHit = $root.google.protobuf.BoolValue.fromObject(object.cacheHit, long + 1); + } + if (object.numDmlAffectedRows != null) { + if (!$util.isObject(object.numDmlAffectedRows)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.numDmlAffectedRows: object expected"); + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.fromObject(object.numDmlAffectedRows, long + 1); + } + if (object.sessionInfo != null) { + if (!$util.isObject(object.sessionInfo)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.dmlStats != null) { + if (!$util.isObject(object.dmlStats)) + throw TypeError(".google.cloud.bigquery.v2.QueryResponse.dmlStats: object expected"); + message.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.fromObject(object.dmlStats, long + 1); + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.startTime != null) + if ($util.Long) + message.startTime = $util.Long.fromValue(object.startTime, false); + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(); + if (object.endTime != null) + if ($util.Long) + message.endTime = $util.Long.fromValue(object.endTime, false); + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {google.cloud.bigquery.v2.QueryResponse} message QueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.rows = []; + object.errors = []; + } + if (options.defaults) { + object.kind = ""; + object.schema = null; + object.jobReference = null; + object.totalRows = null; + object.pageToken = ""; + object.totalBytesProcessed = null; + object.jobComplete = null; + object.cacheHit = null; + object.numDmlAffectedRows = null; + object.sessionInfo = null; + object.dmlStats = null; + object.queryId = ""; + object.jobCreationReason = null; + object.location = ""; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + object.jobReference = $root.google.cloud.bigquery.v2.JobReference.toObject(message.jobReference, options, q + 1); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + object.totalRows = $root.google.protobuf.UInt64Value.toObject(message.totalRows, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.Struct.toObject(message.rows[j], options, q + 1); + } + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + object.totalBytesProcessed = $root.google.protobuf.Int64Value.toObject(message.totalBytesProcessed, options, q + 1); + if (message.jobComplete != null && Object.hasOwnProperty.call(message, "jobComplete")) + object.jobComplete = $root.google.protobuf.BoolValue.toObject(message.jobComplete, options, q + 1); + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errors[j], options, q + 1); + } + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + object.cacheHit = $root.google.protobuf.BoolValue.toObject(message.cacheHit, options, q + 1); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + object.numDmlAffectedRows = $root.google.protobuf.Int64Value.toObject(message.numDmlAffectedRows, options, q + 1); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + object.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.toObject(message.sessionInfo, options, q + 1); + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) + object.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.toObject(message.dmlStats, options, q + 1); + if (message.queryId != null && Object.hasOwnProperty.call(message, "queryId")) + object.queryId = message.queryId; + if (message.jobCreationReason != null && Object.hasOwnProperty.call(message, "jobCreationReason")) + object.jobCreationReason = $root.google.cloud.bigquery.v2.JobCreationReason.toObject(message.jobCreationReason, options, q + 1); + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.totalBytesBilled = typeof message.totalBytesBilled === "number" ? BigInt(message.totalBytesBilled) : $util.Long.fromBits(message.totalBytesBilled.low >>> 0, message.totalBytesBilled.high >>> 0, false).toBigInt(); + else if (typeof message.totalBytesBilled === "number") + object.totalBytesBilled = options.longs === String ? String(message.totalBytesBilled) : message.totalBytesBilled; + else + object.totalBytesBilled = options.longs === String ? $util.Long.prototype.toString.call(message.totalBytesBilled) : options.longs === Number ? new $util.LongBits(message.totalBytesBilled.low >>> 0, message.totalBytesBilled.high >>> 0).toNumber() : message.totalBytesBilled; + if (options.oneofs) + object._totalBytesBilled = "totalBytesBilled"; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.totalSlotMs = typeof message.totalSlotMs === "number" ? BigInt(message.totalSlotMs) : $util.Long.fromBits(message.totalSlotMs.low >>> 0, message.totalSlotMs.high >>> 0, false).toBigInt(); + else if (typeof message.totalSlotMs === "number") + object.totalSlotMs = options.longs === String ? String(message.totalSlotMs) : message.totalSlotMs; + else + object.totalSlotMs = options.longs === String ? $util.Long.prototype.toString.call(message.totalSlotMs) : options.longs === Number ? new $util.LongBits(message.totalSlotMs.low >>> 0, message.totalSlotMs.high >>> 0).toNumber() : message.totalSlotMs; + if (options.oneofs) + object._totalSlotMs = "totalSlotMs"; + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (options.oneofs) + object._creationTime = "creationTime"; + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.startTime = typeof message.startTime === "number" ? BigInt(message.startTime) : $util.Long.fromBits(message.startTime.low >>> 0, message.startTime.high >>> 0, false).toBigInt(); + else if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber() : message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.endTime = typeof message.endTime === "number" ? BigInt(message.endTime) : $util.Long.fromBits(message.endTime.low >>> 0, message.endTime.high >>> 0, false).toBigInt(); + else if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (options.oneofs) + object._endTime = "endTime"; + } + return object; + }; + + /** + * Converts this QueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryResponse + * @instance + * @returns {Object.} JSON object + */ + QueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryResponse"; + }; + + return QueryResponse; + })(); + + v2.DestinationTableProperties = (function() { + + /** + * Properties of a DestinationTableProperties. + * @memberof google.cloud.bigquery.v2 + * @interface IDestinationTableProperties + * @property {google.protobuf.IStringValue|null} [friendlyName] DestinationTableProperties friendlyName + * @property {google.protobuf.IStringValue|null} [description] DestinationTableProperties description + * @property {Object.|null} [labels] DestinationTableProperties labels + */ + + /** + * Constructs a new DestinationTableProperties. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DestinationTableProperties. + * @implements IDestinationTableProperties + * @constructor + * @param {google.cloud.bigquery.v2.IDestinationTableProperties=} [properties] Properties to set + */ + function DestinationTableProperties(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DestinationTableProperties friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @instance + */ + DestinationTableProperties.prototype.friendlyName = null; + + /** + * DestinationTableProperties description. + * @member {google.protobuf.IStringValue|null|undefined} description + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @instance + */ + DestinationTableProperties.prototype.description = null; + + /** + * DestinationTableProperties labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @instance + */ + DestinationTableProperties.prototype.labels = $util.emptyObject; + + /** + * Creates a new DestinationTableProperties instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {google.cloud.bigquery.v2.IDestinationTableProperties=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DestinationTableProperties} DestinationTableProperties instance + */ + DestinationTableProperties.create = function create(properties) { + return new DestinationTableProperties(properties); + }; + + /** + * Encodes the specified DestinationTableProperties message. Does not implicitly {@link google.cloud.bigquery.v2.DestinationTableProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {google.cloud.bigquery.v2.IDestinationTableProperties} message DestinationTableProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationTableProperties.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.protobuf.StringValue.encode(message.description, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DestinationTableProperties message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DestinationTableProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {google.cloud.bigquery.v2.IDestinationTableProperties} message DestinationTableProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationTableProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DestinationTableProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DestinationTableProperties} DestinationTableProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationTableProperties.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DestinationTableProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.description = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationTableProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DestinationTableProperties} DestinationTableProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationTableProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationTableProperties message. + * @function verify + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationTableProperties.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName, long + 1); + if (error) + return "friendlyName." + error; + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) { + var error = $root.google.protobuf.StringValue.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DestinationTableProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DestinationTableProperties} DestinationTableProperties + */ + DestinationTableProperties.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DestinationTableProperties) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DestinationTableProperties: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DestinationTableProperties(); + if (object.friendlyName != null) { + if (!$util.isObject(object.friendlyName)) + throw TypeError(".google.cloud.bigquery.v2.DestinationTableProperties.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName, long + 1); + } + if (object.description != null) { + if (!$util.isObject(object.description)) + throw TypeError(".google.cloud.bigquery.v2.DestinationTableProperties.description: object expected"); + message.description = $root.google.protobuf.StringValue.fromObject(object.description, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.DestinationTableProperties.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a DestinationTableProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {google.cloud.bigquery.v2.DestinationTableProperties} message DestinationTableProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationTableProperties.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.friendlyName = null; + object.description = null; + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options, q + 1); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = $root.google.protobuf.StringValue.toObject(message.description, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this DestinationTableProperties to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @instance + * @returns {Object.} JSON object + */ + DestinationTableProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationTableProperties + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DestinationTableProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationTableProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DestinationTableProperties"; + }; + + return DestinationTableProperties; + })(); + + v2.ConnectionProperty = (function() { + + /** + * Properties of a ConnectionProperty. + * @memberof google.cloud.bigquery.v2 + * @interface IConnectionProperty + * @property {string|null} [key] ConnectionProperty key + * @property {string|null} [value] ConnectionProperty value + */ + + /** + * Constructs a new ConnectionProperty. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ConnectionProperty. + * @implements IConnectionProperty + * @constructor + * @param {google.cloud.bigquery.v2.IConnectionProperty=} [properties] Properties to set + */ + function ConnectionProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionProperty key. + * @member {string} key + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @instance + */ + ConnectionProperty.prototype.key = ""; + + /** + * ConnectionProperty value. + * @member {string} value + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @instance + */ + ConnectionProperty.prototype.value = ""; + + /** + * Creates a new ConnectionProperty instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {google.cloud.bigquery.v2.IConnectionProperty=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ConnectionProperty} ConnectionProperty instance + */ + ConnectionProperty.create = function create(properties) { + return new ConnectionProperty(properties); + }; + + /** + * Encodes the specified ConnectionProperty message. Does not implicitly {@link google.cloud.bigquery.v2.ConnectionProperty.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {google.cloud.bigquery.v2.IConnectionProperty} message ConnectionProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProperty.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified ConnectionProperty message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ConnectionProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {google.cloud.bigquery.v2.IConnectionProperty} message ConnectionProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ConnectionProperty message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ConnectionProperty} ConnectionProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProperty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ConnectionProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ConnectionProperty} ConnectionProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionProperty message. + * @function verify + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionProperty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a ConnectionProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ConnectionProperty} ConnectionProperty + */ + ConnectionProperty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ConnectionProperty) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ConnectionProperty: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ConnectionProperty(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a ConnectionProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {google.cloud.bigquery.v2.ConnectionProperty} message ConnectionProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionProperty.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = ""; + } + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + object.key = message.key; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + return object; + }; + + /** + * Converts this ConnectionProperty to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @instance + * @returns {Object.} JSON object + */ + ConnectionProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionProperty + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ConnectionProperty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ConnectionProperty"; + }; + + return ConnectionProperty; + })(); + + v2.JobConfigurationQuery = (function() { + + /** + * Properties of a JobConfigurationQuery. + * @memberof google.cloud.bigquery.v2 + * @interface IJobConfigurationQuery + * @property {string|null} [query] JobConfigurationQuery query + * @property {google.cloud.bigquery.v2.ITableReference|null} [destinationTable] JobConfigurationQuery destinationTable + * @property {Object.|null} [externalTableDefinitions] JobConfigurationQuery externalTableDefinitions + * @property {Array.|null} [userDefinedFunctionResources] JobConfigurationQuery userDefinedFunctionResources + * @property {string|null} [createDisposition] JobConfigurationQuery createDisposition + * @property {string|null} [writeDisposition] JobConfigurationQuery writeDisposition + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [defaultDataset] JobConfigurationQuery defaultDataset + * @property {string|null} [priority] JobConfigurationQuery priority + * @property {google.protobuf.IBoolValue|null} [allowLargeResults] JobConfigurationQuery allowLargeResults + * @property {google.protobuf.IBoolValue|null} [useQueryCache] JobConfigurationQuery useQueryCache + * @property {google.protobuf.IBoolValue|null} [flattenResults] JobConfigurationQuery flattenResults + * @property {google.protobuf.IInt64Value|null} [maximumBytesBilled] JobConfigurationQuery maximumBytesBilled + * @property {google.protobuf.IBoolValue|null} [useLegacySql] JobConfigurationQuery useLegacySql + * @property {string|null} [parameterMode] JobConfigurationQuery parameterMode + * @property {Array.|null} [queryParameters] JobConfigurationQuery queryParameters + * @property {google.cloud.bigquery.v2.ISystemVariables|null} [systemVariables] JobConfigurationQuery systemVariables + * @property {Array.|null} [schemaUpdateOptions] JobConfigurationQuery schemaUpdateOptions + * @property {google.cloud.bigquery.v2.ITimePartitioning|null} [timePartitioning] JobConfigurationQuery timePartitioning + * @property {google.cloud.bigquery.v2.IRangePartitioning|null} [rangePartitioning] JobConfigurationQuery rangePartitioning + * @property {google.cloud.bigquery.v2.IClustering|null} [clustering] JobConfigurationQuery clustering + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [destinationEncryptionConfiguration] JobConfigurationQuery destinationEncryptionConfiguration + * @property {google.cloud.bigquery.v2.IScriptOptions|null} [scriptOptions] JobConfigurationQuery scriptOptions + * @property {Array.|null} [connectionProperties] JobConfigurationQuery connectionProperties + * @property {google.protobuf.IBoolValue|null} [createSession] JobConfigurationQuery createSession + * @property {google.protobuf.IBoolValue|null} [continuous] JobConfigurationQuery continuous + * @property {boolean|null} [writeIncrementalResults] JobConfigurationQuery writeIncrementalResults + */ + + /** + * Constructs a new JobConfigurationQuery. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobConfigurationQuery. + * @implements IJobConfigurationQuery + * @constructor + * @param {google.cloud.bigquery.v2.IJobConfigurationQuery=} [properties] Properties to set + */ + function JobConfigurationQuery(properties) { + this.externalTableDefinitions = {}; + this.userDefinedFunctionResources = []; + this.queryParameters = []; + this.schemaUpdateOptions = []; + this.connectionProperties = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfigurationQuery query. + * @member {string} query + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.query = ""; + + /** + * JobConfigurationQuery destinationTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} destinationTable + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.destinationTable = null; + + /** + * JobConfigurationQuery externalTableDefinitions. + * @member {Object.} externalTableDefinitions + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.externalTableDefinitions = $util.emptyObject; + + /** + * JobConfigurationQuery userDefinedFunctionResources. + * @member {Array.} userDefinedFunctionResources + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.userDefinedFunctionResources = $util.emptyArray; + + /** + * JobConfigurationQuery createDisposition. + * @member {string} createDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.createDisposition = ""; + + /** + * JobConfigurationQuery writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.writeDisposition = ""; + + /** + * JobConfigurationQuery defaultDataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} defaultDataset + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.defaultDataset = null; + + /** + * JobConfigurationQuery priority. + * @member {string} priority + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.priority = ""; + + /** + * JobConfigurationQuery allowLargeResults. + * @member {google.protobuf.IBoolValue|null|undefined} allowLargeResults + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.allowLargeResults = null; + + /** + * JobConfigurationQuery useQueryCache. + * @member {google.protobuf.IBoolValue|null|undefined} useQueryCache + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.useQueryCache = null; + + /** + * JobConfigurationQuery flattenResults. + * @member {google.protobuf.IBoolValue|null|undefined} flattenResults + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.flattenResults = null; + + /** + * JobConfigurationQuery maximumBytesBilled. + * @member {google.protobuf.IInt64Value|null|undefined} maximumBytesBilled + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.maximumBytesBilled = null; + + /** + * JobConfigurationQuery useLegacySql. + * @member {google.protobuf.IBoolValue|null|undefined} useLegacySql + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.useLegacySql = null; + + /** + * JobConfigurationQuery parameterMode. + * @member {string} parameterMode + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.parameterMode = ""; + + /** + * JobConfigurationQuery queryParameters. + * @member {Array.} queryParameters + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.queryParameters = $util.emptyArray; + + /** + * JobConfigurationQuery systemVariables. + * @member {google.cloud.bigquery.v2.ISystemVariables|null|undefined} systemVariables + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.systemVariables = null; + + /** + * JobConfigurationQuery schemaUpdateOptions. + * @member {Array.} schemaUpdateOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.schemaUpdateOptions = $util.emptyArray; + + /** + * JobConfigurationQuery timePartitioning. + * @member {google.cloud.bigquery.v2.ITimePartitioning|null|undefined} timePartitioning + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.timePartitioning = null; + + /** + * JobConfigurationQuery rangePartitioning. + * @member {google.cloud.bigquery.v2.IRangePartitioning|null|undefined} rangePartitioning + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.rangePartitioning = null; + + /** + * JobConfigurationQuery clustering. + * @member {google.cloud.bigquery.v2.IClustering|null|undefined} clustering + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.clustering = null; + + /** + * JobConfigurationQuery destinationEncryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} destinationEncryptionConfiguration + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.destinationEncryptionConfiguration = null; + + /** + * JobConfigurationQuery scriptOptions. + * @member {google.cloud.bigquery.v2.IScriptOptions|null|undefined} scriptOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.scriptOptions = null; + + /** + * JobConfigurationQuery connectionProperties. + * @member {Array.} connectionProperties + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.connectionProperties = $util.emptyArray; + + /** + * JobConfigurationQuery createSession. + * @member {google.protobuf.IBoolValue|null|undefined} createSession + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.createSession = null; + + /** + * JobConfigurationQuery continuous. + * @member {google.protobuf.IBoolValue|null|undefined} continuous + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.continuous = null; + + /** + * JobConfigurationQuery writeIncrementalResults. + * @member {boolean} writeIncrementalResults + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + */ + JobConfigurationQuery.prototype.writeIncrementalResults = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfigurationQuery.prototype, "_systemVariables", { + get: $util.oneOfGetter($oneOfFields = ["systemVariables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobConfigurationQuery instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationQuery=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfigurationQuery} JobConfigurationQuery instance + */ + JobConfigurationQuery.create = function create(properties) { + return new JobConfigurationQuery(properties); + }; + + /** + * Encodes the specified JobConfigurationQuery message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationQuery} message JobConfigurationQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationQuery.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.destinationTable, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.userDefinedFunctionResources != null && message.userDefinedFunctionResources.length) + for (var i = 0; i < message.userDefinedFunctionResources.length; ++i) + $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.encode(message.userDefinedFunctionResources[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.createDisposition); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.writeDisposition); + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.defaultDataset, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.priority); + if (message.allowLargeResults != null && Object.hasOwnProperty.call(message, "allowLargeResults")) + $root.google.protobuf.BoolValue.encode(message.allowLargeResults, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) + $root.google.protobuf.BoolValue.encode(message.useQueryCache, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.flattenResults != null && Object.hasOwnProperty.call(message, "flattenResults")) + $root.google.protobuf.BoolValue.encode(message.flattenResults, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) + $root.google.protobuf.Int64Value.encode(message.maximumBytesBilled, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + $root.google.protobuf.BoolValue.encode(message.useLegacySql, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.parameterMode); + if (message.queryParameters != null && message.queryParameters.length) + for (var i = 0; i < message.queryParameters.length; ++i) + $root.google.cloud.bigquery.v2.QueryParameter.encode(message.queryParameters[i], writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.schemaUpdateOptions != null && message.schemaUpdateOptions.length) + for (var i = 0; i < message.schemaUpdateOptions.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.schemaUpdateOptions[i]); + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + $root.google.cloud.bigquery.v2.TimePartitioning.encode(message.timePartitioning, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + $root.google.cloud.bigquery.v2.Clustering.encode(message.clustering, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.destinationEncryptionConfiguration, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + $root.google.cloud.bigquery.v2.RangePartitioning.encode(message.rangePartitioning, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.externalTableDefinitions != null && Object.hasOwnProperty.call(message, "externalTableDefinitions")) + for (var keys = Object.keys(message.externalTableDefinitions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 23, wireType 2 =*/186).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.bigquery.v2.ExternalDataConfiguration.encode(message.externalTableDefinitions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + if (message.scriptOptions != null && Object.hasOwnProperty.call(message, "scriptOptions")) + $root.google.cloud.bigquery.v2.ScriptOptions.encode(message.scriptOptions, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.connectionProperties != null && message.connectionProperties.length) + for (var i = 0; i < message.connectionProperties.length; ++i) + $root.google.cloud.bigquery.v2.ConnectionProperty.encode(message.connectionProperties[i], writer.uint32(/* id 33, wireType 2 =*/266).fork(), q + 1).ldelim(); + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + $root.google.protobuf.BoolValue.encode(message.createSession, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + if (message.systemVariables != null && Object.hasOwnProperty.call(message, "systemVariables")) + $root.google.cloud.bigquery.v2.SystemVariables.encode(message.systemVariables, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); + if (message.continuous != null && Object.hasOwnProperty.call(message, "continuous")) + $root.google.protobuf.BoolValue.encode(message.continuous, writer.uint32(/* id 36, wireType 2 =*/290).fork(), q + 1).ldelim(); + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + writer.uint32(/* id 37, wireType 0 =*/296).bool(message.writeIncrementalResults); + return writer; + }; + + /** + * Encodes the specified JobConfigurationQuery message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationQuery} message JobConfigurationQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobConfigurationQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfigurationQuery} JobConfigurationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationQuery.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfigurationQuery(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + if (message.externalTableDefinitions === $util.emptyObject) + message.externalTableDefinitions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.externalTableDefinitions, key); + message.externalTableDefinitions[key] = value; + break; + } + case 4: { + if (!(message.userDefinedFunctionResources && message.userDefinedFunctionResources.length)) + message.userDefinedFunctionResources = []; + message.userDefinedFunctionResources.push($root.google.cloud.bigquery.v2.UserDefinedFunctionResource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.createDisposition = reader.string(); + break; + } + case 6: { + message.writeDisposition = reader.string(); + break; + } + case 7: { + message.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.priority = reader.string(); + break; + } + case 10: { + message.allowLargeResults = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.useQueryCache = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.flattenResults = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.maximumBytesBilled = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.useLegacySql = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.parameterMode = reader.string(); + break; + } + case 17: { + if (!(message.queryParameters && message.queryParameters.length)) + message.queryParameters = []; + message.queryParameters.push($root.google.cloud.bigquery.v2.QueryParameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 35: { + message.systemVariables = $root.google.cloud.bigquery.v2.SystemVariables.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + if (!(message.schemaUpdateOptions && message.schemaUpdateOptions.length)) + message.schemaUpdateOptions = []; + message.schemaUpdateOptions.push(reader.string()); + break; + } + case 19: { + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.clustering = $root.google.cloud.bigquery.v2.Clustering.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.scriptOptions = $root.google.cloud.bigquery.v2.ScriptOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + if (!(message.connectionProperties && message.connectionProperties.length)) + message.connectionProperties = []; + message.connectionProperties.push($root.google.cloud.bigquery.v2.ConnectionProperty.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 34: { + message.createSession = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 36: { + message.continuous = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + message.writeIncrementalResults = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfigurationQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfigurationQuery} JobConfigurationQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfigurationQuery message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfigurationQuery.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.destinationTable, long + 1); + if (error) + return "destinationTable." + error; + } + if (message.externalTableDefinitions != null && Object.hasOwnProperty.call(message, "externalTableDefinitions")) { + if (!$util.isObject(message.externalTableDefinitions)) + return "externalTableDefinitions: object expected"; + var key = Object.keys(message.externalTableDefinitions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.verify(message.externalTableDefinitions[key[i]], long + 1); + if (error) + return "externalTableDefinitions." + error; + } + } + if (message.userDefinedFunctionResources != null && Object.hasOwnProperty.call(message, "userDefinedFunctionResources")) { + if (!Array.isArray(message.userDefinedFunctionResources)) + return "userDefinedFunctionResources: array expected"; + for (var i = 0; i < message.userDefinedFunctionResources.length; ++i) { + var error = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.verify(message.userDefinedFunctionResources[i], long + 1); + if (error) + return "userDefinedFunctionResources." + error; + } + } + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + if (!$util.isString(message.createDisposition)) + return "createDisposition: string expected"; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.defaultDataset, long + 1); + if (error) + return "defaultDataset." + error; + } + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + if (!$util.isString(message.priority)) + return "priority: string expected"; + if (message.allowLargeResults != null && Object.hasOwnProperty.call(message, "allowLargeResults")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowLargeResults, long + 1); + if (error) + return "allowLargeResults." + error; + } + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) { + var error = $root.google.protobuf.BoolValue.verify(message.useQueryCache, long + 1); + if (error) + return "useQueryCache." + error; + } + if (message.flattenResults != null && Object.hasOwnProperty.call(message, "flattenResults")) { + var error = $root.google.protobuf.BoolValue.verify(message.flattenResults, long + 1); + if (error) + return "flattenResults." + error; + } + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) { + var error = $root.google.protobuf.Int64Value.verify(message.maximumBytesBilled, long + 1); + if (error) + return "maximumBytesBilled." + error; + } + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) { + var error = $root.google.protobuf.BoolValue.verify(message.useLegacySql, long + 1); + if (error) + return "useLegacySql." + error; + } + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + if (!$util.isString(message.parameterMode)) + return "parameterMode: string expected"; + if (message.queryParameters != null && Object.hasOwnProperty.call(message, "queryParameters")) { + if (!Array.isArray(message.queryParameters)) + return "queryParameters: array expected"; + for (var i = 0; i < message.queryParameters.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameter.verify(message.queryParameters[i], long + 1); + if (error) + return "queryParameters." + error; + } + } + if (message.systemVariables != null && Object.hasOwnProperty.call(message, "systemVariables")) { + properties._systemVariables = 1; + { + var error = $root.google.cloud.bigquery.v2.SystemVariables.verify(message.systemVariables, long + 1); + if (error) + return "systemVariables." + error; + } + } + if (message.schemaUpdateOptions != null && Object.hasOwnProperty.call(message, "schemaUpdateOptions")) { + if (!Array.isArray(message.schemaUpdateOptions)) + return "schemaUpdateOptions: array expected"; + for (var i = 0; i < message.schemaUpdateOptions.length; ++i) + if (!$util.isString(message.schemaUpdateOptions[i])) + return "schemaUpdateOptions: string[] expected"; + } + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) { + var error = $root.google.cloud.bigquery.v2.TimePartitioning.verify(message.timePartitioning, long + 1); + if (error) + return "timePartitioning." + error; + } + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) { + var error = $root.google.cloud.bigquery.v2.RangePartitioning.verify(message.rangePartitioning, long + 1); + if (error) + return "rangePartitioning." + error; + } + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) { + var error = $root.google.cloud.bigquery.v2.Clustering.verify(message.clustering, long + 1); + if (error) + return "clustering." + error; + } + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.destinationEncryptionConfiguration, long + 1); + if (error) + return "destinationEncryptionConfiguration." + error; + } + if (message.scriptOptions != null && Object.hasOwnProperty.call(message, "scriptOptions")) { + var error = $root.google.cloud.bigquery.v2.ScriptOptions.verify(message.scriptOptions, long + 1); + if (error) + return "scriptOptions." + error; + } + if (message.connectionProperties != null && Object.hasOwnProperty.call(message, "connectionProperties")) { + if (!Array.isArray(message.connectionProperties)) + return "connectionProperties: array expected"; + for (var i = 0; i < message.connectionProperties.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ConnectionProperty.verify(message.connectionProperties[i], long + 1); + if (error) + return "connectionProperties." + error; + } + } + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) { + var error = $root.google.protobuf.BoolValue.verify(message.createSession, long + 1); + if (error) + return "createSession." + error; + } + if (message.continuous != null && Object.hasOwnProperty.call(message, "continuous")) { + var error = $root.google.protobuf.BoolValue.verify(message.continuous, long + 1); + if (error) + return "continuous." + error; + } + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + if (typeof message.writeIncrementalResults !== "boolean") + return "writeIncrementalResults: boolean expected"; + return null; + }; + + /** + * Creates a JobConfigurationQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfigurationQuery} JobConfigurationQuery + */ + JobConfigurationQuery.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfigurationQuery) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfigurationQuery(); + if (object.query != null) + message.query = String(object.query); + if (object.destinationTable != null) { + if (!$util.isObject(object.destinationTable)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.destinationTable: object expected"); + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.destinationTable, long + 1); + } + if (object.externalTableDefinitions) { + if (!$util.isObject(object.externalTableDefinitions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.externalTableDefinitions: object expected"); + message.externalTableDefinitions = {}; + for (var keys = Object.keys(object.externalTableDefinitions), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.externalTableDefinitions, keys[i]); + if (!$util.isObject(object.externalTableDefinitions[keys[i]])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.externalTableDefinitions: object expected"); + message.externalTableDefinitions[keys[i]] = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.fromObject(object.externalTableDefinitions[keys[i]], long + 1); + } + } + if (object.userDefinedFunctionResources) { + if (!Array.isArray(object.userDefinedFunctionResources)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.userDefinedFunctionResources: array expected"); + message.userDefinedFunctionResources = []; + for (var i = 0; i < object.userDefinedFunctionResources.length; ++i) { + if (!$util.isObject(object.userDefinedFunctionResources[i])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.userDefinedFunctionResources: object expected"); + message.userDefinedFunctionResources[i] = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.fromObject(object.userDefinedFunctionResources[i], long + 1); + } + } + if (object.createDisposition != null) + message.createDisposition = String(object.createDisposition); + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + if (object.defaultDataset != null) { + if (!$util.isObject(object.defaultDataset)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.defaultDataset: object expected"); + message.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.defaultDataset, long + 1); + } + if (object.priority != null) + message.priority = String(object.priority); + if (object.allowLargeResults != null) { + if (!$util.isObject(object.allowLargeResults)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.allowLargeResults: object expected"); + message.allowLargeResults = $root.google.protobuf.BoolValue.fromObject(object.allowLargeResults, long + 1); + } + if (object.useQueryCache != null) { + if (!$util.isObject(object.useQueryCache)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.useQueryCache: object expected"); + message.useQueryCache = $root.google.protobuf.BoolValue.fromObject(object.useQueryCache, long + 1); + } + if (object.flattenResults != null) { + if (!$util.isObject(object.flattenResults)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.flattenResults: object expected"); + message.flattenResults = $root.google.protobuf.BoolValue.fromObject(object.flattenResults, long + 1); + } + if (object.maximumBytesBilled != null) { + if (!$util.isObject(object.maximumBytesBilled)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.maximumBytesBilled: object expected"); + message.maximumBytesBilled = $root.google.protobuf.Int64Value.fromObject(object.maximumBytesBilled, long + 1); + } + if (object.useLegacySql != null) { + if (!$util.isObject(object.useLegacySql)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.useLegacySql: object expected"); + message.useLegacySql = $root.google.protobuf.BoolValue.fromObject(object.useLegacySql, long + 1); + } + if (object.parameterMode != null) + message.parameterMode = String(object.parameterMode); + if (object.queryParameters) { + if (!Array.isArray(object.queryParameters)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.queryParameters: array expected"); + message.queryParameters = []; + for (var i = 0; i < object.queryParameters.length; ++i) { + if (!$util.isObject(object.queryParameters[i])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.queryParameters: object expected"); + message.queryParameters[i] = $root.google.cloud.bigquery.v2.QueryParameter.fromObject(object.queryParameters[i], long + 1); + } + } + if (object.systemVariables != null) { + if (!$util.isObject(object.systemVariables)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.systemVariables: object expected"); + message.systemVariables = $root.google.cloud.bigquery.v2.SystemVariables.fromObject(object.systemVariables, long + 1); + } + if (object.schemaUpdateOptions) { + if (!Array.isArray(object.schemaUpdateOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.schemaUpdateOptions: array expected"); + message.schemaUpdateOptions = []; + for (var i = 0; i < object.schemaUpdateOptions.length; ++i) + message.schemaUpdateOptions[i] = String(object.schemaUpdateOptions[i]); + } + if (object.timePartitioning != null) { + if (!$util.isObject(object.timePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.timePartitioning: object expected"); + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.fromObject(object.timePartitioning, long + 1); + } + if (object.rangePartitioning != null) { + if (!$util.isObject(object.rangePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.rangePartitioning: object expected"); + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.fromObject(object.rangePartitioning, long + 1); + } + if (object.clustering != null) { + if (!$util.isObject(object.clustering)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.clustering: object expected"); + message.clustering = $root.google.cloud.bigquery.v2.Clustering.fromObject(object.clustering, long + 1); + } + if (object.destinationEncryptionConfiguration != null) { + if (!$util.isObject(object.destinationEncryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.destinationEncryptionConfiguration: object expected"); + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.destinationEncryptionConfiguration, long + 1); + } + if (object.scriptOptions != null) { + if (!$util.isObject(object.scriptOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.scriptOptions: object expected"); + message.scriptOptions = $root.google.cloud.bigquery.v2.ScriptOptions.fromObject(object.scriptOptions, long + 1); + } + if (object.connectionProperties) { + if (!Array.isArray(object.connectionProperties)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.connectionProperties: array expected"); + message.connectionProperties = []; + for (var i = 0; i < object.connectionProperties.length; ++i) { + if (!$util.isObject(object.connectionProperties[i])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.connectionProperties: object expected"); + message.connectionProperties[i] = $root.google.cloud.bigquery.v2.ConnectionProperty.fromObject(object.connectionProperties[i], long + 1); + } + } + if (object.createSession != null) { + if (!$util.isObject(object.createSession)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.createSession: object expected"); + message.createSession = $root.google.protobuf.BoolValue.fromObject(object.createSession, long + 1); + } + if (object.continuous != null) { + if (!$util.isObject(object.continuous)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationQuery.continuous: object expected"); + message.continuous = $root.google.protobuf.BoolValue.fromObject(object.continuous, long + 1); + } + if (object.writeIncrementalResults != null) + message.writeIncrementalResults = Boolean(object.writeIncrementalResults); + return message; + }; + + /** + * Creates a plain object from a JobConfigurationQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationQuery} message JobConfigurationQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfigurationQuery.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.userDefinedFunctionResources = []; + object.queryParameters = []; + object.schemaUpdateOptions = []; + object.connectionProperties = []; + } + if (options.objects || options.defaults) + object.externalTableDefinitions = {}; + if (options.defaults) { + object.query = ""; + object.destinationTable = null; + object.createDisposition = ""; + object.writeDisposition = ""; + object.defaultDataset = null; + object.priority = ""; + object.allowLargeResults = null; + object.useQueryCache = null; + object.flattenResults = null; + object.maximumBytesBilled = null; + object.useLegacySql = null; + object.parameterMode = ""; + object.timePartitioning = null; + object.clustering = null; + object.destinationEncryptionConfiguration = null; + object.rangePartitioning = null; + object.scriptOptions = null; + object.createSession = null; + object.continuous = null; + object.writeIncrementalResults = false; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = message.query; + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + object.destinationTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.destinationTable, options, q + 1); + if (message.userDefinedFunctionResources && message.userDefinedFunctionResources.length) { + object.userDefinedFunctionResources = []; + for (var j = 0; j < message.userDefinedFunctionResources.length; ++j) + object.userDefinedFunctionResources[j] = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.toObject(message.userDefinedFunctionResources[j], options, q + 1); + } + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + object.createDisposition = message.createDisposition; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + object.writeDisposition = message.writeDisposition; + if (message.defaultDataset != null && Object.hasOwnProperty.call(message, "defaultDataset")) + object.defaultDataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.defaultDataset, options, q + 1); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + object.priority = message.priority; + if (message.allowLargeResults != null && Object.hasOwnProperty.call(message, "allowLargeResults")) + object.allowLargeResults = $root.google.protobuf.BoolValue.toObject(message.allowLargeResults, options, q + 1); + if (message.useQueryCache != null && Object.hasOwnProperty.call(message, "useQueryCache")) + object.useQueryCache = $root.google.protobuf.BoolValue.toObject(message.useQueryCache, options, q + 1); + if (message.flattenResults != null && Object.hasOwnProperty.call(message, "flattenResults")) + object.flattenResults = $root.google.protobuf.BoolValue.toObject(message.flattenResults, options, q + 1); + if (message.maximumBytesBilled != null && Object.hasOwnProperty.call(message, "maximumBytesBilled")) + object.maximumBytesBilled = $root.google.protobuf.Int64Value.toObject(message.maximumBytesBilled, options, q + 1); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + object.useLegacySql = $root.google.protobuf.BoolValue.toObject(message.useLegacySql, options, q + 1); + if (message.parameterMode != null && Object.hasOwnProperty.call(message, "parameterMode")) + object.parameterMode = message.parameterMode; + if (message.queryParameters && message.queryParameters.length) { + object.queryParameters = []; + for (var j = 0; j < message.queryParameters.length; ++j) + object.queryParameters[j] = $root.google.cloud.bigquery.v2.QueryParameter.toObject(message.queryParameters[j], options, q + 1); + } + if (message.schemaUpdateOptions && message.schemaUpdateOptions.length) { + object.schemaUpdateOptions = []; + for (var j = 0; j < message.schemaUpdateOptions.length; ++j) + object.schemaUpdateOptions[j] = message.schemaUpdateOptions[j]; + } + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + object.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.toObject(message.timePartitioning, options, q + 1); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + object.clustering = $root.google.cloud.bigquery.v2.Clustering.toObject(message.clustering, options, q + 1); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + object.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.destinationEncryptionConfiguration, options, q + 1); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + object.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.toObject(message.rangePartitioning, options, q + 1); + var keys2; + if (message.externalTableDefinitions && (keys2 = Object.keys(message.externalTableDefinitions)).length) { + object.externalTableDefinitions = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.externalTableDefinitions, keys2[j]); + object.externalTableDefinitions[keys2[j]] = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.toObject(message.externalTableDefinitions[keys2[j]], options, q + 1); + } + } + if (message.scriptOptions != null && Object.hasOwnProperty.call(message, "scriptOptions")) + object.scriptOptions = $root.google.cloud.bigquery.v2.ScriptOptions.toObject(message.scriptOptions, options, q + 1); + if (message.connectionProperties && message.connectionProperties.length) { + object.connectionProperties = []; + for (var j = 0; j < message.connectionProperties.length; ++j) + object.connectionProperties[j] = $root.google.cloud.bigquery.v2.ConnectionProperty.toObject(message.connectionProperties[j], options, q + 1); + } + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + object.createSession = $root.google.protobuf.BoolValue.toObject(message.createSession, options, q + 1); + if (message.systemVariables != null && Object.hasOwnProperty.call(message, "systemVariables")) { + object.systemVariables = $root.google.cloud.bigquery.v2.SystemVariables.toObject(message.systemVariables, options, q + 1); + if (options.oneofs) + object._systemVariables = "systemVariables"; + } + if (message.continuous != null && Object.hasOwnProperty.call(message, "continuous")) + object.continuous = $root.google.protobuf.BoolValue.toObject(message.continuous, options, q + 1); + if (message.writeIncrementalResults != null && Object.hasOwnProperty.call(message, "writeIncrementalResults")) + object.writeIncrementalResults = message.writeIncrementalResults; + return object; + }; + + /** + * Converts this JobConfigurationQuery to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @instance + * @returns {Object.} JSON object + */ + JobConfigurationQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfigurationQuery + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfigurationQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfigurationQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfigurationQuery"; + }; + + return JobConfigurationQuery; + })(); + + v2.ScriptOptions = (function() { + + /** + * Properties of a ScriptOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IScriptOptions + * @property {google.protobuf.IInt64Value|null} [statementTimeoutMs] ScriptOptions statementTimeoutMs + * @property {google.protobuf.IInt64Value|null} [statementByteBudget] ScriptOptions statementByteBudget + * @property {google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind|null} [keyResultStatement] ScriptOptions keyResultStatement + */ + + /** + * Constructs a new ScriptOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ScriptOptions. + * @implements IScriptOptions + * @constructor + * @param {google.cloud.bigquery.v2.IScriptOptions=} [properties] Properties to set + */ + function ScriptOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScriptOptions statementTimeoutMs. + * @member {google.protobuf.IInt64Value|null|undefined} statementTimeoutMs + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @instance + */ + ScriptOptions.prototype.statementTimeoutMs = null; + + /** + * ScriptOptions statementByteBudget. + * @member {google.protobuf.IInt64Value|null|undefined} statementByteBudget + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @instance + */ + ScriptOptions.prototype.statementByteBudget = null; + + /** + * ScriptOptions keyResultStatement. + * @member {google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind} keyResultStatement + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @instance + */ + ScriptOptions.prototype.keyResultStatement = 0; + + /** + * Creates a new ScriptOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {google.cloud.bigquery.v2.IScriptOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ScriptOptions} ScriptOptions instance + */ + ScriptOptions.create = function create(properties) { + return new ScriptOptions(properties); + }; + + /** + * Encodes the specified ScriptOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {google.cloud.bigquery.v2.IScriptOptions} message ScriptOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.statementTimeoutMs != null && Object.hasOwnProperty.call(message, "statementTimeoutMs")) + $root.google.protobuf.Int64Value.encode(message.statementTimeoutMs, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.statementByteBudget != null && Object.hasOwnProperty.call(message, "statementByteBudget")) + $root.google.protobuf.Int64Value.encode(message.statementByteBudget, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.keyResultStatement != null && Object.hasOwnProperty.call(message, "keyResultStatement")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.keyResultStatement); + return writer; + }; + + /** + * Encodes the specified ScriptOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {google.cloud.bigquery.v2.IScriptOptions} message ScriptOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ScriptOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ScriptOptions} ScriptOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ScriptOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.statementTimeoutMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.statementByteBudget = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.keyResultStatement = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ScriptOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ScriptOptions} ScriptOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScriptOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScriptOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.statementTimeoutMs != null && Object.hasOwnProperty.call(message, "statementTimeoutMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.statementTimeoutMs, long + 1); + if (error) + return "statementTimeoutMs." + error; + } + if (message.statementByteBudget != null && Object.hasOwnProperty.call(message, "statementByteBudget")) { + var error = $root.google.protobuf.Int64Value.verify(message.statementByteBudget, long + 1); + if (error) + return "statementByteBudget." + error; + } + if (message.keyResultStatement != null && Object.hasOwnProperty.call(message, "keyResultStatement")) + switch (message.keyResultStatement) { + default: + return "keyResultStatement: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ScriptOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ScriptOptions} ScriptOptions + */ + ScriptOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ScriptOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ScriptOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ScriptOptions(); + if (object.statementTimeoutMs != null) { + if (!$util.isObject(object.statementTimeoutMs)) + throw TypeError(".google.cloud.bigquery.v2.ScriptOptions.statementTimeoutMs: object expected"); + message.statementTimeoutMs = $root.google.protobuf.Int64Value.fromObject(object.statementTimeoutMs, long + 1); + } + if (object.statementByteBudget != null) { + if (!$util.isObject(object.statementByteBudget)) + throw TypeError(".google.cloud.bigquery.v2.ScriptOptions.statementByteBudget: object expected"); + message.statementByteBudget = $root.google.protobuf.Int64Value.fromObject(object.statementByteBudget, long + 1); + } + switch (object.keyResultStatement) { + default: + if (typeof object.keyResultStatement === "number") { + message.keyResultStatement = object.keyResultStatement; + break; + } + break; + case "KEY_RESULT_STATEMENT_KIND_UNSPECIFIED": + case 0: + message.keyResultStatement = 0; + break; + case "LAST": + case 1: + message.keyResultStatement = 1; + break; + case "FIRST_SELECT": + case 2: + message.keyResultStatement = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScriptOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {google.cloud.bigquery.v2.ScriptOptions} message ScriptOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScriptOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.statementTimeoutMs = null; + object.statementByteBudget = null; + object.keyResultStatement = options.enums === String ? "KEY_RESULT_STATEMENT_KIND_UNSPECIFIED" : 0; + } + if (message.statementTimeoutMs != null && Object.hasOwnProperty.call(message, "statementTimeoutMs")) + object.statementTimeoutMs = $root.google.protobuf.Int64Value.toObject(message.statementTimeoutMs, options, q + 1); + if (message.statementByteBudget != null && Object.hasOwnProperty.call(message, "statementByteBudget")) + object.statementByteBudget = $root.google.protobuf.Int64Value.toObject(message.statementByteBudget, options, q + 1); + if (message.keyResultStatement != null && Object.hasOwnProperty.call(message, "keyResultStatement")) + object.keyResultStatement = options.enums === String ? $root.google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind[message.keyResultStatement] === undefined ? message.keyResultStatement : $root.google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind[message.keyResultStatement] : message.keyResultStatement; + return object; + }; + + /** + * Converts this ScriptOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @instance + * @returns {Object.} JSON object + */ + ScriptOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScriptOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ScriptOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScriptOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ScriptOptions"; + }; + + /** + * KeyResultStatementKind enum. + * @name google.cloud.bigquery.v2.ScriptOptions.KeyResultStatementKind + * @enum {number} + * @property {number} KEY_RESULT_STATEMENT_KIND_UNSPECIFIED=0 KEY_RESULT_STATEMENT_KIND_UNSPECIFIED value + * @property {number} LAST=1 LAST value + * @property {number} FIRST_SELECT=2 FIRST_SELECT value + */ + ScriptOptions.KeyResultStatementKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_RESULT_STATEMENT_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "LAST"] = 1; + values[valuesById[2] = "FIRST_SELECT"] = 2; + return values; + })(); + + return ScriptOptions; + })(); + + v2.JobConfigurationLoad = (function() { + + /** + * Properties of a JobConfigurationLoad. + * @memberof google.cloud.bigquery.v2 + * @interface IJobConfigurationLoad + * @property {Array.|null} [sourceUris] JobConfigurationLoad sourceUris + * @property {google.cloud.bigquery.v2.FileSetSpecType|null} [fileSetSpecType] JobConfigurationLoad fileSetSpecType + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] JobConfigurationLoad schema + * @property {google.cloud.bigquery.v2.ITableReference|null} [destinationTable] JobConfigurationLoad destinationTable + * @property {google.cloud.bigquery.v2.IDestinationTableProperties|null} [destinationTableProperties] JobConfigurationLoad destinationTableProperties + * @property {string|null} [createDisposition] JobConfigurationLoad createDisposition + * @property {string|null} [writeDisposition] JobConfigurationLoad writeDisposition + * @property {google.protobuf.IStringValue|null} [nullMarker] JobConfigurationLoad nullMarker + * @property {string|null} [fieldDelimiter] JobConfigurationLoad fieldDelimiter + * @property {google.protobuf.IInt32Value|null} [skipLeadingRows] JobConfigurationLoad skipLeadingRows + * @property {string|null} [encoding] JobConfigurationLoad encoding + * @property {google.protobuf.IStringValue|null} [quote] JobConfigurationLoad quote + * @property {google.protobuf.IInt32Value|null} [maxBadRecords] JobConfigurationLoad maxBadRecords + * @property {google.protobuf.IBoolValue|null} [allowQuotedNewlines] JobConfigurationLoad allowQuotedNewlines + * @property {string|null} [sourceFormat] JobConfigurationLoad sourceFormat + * @property {google.protobuf.IBoolValue|null} [allowJaggedRows] JobConfigurationLoad allowJaggedRows + * @property {google.protobuf.IBoolValue|null} [ignoreUnknownValues] JobConfigurationLoad ignoreUnknownValues + * @property {Array.|null} [projectionFields] JobConfigurationLoad projectionFields + * @property {google.protobuf.IBoolValue|null} [autodetect] JobConfigurationLoad autodetect + * @property {Array.|null} [schemaUpdateOptions] JobConfigurationLoad schemaUpdateOptions + * @property {google.cloud.bigquery.v2.ITimePartitioning|null} [timePartitioning] JobConfigurationLoad timePartitioning + * @property {google.cloud.bigquery.v2.IRangePartitioning|null} [rangePartitioning] JobConfigurationLoad rangePartitioning + * @property {google.cloud.bigquery.v2.IClustering|null} [clustering] JobConfigurationLoad clustering + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [destinationEncryptionConfiguration] JobConfigurationLoad destinationEncryptionConfiguration + * @property {google.protobuf.IBoolValue|null} [useAvroLogicalTypes] JobConfigurationLoad useAvroLogicalTypes + * @property {google.protobuf.IStringValue|null} [referenceFileSchemaUri] JobConfigurationLoad referenceFileSchemaUri + * @property {google.cloud.bigquery.v2.IHivePartitioningOptions|null} [hivePartitioningOptions] JobConfigurationLoad hivePartitioningOptions + * @property {Array.|null} [decimalTargetTypes] JobConfigurationLoad decimalTargetTypes + * @property {google.cloud.bigquery.v2.JsonExtension|null} [jsonExtension] JobConfigurationLoad jsonExtension + * @property {google.cloud.bigquery.v2.IParquetOptions|null} [parquetOptions] JobConfigurationLoad parquetOptions + * @property {google.protobuf.IBoolValue|null} [preserveAsciiControlCharacters] JobConfigurationLoad preserveAsciiControlCharacters + * @property {Array.|null} [connectionProperties] JobConfigurationLoad connectionProperties + * @property {google.protobuf.IBoolValue|null} [createSession] JobConfigurationLoad createSession + * @property {google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap|null} [columnNameCharacterMap] JobConfigurationLoad columnNameCharacterMap + * @property {google.protobuf.IBoolValue|null} [copyFilesOnly] JobConfigurationLoad copyFilesOnly + * @property {google.protobuf.IStringValue|null} [timeZone] JobConfigurationLoad timeZone + * @property {Array.|null} [nullMarkers] JobConfigurationLoad nullMarkers + * @property {string|null} [dateFormat] JobConfigurationLoad dateFormat + * @property {string|null} [datetimeFormat] JobConfigurationLoad datetimeFormat + * @property {string|null} [timeFormat] JobConfigurationLoad timeFormat + * @property {string|null} [timestampFormat] JobConfigurationLoad timestampFormat + * @property {google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch|null} [sourceColumnMatch] JobConfigurationLoad sourceColumnMatch + * @property {Array.|null} [timestampTargetPrecision] JobConfigurationLoad timestampTargetPrecision + */ + + /** + * Constructs a new JobConfigurationLoad. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobConfigurationLoad. + * @implements IJobConfigurationLoad + * @constructor + * @param {google.cloud.bigquery.v2.IJobConfigurationLoad=} [properties] Properties to set + */ + function JobConfigurationLoad(properties) { + this.sourceUris = []; + this.projectionFields = []; + this.schemaUpdateOptions = []; + this.decimalTargetTypes = []; + this.connectionProperties = []; + this.nullMarkers = []; + this.timestampTargetPrecision = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfigurationLoad sourceUris. + * @member {Array.} sourceUris + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.sourceUris = $util.emptyArray; + + /** + * JobConfigurationLoad fileSetSpecType. + * @member {google.cloud.bigquery.v2.FileSetSpecType} fileSetSpecType + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.fileSetSpecType = 0; + + /** + * JobConfigurationLoad schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.schema = null; + + /** + * JobConfigurationLoad destinationTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} destinationTable + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.destinationTable = null; + + /** + * JobConfigurationLoad destinationTableProperties. + * @member {google.cloud.bigquery.v2.IDestinationTableProperties|null|undefined} destinationTableProperties + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.destinationTableProperties = null; + + /** + * JobConfigurationLoad createDisposition. + * @member {string} createDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.createDisposition = ""; + + /** + * JobConfigurationLoad writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.writeDisposition = ""; + + /** + * JobConfigurationLoad nullMarker. + * @member {google.protobuf.IStringValue|null|undefined} nullMarker + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.nullMarker = null; + + /** + * JobConfigurationLoad fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.fieldDelimiter = ""; + + /** + * JobConfigurationLoad skipLeadingRows. + * @member {google.protobuf.IInt32Value|null|undefined} skipLeadingRows + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.skipLeadingRows = null; + + /** + * JobConfigurationLoad encoding. + * @member {string} encoding + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.encoding = ""; + + /** + * JobConfigurationLoad quote. + * @member {google.protobuf.IStringValue|null|undefined} quote + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.quote = null; + + /** + * JobConfigurationLoad maxBadRecords. + * @member {google.protobuf.IInt32Value|null|undefined} maxBadRecords + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.maxBadRecords = null; + + /** + * JobConfigurationLoad allowQuotedNewlines. + * @member {google.protobuf.IBoolValue|null|undefined} allowQuotedNewlines + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.allowQuotedNewlines = null; + + /** + * JobConfigurationLoad sourceFormat. + * @member {string} sourceFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.sourceFormat = ""; + + /** + * JobConfigurationLoad allowJaggedRows. + * @member {google.protobuf.IBoolValue|null|undefined} allowJaggedRows + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.allowJaggedRows = null; + + /** + * JobConfigurationLoad ignoreUnknownValues. + * @member {google.protobuf.IBoolValue|null|undefined} ignoreUnknownValues + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.ignoreUnknownValues = null; + + /** + * JobConfigurationLoad projectionFields. + * @member {Array.} projectionFields + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.projectionFields = $util.emptyArray; + + /** + * JobConfigurationLoad autodetect. + * @member {google.protobuf.IBoolValue|null|undefined} autodetect + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.autodetect = null; + + /** + * JobConfigurationLoad schemaUpdateOptions. + * @member {Array.} schemaUpdateOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.schemaUpdateOptions = $util.emptyArray; + + /** + * JobConfigurationLoad timePartitioning. + * @member {google.cloud.bigquery.v2.ITimePartitioning|null|undefined} timePartitioning + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.timePartitioning = null; + + /** + * JobConfigurationLoad rangePartitioning. + * @member {google.cloud.bigquery.v2.IRangePartitioning|null|undefined} rangePartitioning + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.rangePartitioning = null; + + /** + * JobConfigurationLoad clustering. + * @member {google.cloud.bigquery.v2.IClustering|null|undefined} clustering + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.clustering = null; + + /** + * JobConfigurationLoad destinationEncryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} destinationEncryptionConfiguration + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.destinationEncryptionConfiguration = null; + + /** + * JobConfigurationLoad useAvroLogicalTypes. + * @member {google.protobuf.IBoolValue|null|undefined} useAvroLogicalTypes + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.useAvroLogicalTypes = null; + + /** + * JobConfigurationLoad referenceFileSchemaUri. + * @member {google.protobuf.IStringValue|null|undefined} referenceFileSchemaUri + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.referenceFileSchemaUri = null; + + /** + * JobConfigurationLoad hivePartitioningOptions. + * @member {google.cloud.bigquery.v2.IHivePartitioningOptions|null|undefined} hivePartitioningOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.hivePartitioningOptions = null; + + /** + * JobConfigurationLoad decimalTargetTypes. + * @member {Array.} decimalTargetTypes + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.decimalTargetTypes = $util.emptyArray; + + /** + * JobConfigurationLoad jsonExtension. + * @member {google.cloud.bigquery.v2.JsonExtension} jsonExtension + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.jsonExtension = 0; + + /** + * JobConfigurationLoad parquetOptions. + * @member {google.cloud.bigquery.v2.IParquetOptions|null|undefined} parquetOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.parquetOptions = null; + + /** + * JobConfigurationLoad preserveAsciiControlCharacters. + * @member {google.protobuf.IBoolValue|null|undefined} preserveAsciiControlCharacters + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.preserveAsciiControlCharacters = null; + + /** + * JobConfigurationLoad connectionProperties. + * @member {Array.} connectionProperties + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.connectionProperties = $util.emptyArray; + + /** + * JobConfigurationLoad createSession. + * @member {google.protobuf.IBoolValue|null|undefined} createSession + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.createSession = null; + + /** + * JobConfigurationLoad columnNameCharacterMap. + * @member {google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap} columnNameCharacterMap + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.columnNameCharacterMap = 0; + + /** + * JobConfigurationLoad copyFilesOnly. + * @member {google.protobuf.IBoolValue|null|undefined} copyFilesOnly + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.copyFilesOnly = null; + + /** + * JobConfigurationLoad timeZone. + * @member {google.protobuf.IStringValue|null|undefined} timeZone + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.timeZone = null; + + /** + * JobConfigurationLoad nullMarkers. + * @member {Array.} nullMarkers + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.nullMarkers = $util.emptyArray; + + /** + * JobConfigurationLoad dateFormat. + * @member {string|null|undefined} dateFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.dateFormat = null; + + /** + * JobConfigurationLoad datetimeFormat. + * @member {string|null|undefined} datetimeFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.datetimeFormat = null; + + /** + * JobConfigurationLoad timeFormat. + * @member {string|null|undefined} timeFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.timeFormat = null; + + /** + * JobConfigurationLoad timestampFormat. + * @member {string|null|undefined} timestampFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.timestampFormat = null; + + /** + * JobConfigurationLoad sourceColumnMatch. + * @member {google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch} sourceColumnMatch + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.sourceColumnMatch = 0; + + /** + * JobConfigurationLoad timestampTargetPrecision. + * @member {Array.} timestampTargetPrecision + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + */ + JobConfigurationLoad.prototype.timestampTargetPrecision = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfigurationLoad.prototype, "_dateFormat", { + get: $util.oneOfGetter($oneOfFields = ["dateFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfigurationLoad.prototype, "_datetimeFormat", { + get: $util.oneOfGetter($oneOfFields = ["datetimeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfigurationLoad.prototype, "_timeFormat", { + get: $util.oneOfGetter($oneOfFields = ["timeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfigurationLoad.prototype, "_timestampFormat", { + get: $util.oneOfGetter($oneOfFields = ["timestampFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobConfigurationLoad instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationLoad=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfigurationLoad} JobConfigurationLoad instance + */ + JobConfigurationLoad.create = function create(properties) { + return new JobConfigurationLoad(properties); + }; + + /** + * Encodes the specified JobConfigurationLoad message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationLoad.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationLoad} message JobConfigurationLoad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationLoad.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceUris != null && message.sourceUris.length) + for (var i = 0; i < message.sourceUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceUris[i]); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.destinationTable, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.destinationTableProperties != null && Object.hasOwnProperty.call(message, "destinationTableProperties")) + $root.google.cloud.bigquery.v2.DestinationTableProperties.encode(message.destinationTableProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.createDisposition); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.writeDisposition); + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) + $root.google.protobuf.StringValue.encode(message.nullMarker, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fieldDelimiter); + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + $root.google.protobuf.Int32Value.encode(message.skipLeadingRows, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.encoding); + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + $root.google.protobuf.StringValue.encode(message.quote, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) + $root.google.protobuf.Int32Value.encode(message.maxBadRecords, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) + $root.google.protobuf.BoolValue.encode(message.allowQuotedNewlines, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.sourceFormat); + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) + $root.google.protobuf.BoolValue.encode(message.allowJaggedRows, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) + $root.google.protobuf.BoolValue.encode(message.ignoreUnknownValues, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.projectionFields != null && message.projectionFields.length) + for (var i = 0; i < message.projectionFields.length; ++i) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.projectionFields[i]); + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) + $root.google.protobuf.BoolValue.encode(message.autodetect, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.schemaUpdateOptions != null && message.schemaUpdateOptions.length) + for (var i = 0; i < message.schemaUpdateOptions.length; ++i) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.schemaUpdateOptions[i]); + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + $root.google.cloud.bigquery.v2.TimePartitioning.encode(message.timePartitioning, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + $root.google.cloud.bigquery.v2.Clustering.encode(message.clustering, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.destinationEncryptionConfiguration, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + $root.google.protobuf.BoolValue.encode(message.useAvroLogicalTypes, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + $root.google.cloud.bigquery.v2.RangePartitioning.encode(message.rangePartitioning, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) + $root.google.cloud.bigquery.v2.HivePartitioningOptions.encode(message.hivePartitioningOptions, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); + if (message.decimalTargetTypes != null && message.decimalTargetTypes.length) { + writer.uint32(/* id 39, wireType 2 =*/314).fork(); + for (var i = 0; i < message.decimalTargetTypes.length; ++i) + writer.int32(message.decimalTargetTypes[i]); + writer.ldelim(); + } + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + writer.uint32(/* id 41, wireType 0 =*/328).int32(message.jsonExtension); + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) + $root.google.cloud.bigquery.v2.ParquetOptions.encode(message.parquetOptions, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) + $root.google.protobuf.BoolValue.encode(message.preserveAsciiControlCharacters, writer.uint32(/* id 44, wireType 2 =*/354).fork(), q + 1).ldelim(); + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) + $root.google.protobuf.StringValue.encode(message.referenceFileSchemaUri, writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); + if (message.connectionProperties != null && message.connectionProperties.length) + for (var i = 0; i < message.connectionProperties.length; ++i) + $root.google.cloud.bigquery.v2.ConnectionProperty.encode(message.connectionProperties[i], writer.uint32(/* id 46, wireType 2 =*/370).fork(), q + 1).ldelim(); + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + $root.google.protobuf.BoolValue.encode(message.createSession, writer.uint32(/* id 47, wireType 2 =*/378).fork(), q + 1).ldelim(); + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + writer.uint32(/* id 49, wireType 0 =*/392).int32(message.fileSetSpecType); + if (message.columnNameCharacterMap != null && Object.hasOwnProperty.call(message, "columnNameCharacterMap")) + writer.uint32(/* id 50, wireType 0 =*/400).int32(message.columnNameCharacterMap); + if (message.copyFilesOnly != null && Object.hasOwnProperty.call(message, "copyFilesOnly")) + $root.google.protobuf.BoolValue.encode(message.copyFilesOnly, writer.uint32(/* id 51, wireType 2 =*/410).fork(), q + 1).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.protobuf.StringValue.encode(message.timeZone, writer.uint32(/* id 52, wireType 2 =*/418).fork(), q + 1).ldelim(); + if (message.nullMarkers != null && message.nullMarkers.length) + for (var i = 0; i < message.nullMarkers.length; ++i) + writer.uint32(/* id 53, wireType 2 =*/426).string(message.nullMarkers[i]); + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) + writer.uint32(/* id 54, wireType 2 =*/434).string(message.dateFormat); + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) + writer.uint32(/* id 55, wireType 2 =*/442).string(message.datetimeFormat); + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) + writer.uint32(/* id 56, wireType 2 =*/450).string(message.timeFormat); + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) + writer.uint32(/* id 57, wireType 2 =*/458).string(message.timestampFormat); + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + writer.uint32(/* id 58, wireType 0 =*/464).int32(message.sourceColumnMatch); + if (message.timestampTargetPrecision != null && message.timestampTargetPrecision.length) { + writer.uint32(/* id 59, wireType 2 =*/474).fork(); + for (var i = 0; i < message.timestampTargetPrecision.length; ++i) + writer.int32(message.timestampTargetPrecision[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified JobConfigurationLoad message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationLoad.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationLoad} message JobConfigurationLoad message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationLoad.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobConfigurationLoad message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfigurationLoad} JobConfigurationLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationLoad.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfigurationLoad(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sourceUris && message.sourceUris.length)) + message.sourceUris = []; + message.sourceUris.push(reader.string()); + break; + } + case 49: { + message.fileSetSpecType = reader.int32(); + break; + } + case 2: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.destinationTableProperties = $root.google.cloud.bigquery.v2.DestinationTableProperties.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.createDisposition = reader.string(); + break; + } + case 6: { + message.writeDisposition = reader.string(); + break; + } + case 7: { + message.nullMarker = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.fieldDelimiter = reader.string(); + break; + } + case 9: { + message.skipLeadingRows = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.encoding = reader.string(); + break; + } + case 11: { + message.quote = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.maxBadRecords = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.allowQuotedNewlines = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.sourceFormat = reader.string(); + break; + } + case 17: { + message.allowJaggedRows = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.ignoreUnknownValues = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + if (!(message.projectionFields && message.projectionFields.length)) + message.projectionFields = []; + message.projectionFields.push(reader.string()); + break; + } + case 20: { + message.autodetect = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + if (!(message.schemaUpdateOptions && message.schemaUpdateOptions.length)) + message.schemaUpdateOptions = []; + message.schemaUpdateOptions.push(reader.string()); + break; + } + case 22: { + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.clustering = $root.google.cloud.bigquery.v2.Clustering.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 45: { + message.referenceFileSchemaUri = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + message.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 39: { + if (!(message.decimalTargetTypes && message.decimalTargetTypes.length)) + message.decimalTargetTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.decimalTargetTypes.push(reader.int32()); + } else + message.decimalTargetTypes.push(reader.int32()); + break; + } + case 41: { + message.jsonExtension = reader.int32(); + break; + } + case 42: { + message.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 44: { + message.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 46: { + if (!(message.connectionProperties && message.connectionProperties.length)) + message.connectionProperties = []; + message.connectionProperties.push($root.google.cloud.bigquery.v2.ConnectionProperty.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 47: { + message.createSession = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 50: { + message.columnNameCharacterMap = reader.int32(); + break; + } + case 51: { + message.copyFilesOnly = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 52: { + message.timeZone = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 53: { + if (!(message.nullMarkers && message.nullMarkers.length)) + message.nullMarkers = []; + message.nullMarkers.push(reader.string()); + break; + } + case 54: { + message.dateFormat = reader.string(); + break; + } + case 55: { + message.datetimeFormat = reader.string(); + break; + } + case 56: { + message.timeFormat = reader.string(); + break; + } + case 57: { + message.timestampFormat = reader.string(); + break; + } + case 58: { + message.sourceColumnMatch = reader.int32(); + break; + } + case 59: { + if (!(message.timestampTargetPrecision && message.timestampTargetPrecision.length)) + message.timestampTargetPrecision = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.timestampTargetPrecision.push(reader.int32()); + } else + message.timestampTargetPrecision.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfigurationLoad message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfigurationLoad} JobConfigurationLoad + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationLoad.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfigurationLoad message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfigurationLoad.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.sourceUris != null && Object.hasOwnProperty.call(message, "sourceUris")) { + if (!Array.isArray(message.sourceUris)) + return "sourceUris: array expected"; + for (var i = 0; i < message.sourceUris.length; ++i) + if (!$util.isString(message.sourceUris[i])) + return "sourceUris: string[] expected"; + } + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + switch (message.fileSetSpecType) { + default: + return "fileSetSpecType: enum value expected"; + case 0: + case 1: + break; + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.destinationTable, long + 1); + if (error) + return "destinationTable." + error; + } + if (message.destinationTableProperties != null && Object.hasOwnProperty.call(message, "destinationTableProperties")) { + var error = $root.google.cloud.bigquery.v2.DestinationTableProperties.verify(message.destinationTableProperties, long + 1); + if (error) + return "destinationTableProperties." + error; + } + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + if (!$util.isString(message.createDisposition)) + return "createDisposition: string expected"; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) { + var error = $root.google.protobuf.StringValue.verify(message.nullMarker, long + 1); + if (error) + return "nullMarker." + error; + } + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) { + var error = $root.google.protobuf.Int32Value.verify(message.skipLeadingRows, long + 1); + if (error) + return "skipLeadingRows." + error; + } + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + if (!$util.isString(message.encoding)) + return "encoding: string expected"; + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) { + var error = $root.google.protobuf.StringValue.verify(message.quote, long + 1); + if (error) + return "quote." + error; + } + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) { + var error = $root.google.protobuf.Int32Value.verify(message.maxBadRecords, long + 1); + if (error) + return "maxBadRecords." + error; + } + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowQuotedNewlines, long + 1); + if (error) + return "allowQuotedNewlines." + error; + } + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + if (!$util.isString(message.sourceFormat)) + return "sourceFormat: string expected"; + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowJaggedRows, long + 1); + if (error) + return "allowJaggedRows." + error; + } + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) { + var error = $root.google.protobuf.BoolValue.verify(message.ignoreUnknownValues, long + 1); + if (error) + return "ignoreUnknownValues." + error; + } + if (message.projectionFields != null && Object.hasOwnProperty.call(message, "projectionFields")) { + if (!Array.isArray(message.projectionFields)) + return "projectionFields: array expected"; + for (var i = 0; i < message.projectionFields.length; ++i) + if (!$util.isString(message.projectionFields[i])) + return "projectionFields: string[] expected"; + } + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) { + var error = $root.google.protobuf.BoolValue.verify(message.autodetect, long + 1); + if (error) + return "autodetect." + error; + } + if (message.schemaUpdateOptions != null && Object.hasOwnProperty.call(message, "schemaUpdateOptions")) { + if (!Array.isArray(message.schemaUpdateOptions)) + return "schemaUpdateOptions: array expected"; + for (var i = 0; i < message.schemaUpdateOptions.length; ++i) + if (!$util.isString(message.schemaUpdateOptions[i])) + return "schemaUpdateOptions: string[] expected"; + } + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) { + var error = $root.google.cloud.bigquery.v2.TimePartitioning.verify(message.timePartitioning, long + 1); + if (error) + return "timePartitioning." + error; + } + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) { + var error = $root.google.cloud.bigquery.v2.RangePartitioning.verify(message.rangePartitioning, long + 1); + if (error) + return "rangePartitioning." + error; + } + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) { + var error = $root.google.cloud.bigquery.v2.Clustering.verify(message.clustering, long + 1); + if (error) + return "clustering." + error; + } + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.destinationEncryptionConfiguration, long + 1); + if (error) + return "destinationEncryptionConfiguration." + error; + } + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) { + var error = $root.google.protobuf.BoolValue.verify(message.useAvroLogicalTypes, long + 1); + if (error) + return "useAvroLogicalTypes." + error; + } + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) { + var error = $root.google.protobuf.StringValue.verify(message.referenceFileSchemaUri, long + 1); + if (error) + return "referenceFileSchemaUri." + error; + } + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) { + var error = $root.google.cloud.bigquery.v2.HivePartitioningOptions.verify(message.hivePartitioningOptions, long + 1); + if (error) + return "hivePartitioningOptions." + error; + } + if (message.decimalTargetTypes != null && Object.hasOwnProperty.call(message, "decimalTargetTypes")) { + if (!Array.isArray(message.decimalTargetTypes)) + return "decimalTargetTypes: array expected"; + for (var i = 0; i < message.decimalTargetTypes.length; ++i) + switch (message.decimalTargetTypes[i]) { + default: + return "decimalTargetTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + switch (message.jsonExtension) { + default: + return "jsonExtension: enum value expected"; + case 0: + case 1: + break; + } + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) { + var error = $root.google.cloud.bigquery.v2.ParquetOptions.verify(message.parquetOptions, long + 1); + if (error) + return "parquetOptions." + error; + } + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) { + var error = $root.google.protobuf.BoolValue.verify(message.preserveAsciiControlCharacters, long + 1); + if (error) + return "preserveAsciiControlCharacters." + error; + } + if (message.connectionProperties != null && Object.hasOwnProperty.call(message, "connectionProperties")) { + if (!Array.isArray(message.connectionProperties)) + return "connectionProperties: array expected"; + for (var i = 0; i < message.connectionProperties.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ConnectionProperty.verify(message.connectionProperties[i], long + 1); + if (error) + return "connectionProperties." + error; + } + } + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) { + var error = $root.google.protobuf.BoolValue.verify(message.createSession, long + 1); + if (error) + return "createSession." + error; + } + if (message.columnNameCharacterMap != null && Object.hasOwnProperty.call(message, "columnNameCharacterMap")) + switch (message.columnNameCharacterMap) { + default: + return "columnNameCharacterMap: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.copyFilesOnly != null && Object.hasOwnProperty.call(message, "copyFilesOnly")) { + var error = $root.google.protobuf.BoolValue.verify(message.copyFilesOnly, long + 1); + if (error) + return "copyFilesOnly." + error; + } + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) { + var error = $root.google.protobuf.StringValue.verify(message.timeZone, long + 1); + if (error) + return "timeZone." + error; + } + if (message.nullMarkers != null && Object.hasOwnProperty.call(message, "nullMarkers")) { + if (!Array.isArray(message.nullMarkers)) + return "nullMarkers: array expected"; + for (var i = 0; i < message.nullMarkers.length; ++i) + if (!$util.isString(message.nullMarkers[i])) + return "nullMarkers: string[] expected"; + } + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) { + properties._dateFormat = 1; + if (!$util.isString(message.dateFormat)) + return "dateFormat: string expected"; + } + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) { + properties._datetimeFormat = 1; + if (!$util.isString(message.datetimeFormat)) + return "datetimeFormat: string expected"; + } + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) { + properties._timeFormat = 1; + if (!$util.isString(message.timeFormat)) + return "timeFormat: string expected"; + } + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) { + properties._timestampFormat = 1; + if (!$util.isString(message.timestampFormat)) + return "timestampFormat: string expected"; + } + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + switch (message.sourceColumnMatch) { + default: + return "sourceColumnMatch: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.timestampTargetPrecision != null && Object.hasOwnProperty.call(message, "timestampTargetPrecision")) { + if (!Array.isArray(message.timestampTargetPrecision)) + return "timestampTargetPrecision: array expected"; + for (var i = 0; i < message.timestampTargetPrecision.length; ++i) + if (!$util.isInteger(message.timestampTargetPrecision[i])) + return "timestampTargetPrecision: integer[] expected"; + } + return null; + }; + + /** + * Creates a JobConfigurationLoad message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfigurationLoad} JobConfigurationLoad + */ + JobConfigurationLoad.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfigurationLoad) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfigurationLoad(); + if (object.sourceUris) { + if (!Array.isArray(object.sourceUris)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.sourceUris: array expected"); + message.sourceUris = []; + for (var i = 0; i < object.sourceUris.length; ++i) + message.sourceUris[i] = String(object.sourceUris[i]); + } + switch (object.fileSetSpecType) { + default: + if (typeof object.fileSetSpecType === "number") { + message.fileSetSpecType = object.fileSetSpecType; + break; + } + break; + case "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH": + case 0: + message.fileSetSpecType = 0; + break; + case "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST": + case 1: + message.fileSetSpecType = 1; + break; + } + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.destinationTable != null) { + if (!$util.isObject(object.destinationTable)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.destinationTable: object expected"); + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.destinationTable, long + 1); + } + if (object.destinationTableProperties != null) { + if (!$util.isObject(object.destinationTableProperties)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.destinationTableProperties: object expected"); + message.destinationTableProperties = $root.google.cloud.bigquery.v2.DestinationTableProperties.fromObject(object.destinationTableProperties, long + 1); + } + if (object.createDisposition != null) + message.createDisposition = String(object.createDisposition); + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + if (object.nullMarker != null) { + if (!$util.isObject(object.nullMarker)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.nullMarker: object expected"); + message.nullMarker = $root.google.protobuf.StringValue.fromObject(object.nullMarker, long + 1); + } + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.skipLeadingRows != null) { + if (!$util.isObject(object.skipLeadingRows)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.skipLeadingRows: object expected"); + message.skipLeadingRows = $root.google.protobuf.Int32Value.fromObject(object.skipLeadingRows, long + 1); + } + if (object.encoding != null) + message.encoding = String(object.encoding); + if (object.quote != null) { + if (!$util.isObject(object.quote)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.quote: object expected"); + message.quote = $root.google.protobuf.StringValue.fromObject(object.quote, long + 1); + } + if (object.maxBadRecords != null) { + if (!$util.isObject(object.maxBadRecords)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.maxBadRecords: object expected"); + message.maxBadRecords = $root.google.protobuf.Int32Value.fromObject(object.maxBadRecords, long + 1); + } + if (object.allowQuotedNewlines != null) { + if (!$util.isObject(object.allowQuotedNewlines)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.allowQuotedNewlines: object expected"); + message.allowQuotedNewlines = $root.google.protobuf.BoolValue.fromObject(object.allowQuotedNewlines, long + 1); + } + if (object.sourceFormat != null) + message.sourceFormat = String(object.sourceFormat); + if (object.allowJaggedRows != null) { + if (!$util.isObject(object.allowJaggedRows)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.allowJaggedRows: object expected"); + message.allowJaggedRows = $root.google.protobuf.BoolValue.fromObject(object.allowJaggedRows, long + 1); + } + if (object.ignoreUnknownValues != null) { + if (!$util.isObject(object.ignoreUnknownValues)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.ignoreUnknownValues: object expected"); + message.ignoreUnknownValues = $root.google.protobuf.BoolValue.fromObject(object.ignoreUnknownValues, long + 1); + } + if (object.projectionFields) { + if (!Array.isArray(object.projectionFields)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.projectionFields: array expected"); + message.projectionFields = []; + for (var i = 0; i < object.projectionFields.length; ++i) + message.projectionFields[i] = String(object.projectionFields[i]); + } + if (object.autodetect != null) { + if (!$util.isObject(object.autodetect)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.autodetect: object expected"); + message.autodetect = $root.google.protobuf.BoolValue.fromObject(object.autodetect, long + 1); + } + if (object.schemaUpdateOptions) { + if (!Array.isArray(object.schemaUpdateOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.schemaUpdateOptions: array expected"); + message.schemaUpdateOptions = []; + for (var i = 0; i < object.schemaUpdateOptions.length; ++i) + message.schemaUpdateOptions[i] = String(object.schemaUpdateOptions[i]); + } + if (object.timePartitioning != null) { + if (!$util.isObject(object.timePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.timePartitioning: object expected"); + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.fromObject(object.timePartitioning, long + 1); + } + if (object.rangePartitioning != null) { + if (!$util.isObject(object.rangePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.rangePartitioning: object expected"); + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.fromObject(object.rangePartitioning, long + 1); + } + if (object.clustering != null) { + if (!$util.isObject(object.clustering)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.clustering: object expected"); + message.clustering = $root.google.cloud.bigquery.v2.Clustering.fromObject(object.clustering, long + 1); + } + if (object.destinationEncryptionConfiguration != null) { + if (!$util.isObject(object.destinationEncryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.destinationEncryptionConfiguration: object expected"); + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.destinationEncryptionConfiguration, long + 1); + } + if (object.useAvroLogicalTypes != null) { + if (!$util.isObject(object.useAvroLogicalTypes)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.useAvroLogicalTypes: object expected"); + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.fromObject(object.useAvroLogicalTypes, long + 1); + } + if (object.referenceFileSchemaUri != null) { + if (!$util.isObject(object.referenceFileSchemaUri)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.referenceFileSchemaUri: object expected"); + message.referenceFileSchemaUri = $root.google.protobuf.StringValue.fromObject(object.referenceFileSchemaUri, long + 1); + } + if (object.hivePartitioningOptions != null) { + if (!$util.isObject(object.hivePartitioningOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.hivePartitioningOptions: object expected"); + message.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.fromObject(object.hivePartitioningOptions, long + 1); + } + if (object.decimalTargetTypes) { + if (!Array.isArray(object.decimalTargetTypes)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.decimalTargetTypes: array expected"); + message.decimalTargetTypes = []; + for (var i = 0; i < object.decimalTargetTypes.length; ++i) + switch (object.decimalTargetTypes[i]) { + default: + if (typeof object.decimalTargetTypes[i] === "number") { + message.decimalTargetTypes[i] = object.decimalTargetTypes[i]; + break; + } + case "DECIMAL_TARGET_TYPE_UNSPECIFIED": + case 0: + message.decimalTargetTypes[i] = 0; + break; + case "NUMERIC": + case 1: + message.decimalTargetTypes[i] = 1; + break; + case "BIGNUMERIC": + case 2: + message.decimalTargetTypes[i] = 2; + break; + case "STRING": + case 3: + message.decimalTargetTypes[i] = 3; + break; + } + } + switch (object.jsonExtension) { + default: + if (typeof object.jsonExtension === "number") { + message.jsonExtension = object.jsonExtension; + break; + } + break; + case "JSON_EXTENSION_UNSPECIFIED": + case 0: + message.jsonExtension = 0; + break; + case "GEOJSON": + case 1: + message.jsonExtension = 1; + break; + } + if (object.parquetOptions != null) { + if (!$util.isObject(object.parquetOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.parquetOptions: object expected"); + message.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.fromObject(object.parquetOptions, long + 1); + } + if (object.preserveAsciiControlCharacters != null) { + if (!$util.isObject(object.preserveAsciiControlCharacters)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.preserveAsciiControlCharacters: object expected"); + message.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.fromObject(object.preserveAsciiControlCharacters, long + 1); + } + if (object.connectionProperties) { + if (!Array.isArray(object.connectionProperties)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.connectionProperties: array expected"); + message.connectionProperties = []; + for (var i = 0; i < object.connectionProperties.length; ++i) { + if (!$util.isObject(object.connectionProperties[i])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.connectionProperties: object expected"); + message.connectionProperties[i] = $root.google.cloud.bigquery.v2.ConnectionProperty.fromObject(object.connectionProperties[i], long + 1); + } + } + if (object.createSession != null) { + if (!$util.isObject(object.createSession)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.createSession: object expected"); + message.createSession = $root.google.protobuf.BoolValue.fromObject(object.createSession, long + 1); + } + switch (object.columnNameCharacterMap) { + default: + if (typeof object.columnNameCharacterMap === "number") { + message.columnNameCharacterMap = object.columnNameCharacterMap; + break; + } + break; + case "COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED": + case 0: + message.columnNameCharacterMap = 0; + break; + case "STRICT": + case 1: + message.columnNameCharacterMap = 1; + break; + case "V1": + case 2: + message.columnNameCharacterMap = 2; + break; + case "V2": + case 3: + message.columnNameCharacterMap = 3; + break; + } + if (object.copyFilesOnly != null) { + if (!$util.isObject(object.copyFilesOnly)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.copyFilesOnly: object expected"); + message.copyFilesOnly = $root.google.protobuf.BoolValue.fromObject(object.copyFilesOnly, long + 1); + } + if (object.timeZone != null) { + if (!$util.isObject(object.timeZone)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.timeZone: object expected"); + message.timeZone = $root.google.protobuf.StringValue.fromObject(object.timeZone, long + 1); + } + if (object.nullMarkers) { + if (!Array.isArray(object.nullMarkers)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.nullMarkers: array expected"); + message.nullMarkers = []; + for (var i = 0; i < object.nullMarkers.length; ++i) + message.nullMarkers[i] = String(object.nullMarkers[i]); + } + if (object.dateFormat != null) + message.dateFormat = String(object.dateFormat); + if (object.datetimeFormat != null) + message.datetimeFormat = String(object.datetimeFormat); + if (object.timeFormat != null) + message.timeFormat = String(object.timeFormat); + if (object.timestampFormat != null) + message.timestampFormat = String(object.timestampFormat); + switch (object.sourceColumnMatch) { + default: + if (typeof object.sourceColumnMatch === "number") { + message.sourceColumnMatch = object.sourceColumnMatch; + break; + } + break; + case "SOURCE_COLUMN_MATCH_UNSPECIFIED": + case 0: + message.sourceColumnMatch = 0; + break; + case "POSITION": + case 1: + message.sourceColumnMatch = 1; + break; + case "NAME": + case 2: + message.sourceColumnMatch = 2; + break; + } + if (object.timestampTargetPrecision) { + if (!Array.isArray(object.timestampTargetPrecision)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationLoad.timestampTargetPrecision: array expected"); + message.timestampTargetPrecision = []; + for (var i = 0; i < object.timestampTargetPrecision.length; ++i) + message.timestampTargetPrecision[i] = object.timestampTargetPrecision[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a JobConfigurationLoad message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationLoad} message JobConfigurationLoad + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfigurationLoad.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.sourceUris = []; + object.projectionFields = []; + object.schemaUpdateOptions = []; + object.decimalTargetTypes = []; + object.connectionProperties = []; + object.nullMarkers = []; + object.timestampTargetPrecision = []; + } + if (options.defaults) { + object.schema = null; + object.destinationTable = null; + object.destinationTableProperties = null; + object.createDisposition = ""; + object.writeDisposition = ""; + object.nullMarker = null; + object.fieldDelimiter = ""; + object.skipLeadingRows = null; + object.encoding = ""; + object.quote = null; + object.maxBadRecords = null; + object.allowQuotedNewlines = null; + object.sourceFormat = ""; + object.allowJaggedRows = null; + object.ignoreUnknownValues = null; + object.autodetect = null; + object.timePartitioning = null; + object.clustering = null; + object.destinationEncryptionConfiguration = null; + object.useAvroLogicalTypes = null; + object.rangePartitioning = null; + object.hivePartitioningOptions = null; + object.jsonExtension = options.enums === String ? "JSON_EXTENSION_UNSPECIFIED" : 0; + object.parquetOptions = null; + object.preserveAsciiControlCharacters = null; + object.referenceFileSchemaUri = null; + object.createSession = null; + object.fileSetSpecType = options.enums === String ? "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH" : 0; + object.columnNameCharacterMap = options.enums === String ? "COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED" : 0; + object.copyFilesOnly = null; + object.timeZone = null; + object.sourceColumnMatch = options.enums === String ? "SOURCE_COLUMN_MATCH_UNSPECIFIED" : 0; + } + if (message.sourceUris && message.sourceUris.length) { + object.sourceUris = []; + for (var j = 0; j < message.sourceUris.length; ++j) + object.sourceUris[j] = message.sourceUris[j]; + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + object.destinationTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.destinationTable, options, q + 1); + if (message.destinationTableProperties != null && Object.hasOwnProperty.call(message, "destinationTableProperties")) + object.destinationTableProperties = $root.google.cloud.bigquery.v2.DestinationTableProperties.toObject(message.destinationTableProperties, options, q + 1); + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + object.createDisposition = message.createDisposition; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + object.writeDisposition = message.writeDisposition; + if (message.nullMarker != null && Object.hasOwnProperty.call(message, "nullMarker")) + object.nullMarker = $root.google.protobuf.StringValue.toObject(message.nullMarker, options, q + 1); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.skipLeadingRows != null && Object.hasOwnProperty.call(message, "skipLeadingRows")) + object.skipLeadingRows = $root.google.protobuf.Int32Value.toObject(message.skipLeadingRows, options, q + 1); + if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding")) + object.encoding = message.encoding; + if (message.quote != null && Object.hasOwnProperty.call(message, "quote")) + object.quote = $root.google.protobuf.StringValue.toObject(message.quote, options, q + 1); + if (message.maxBadRecords != null && Object.hasOwnProperty.call(message, "maxBadRecords")) + object.maxBadRecords = $root.google.protobuf.Int32Value.toObject(message.maxBadRecords, options, q + 1); + if (message.allowQuotedNewlines != null && Object.hasOwnProperty.call(message, "allowQuotedNewlines")) + object.allowQuotedNewlines = $root.google.protobuf.BoolValue.toObject(message.allowQuotedNewlines, options, q + 1); + if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) + object.sourceFormat = message.sourceFormat; + if (message.allowJaggedRows != null && Object.hasOwnProperty.call(message, "allowJaggedRows")) + object.allowJaggedRows = $root.google.protobuf.BoolValue.toObject(message.allowJaggedRows, options, q + 1); + if (message.ignoreUnknownValues != null && Object.hasOwnProperty.call(message, "ignoreUnknownValues")) + object.ignoreUnknownValues = $root.google.protobuf.BoolValue.toObject(message.ignoreUnknownValues, options, q + 1); + if (message.projectionFields && message.projectionFields.length) { + object.projectionFields = []; + for (var j = 0; j < message.projectionFields.length; ++j) + object.projectionFields[j] = message.projectionFields[j]; + } + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) + object.autodetect = $root.google.protobuf.BoolValue.toObject(message.autodetect, options, q + 1); + if (message.schemaUpdateOptions && message.schemaUpdateOptions.length) { + object.schemaUpdateOptions = []; + for (var j = 0; j < message.schemaUpdateOptions.length; ++j) + object.schemaUpdateOptions[j] = message.schemaUpdateOptions[j]; + } + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + object.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.toObject(message.timePartitioning, options, q + 1); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + object.clustering = $root.google.cloud.bigquery.v2.Clustering.toObject(message.clustering, options, q + 1); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + object.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.destinationEncryptionConfiguration, options, q + 1); + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + object.useAvroLogicalTypes = $root.google.protobuf.BoolValue.toObject(message.useAvroLogicalTypes, options, q + 1); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + object.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.toObject(message.rangePartitioning, options, q + 1); + if (message.hivePartitioningOptions != null && Object.hasOwnProperty.call(message, "hivePartitioningOptions")) + object.hivePartitioningOptions = $root.google.cloud.bigquery.v2.HivePartitioningOptions.toObject(message.hivePartitioningOptions, options, q + 1); + if (message.decimalTargetTypes && message.decimalTargetTypes.length) { + object.decimalTargetTypes = []; + for (var j = 0; j < message.decimalTargetTypes.length; ++j) + object.decimalTargetTypes[j] = options.enums === String ? $root.google.cloud.bigquery.v2.DecimalTargetType[message.decimalTargetTypes[j]] === undefined ? message.decimalTargetTypes[j] : $root.google.cloud.bigquery.v2.DecimalTargetType[message.decimalTargetTypes[j]] : message.decimalTargetTypes[j]; + } + if (message.jsonExtension != null && Object.hasOwnProperty.call(message, "jsonExtension")) + object.jsonExtension = options.enums === String ? $root.google.cloud.bigquery.v2.JsonExtension[message.jsonExtension] === undefined ? message.jsonExtension : $root.google.cloud.bigquery.v2.JsonExtension[message.jsonExtension] : message.jsonExtension; + if (message.parquetOptions != null && Object.hasOwnProperty.call(message, "parquetOptions")) + object.parquetOptions = $root.google.cloud.bigquery.v2.ParquetOptions.toObject(message.parquetOptions, options, q + 1); + if (message.preserveAsciiControlCharacters != null && Object.hasOwnProperty.call(message, "preserveAsciiControlCharacters")) + object.preserveAsciiControlCharacters = $root.google.protobuf.BoolValue.toObject(message.preserveAsciiControlCharacters, options, q + 1); + if (message.referenceFileSchemaUri != null && Object.hasOwnProperty.call(message, "referenceFileSchemaUri")) + object.referenceFileSchemaUri = $root.google.protobuf.StringValue.toObject(message.referenceFileSchemaUri, options, q + 1); + if (message.connectionProperties && message.connectionProperties.length) { + object.connectionProperties = []; + for (var j = 0; j < message.connectionProperties.length; ++j) + object.connectionProperties[j] = $root.google.cloud.bigquery.v2.ConnectionProperty.toObject(message.connectionProperties[j], options, q + 1); + } + if (message.createSession != null && Object.hasOwnProperty.call(message, "createSession")) + object.createSession = $root.google.protobuf.BoolValue.toObject(message.createSession, options, q + 1); + if (message.fileSetSpecType != null && Object.hasOwnProperty.call(message, "fileSetSpecType")) + object.fileSetSpecType = options.enums === String ? $root.google.cloud.bigquery.v2.FileSetSpecType[message.fileSetSpecType] === undefined ? message.fileSetSpecType : $root.google.cloud.bigquery.v2.FileSetSpecType[message.fileSetSpecType] : message.fileSetSpecType; + if (message.columnNameCharacterMap != null && Object.hasOwnProperty.call(message, "columnNameCharacterMap")) + object.columnNameCharacterMap = options.enums === String ? $root.google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap[message.columnNameCharacterMap] === undefined ? message.columnNameCharacterMap : $root.google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap[message.columnNameCharacterMap] : message.columnNameCharacterMap; + if (message.copyFilesOnly != null && Object.hasOwnProperty.call(message, "copyFilesOnly")) + object.copyFilesOnly = $root.google.protobuf.BoolValue.toObject(message.copyFilesOnly, options, q + 1); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + object.timeZone = $root.google.protobuf.StringValue.toObject(message.timeZone, options, q + 1); + if (message.nullMarkers && message.nullMarkers.length) { + object.nullMarkers = []; + for (var j = 0; j < message.nullMarkers.length; ++j) + object.nullMarkers[j] = message.nullMarkers[j]; + } + if (message.dateFormat != null && Object.hasOwnProperty.call(message, "dateFormat")) { + object.dateFormat = message.dateFormat; + if (options.oneofs) + object._dateFormat = "dateFormat"; + } + if (message.datetimeFormat != null && Object.hasOwnProperty.call(message, "datetimeFormat")) { + object.datetimeFormat = message.datetimeFormat; + if (options.oneofs) + object._datetimeFormat = "datetimeFormat"; + } + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) { + object.timeFormat = message.timeFormat; + if (options.oneofs) + object._timeFormat = "timeFormat"; + } + if (message.timestampFormat != null && Object.hasOwnProperty.call(message, "timestampFormat")) { + object.timestampFormat = message.timestampFormat; + if (options.oneofs) + object._timestampFormat = "timestampFormat"; + } + if (message.sourceColumnMatch != null && Object.hasOwnProperty.call(message, "sourceColumnMatch")) + object.sourceColumnMatch = options.enums === String ? $root.google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch[message.sourceColumnMatch] === undefined ? message.sourceColumnMatch : $root.google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch[message.sourceColumnMatch] : message.sourceColumnMatch; + if (message.timestampTargetPrecision && message.timestampTargetPrecision.length) { + object.timestampTargetPrecision = []; + for (var j = 0; j < message.timestampTargetPrecision.length; ++j) + object.timestampTargetPrecision[j] = message.timestampTargetPrecision[j]; + } + return object; + }; + + /** + * Converts this JobConfigurationLoad to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @instance + * @returns {Object.} JSON object + */ + JobConfigurationLoad.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfigurationLoad + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfigurationLoad + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfigurationLoad.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfigurationLoad"; + }; + + /** + * ColumnNameCharacterMap enum. + * @name google.cloud.bigquery.v2.JobConfigurationLoad.ColumnNameCharacterMap + * @enum {number} + * @property {number} COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED=0 COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED value + * @property {number} STRICT=1 STRICT value + * @property {number} V1=2 V1 value + * @property {number} V2=3 V2 value + */ + JobConfigurationLoad.ColumnNameCharacterMap = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRICT"] = 1; + values[valuesById[2] = "V1"] = 2; + values[valuesById[3] = "V2"] = 3; + return values; + })(); + + /** + * SourceColumnMatch enum. + * @name google.cloud.bigquery.v2.JobConfigurationLoad.SourceColumnMatch + * @enum {number} + * @property {number} SOURCE_COLUMN_MATCH_UNSPECIFIED=0 SOURCE_COLUMN_MATCH_UNSPECIFIED value + * @property {number} POSITION=1 POSITION value + * @property {number} NAME=2 NAME value + */ + JobConfigurationLoad.SourceColumnMatch = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_COLUMN_MATCH_UNSPECIFIED"] = 0; + values[valuesById[1] = "POSITION"] = 1; + values[valuesById[2] = "NAME"] = 2; + return values; + })(); + + return JobConfigurationLoad; + })(); + + v2.JobConfigurationTableCopy = (function() { + + /** + * Properties of a JobConfigurationTableCopy. + * @memberof google.cloud.bigquery.v2 + * @interface IJobConfigurationTableCopy + * @property {google.cloud.bigquery.v2.ITableReference|null} [sourceTable] JobConfigurationTableCopy sourceTable + * @property {Array.|null} [sourceTables] JobConfigurationTableCopy sourceTables + * @property {google.cloud.bigquery.v2.ITableReference|null} [destinationTable] JobConfigurationTableCopy destinationTable + * @property {string|null} [createDisposition] JobConfigurationTableCopy createDisposition + * @property {string|null} [writeDisposition] JobConfigurationTableCopy writeDisposition + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [destinationEncryptionConfiguration] JobConfigurationTableCopy destinationEncryptionConfiguration + * @property {google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType|null} [operationType] JobConfigurationTableCopy operationType + * @property {google.protobuf.ITimestamp|null} [destinationExpirationTime] JobConfigurationTableCopy destinationExpirationTime + */ + + /** + * Constructs a new JobConfigurationTableCopy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobConfigurationTableCopy. + * @implements IJobConfigurationTableCopy + * @constructor + * @param {google.cloud.bigquery.v2.IJobConfigurationTableCopy=} [properties] Properties to set + */ + function JobConfigurationTableCopy(properties) { + this.sourceTables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfigurationTableCopy sourceTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} sourceTable + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.sourceTable = null; + + /** + * JobConfigurationTableCopy sourceTables. + * @member {Array.} sourceTables + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.sourceTables = $util.emptyArray; + + /** + * JobConfigurationTableCopy destinationTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} destinationTable + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.destinationTable = null; + + /** + * JobConfigurationTableCopy createDisposition. + * @member {string} createDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.createDisposition = ""; + + /** + * JobConfigurationTableCopy writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.writeDisposition = ""; + + /** + * JobConfigurationTableCopy destinationEncryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} destinationEncryptionConfiguration + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.destinationEncryptionConfiguration = null; + + /** + * JobConfigurationTableCopy operationType. + * @member {google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType} operationType + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.operationType = 0; + + /** + * JobConfigurationTableCopy destinationExpirationTime. + * @member {google.protobuf.ITimestamp|null|undefined} destinationExpirationTime + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + */ + JobConfigurationTableCopy.prototype.destinationExpirationTime = null; + + /** + * Creates a new JobConfigurationTableCopy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationTableCopy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfigurationTableCopy} JobConfigurationTableCopy instance + */ + JobConfigurationTableCopy.create = function create(properties) { + return new JobConfigurationTableCopy(properties); + }; + + /** + * Encodes the specified JobConfigurationTableCopy message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationTableCopy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationTableCopy} message JobConfigurationTableCopy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationTableCopy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.sourceTable, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.sourceTables != null && message.sourceTables.length) + for (var i = 0; i < message.sourceTables.length; ++i) + $root.google.cloud.bigquery.v2.TableReference.encode(message.sourceTables[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.destinationTable, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.createDisposition); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.writeDisposition); + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.destinationEncryptionConfiguration, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.operationType); + if (message.destinationExpirationTime != null && Object.hasOwnProperty.call(message, "destinationExpirationTime")) + $root.google.protobuf.Timestamp.encode(message.destinationExpirationTime, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobConfigurationTableCopy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationTableCopy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationTableCopy} message JobConfigurationTableCopy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationTableCopy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobConfigurationTableCopy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfigurationTableCopy} JobConfigurationTableCopy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationTableCopy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfigurationTableCopy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.sourceTables && message.sourceTables.length)) + message.sourceTables = []; + message.sourceTables.push($root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.createDisposition = reader.string(); + break; + } + case 5: { + message.writeDisposition = reader.string(); + break; + } + case 6: { + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.operationType = reader.int32(); + break; + } + case 9: { + message.destinationExpirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfigurationTableCopy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfigurationTableCopy} JobConfigurationTableCopy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationTableCopy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfigurationTableCopy message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfigurationTableCopy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.sourceTable, long + 1); + if (error) + return "sourceTable." + error; + } + if (message.sourceTables != null && Object.hasOwnProperty.call(message, "sourceTables")) { + if (!Array.isArray(message.sourceTables)) + return "sourceTables: array expected"; + for (var i = 0; i < message.sourceTables.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.sourceTables[i], long + 1); + if (error) + return "sourceTables." + error; + } + } + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.destinationTable, long + 1); + if (error) + return "destinationTable." + error; + } + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + if (!$util.isString(message.createDisposition)) + return "createDisposition: string expected"; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.destinationEncryptionConfiguration, long + 1); + if (error) + return "destinationEncryptionConfiguration." + error; + } + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.destinationExpirationTime != null && Object.hasOwnProperty.call(message, "destinationExpirationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.destinationExpirationTime, long + 1); + if (error) + return "destinationExpirationTime." + error; + } + return null; + }; + + /** + * Creates a JobConfigurationTableCopy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfigurationTableCopy} JobConfigurationTableCopy + */ + JobConfigurationTableCopy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfigurationTableCopy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfigurationTableCopy(); + if (object.sourceTable != null) { + if (!$util.isObject(object.sourceTable)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.sourceTable: object expected"); + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.sourceTable, long + 1); + } + if (object.sourceTables) { + if (!Array.isArray(object.sourceTables)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.sourceTables: array expected"); + message.sourceTables = []; + for (var i = 0; i < object.sourceTables.length; ++i) { + if (!$util.isObject(object.sourceTables[i])) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.sourceTables: object expected"); + message.sourceTables[i] = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.sourceTables[i], long + 1); + } + } + if (object.destinationTable != null) { + if (!$util.isObject(object.destinationTable)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.destinationTable: object expected"); + message.destinationTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.destinationTable, long + 1); + } + if (object.createDisposition != null) + message.createDisposition = String(object.createDisposition); + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + if (object.destinationEncryptionConfiguration != null) { + if (!$util.isObject(object.destinationEncryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.destinationEncryptionConfiguration: object expected"); + message.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.destinationEncryptionConfiguration, long + 1); + } + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "COPY": + case 1: + message.operationType = 1; + break; + case "SNAPSHOT": + case 2: + message.operationType = 2; + break; + case "RESTORE": + case 3: + message.operationType = 3; + break; + case "CLONE": + case 4: + message.operationType = 4; + break; + } + if (object.destinationExpirationTime != null) { + if (!$util.isObject(object.destinationExpirationTime)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationTableCopy.destinationExpirationTime: object expected"); + message.destinationExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.destinationExpirationTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JobConfigurationTableCopy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationTableCopy} message JobConfigurationTableCopy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfigurationTableCopy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.sourceTables = []; + if (options.defaults) { + object.sourceTable = null; + object.destinationTable = null; + object.createDisposition = ""; + object.writeDisposition = ""; + object.destinationEncryptionConfiguration = null; + object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + object.destinationExpirationTime = null; + } + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + object.sourceTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.sourceTable, options, q + 1); + if (message.sourceTables && message.sourceTables.length) { + object.sourceTables = []; + for (var j = 0; j < message.sourceTables.length; ++j) + object.sourceTables[j] = $root.google.cloud.bigquery.v2.TableReference.toObject(message.sourceTables[j], options, q + 1); + } + if (message.destinationTable != null && Object.hasOwnProperty.call(message, "destinationTable")) + object.destinationTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.destinationTable, options, q + 1); + if (message.createDisposition != null && Object.hasOwnProperty.call(message, "createDisposition")) + object.createDisposition = message.createDisposition; + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + object.writeDisposition = message.writeDisposition; + if (message.destinationEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "destinationEncryptionConfiguration")) + object.destinationEncryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.destinationEncryptionConfiguration, options, q + 1); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + object.operationType = options.enums === String ? $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType[message.operationType] : message.operationType; + if (message.destinationExpirationTime != null && Object.hasOwnProperty.call(message, "destinationExpirationTime")) + object.destinationExpirationTime = $root.google.protobuf.Timestamp.toObject(message.destinationExpirationTime, options, q + 1); + return object; + }; + + /** + * Converts this JobConfigurationTableCopy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @instance + * @returns {Object.} JSON object + */ + JobConfigurationTableCopy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfigurationTableCopy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfigurationTableCopy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfigurationTableCopy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfigurationTableCopy"; + }; + + /** + * OperationType enum. + * @name google.cloud.bigquery.v2.JobConfigurationTableCopy.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} COPY=1 COPY value + * @property {number} SNAPSHOT=2 SNAPSHOT value + * @property {number} RESTORE=3 RESTORE value + * @property {number} CLONE=4 CLONE value + */ + JobConfigurationTableCopy.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COPY"] = 1; + values[valuesById[2] = "SNAPSHOT"] = 2; + values[valuesById[3] = "RESTORE"] = 3; + values[valuesById[4] = "CLONE"] = 4; + return values; + })(); + + return JobConfigurationTableCopy; + })(); + + v2.JobConfigurationExtract = (function() { + + /** + * Properties of a JobConfigurationExtract. + * @memberof google.cloud.bigquery.v2 + * @interface IJobConfigurationExtract + * @property {google.cloud.bigquery.v2.ITableReference|null} [sourceTable] JobConfigurationExtract sourceTable + * @property {google.cloud.bigquery.v2.IModelReference|null} [sourceModel] JobConfigurationExtract sourceModel + * @property {Array.|null} [destinationUris] JobConfigurationExtract destinationUris + * @property {google.protobuf.IBoolValue|null} [printHeader] JobConfigurationExtract printHeader + * @property {string|null} [fieldDelimiter] JobConfigurationExtract fieldDelimiter + * @property {string|null} [destinationFormat] JobConfigurationExtract destinationFormat + * @property {string|null} [compression] JobConfigurationExtract compression + * @property {google.protobuf.IBoolValue|null} [useAvroLogicalTypes] JobConfigurationExtract useAvroLogicalTypes + * @property {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions|null} [modelExtractOptions] JobConfigurationExtract modelExtractOptions + */ + + /** + * Constructs a new JobConfigurationExtract. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobConfigurationExtract. + * @implements IJobConfigurationExtract + * @constructor + * @param {google.cloud.bigquery.v2.IJobConfigurationExtract=} [properties] Properties to set + */ + function JobConfigurationExtract(properties) { + this.destinationUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfigurationExtract sourceTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} sourceTable + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.sourceTable = null; + + /** + * JobConfigurationExtract sourceModel. + * @member {google.cloud.bigquery.v2.IModelReference|null|undefined} sourceModel + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.sourceModel = null; + + /** + * JobConfigurationExtract destinationUris. + * @member {Array.} destinationUris + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.destinationUris = $util.emptyArray; + + /** + * JobConfigurationExtract printHeader. + * @member {google.protobuf.IBoolValue|null|undefined} printHeader + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.printHeader = null; + + /** + * JobConfigurationExtract fieldDelimiter. + * @member {string} fieldDelimiter + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.fieldDelimiter = ""; + + /** + * JobConfigurationExtract destinationFormat. + * @member {string} destinationFormat + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.destinationFormat = ""; + + /** + * JobConfigurationExtract compression. + * @member {string} compression + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.compression = ""; + + /** + * JobConfigurationExtract useAvroLogicalTypes. + * @member {google.protobuf.IBoolValue|null|undefined} useAvroLogicalTypes + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.useAvroLogicalTypes = null; + + /** + * JobConfigurationExtract modelExtractOptions. + * @member {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions|null|undefined} modelExtractOptions + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + JobConfigurationExtract.prototype.modelExtractOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * JobConfigurationExtract source. + * @member {"sourceTable"|"sourceModel"|undefined} source + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + */ + Object.defineProperty(JobConfigurationExtract.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceTable", "sourceModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobConfigurationExtract instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationExtract=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract} JobConfigurationExtract instance + */ + JobConfigurationExtract.create = function create(properties) { + return new JobConfigurationExtract(properties); + }; + + /** + * Encodes the specified JobConfigurationExtract message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationExtract} message JobConfigurationExtract message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationExtract.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.sourceTable, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.destinationUris != null && message.destinationUris.length) + for (var i = 0; i < message.destinationUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationUris[i]); + if (message.printHeader != null && Object.hasOwnProperty.call(message, "printHeader")) + $root.google.protobuf.BoolValue.encode(message.printHeader, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fieldDelimiter); + if (message.destinationFormat != null && Object.hasOwnProperty.call(message, "destinationFormat")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.destinationFormat); + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.compression); + if (message.sourceModel != null && Object.hasOwnProperty.call(message, "sourceModel")) + $root.google.cloud.bigquery.v2.ModelReference.encode(message.sourceModel, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + $root.google.protobuf.BoolValue.encode(message.useAvroLogicalTypes, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.modelExtractOptions != null && Object.hasOwnProperty.call(message, "modelExtractOptions")) + $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.encode(message.modelExtractOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobConfigurationExtract message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {google.cloud.bigquery.v2.IJobConfigurationExtract} message JobConfigurationExtract message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfigurationExtract.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobConfigurationExtract message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract} JobConfigurationExtract + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationExtract.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfigurationExtract(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sourceModel = $root.google.cloud.bigquery.v2.ModelReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.destinationUris && message.destinationUris.length)) + message.destinationUris = []; + message.destinationUris.push(reader.string()); + break; + } + case 4: { + message.printHeader = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.fieldDelimiter = reader.string(); + break; + } + case 6: { + message.destinationFormat = reader.string(); + break; + } + case 7: { + message.compression = reader.string(); + break; + } + case 13: { + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.modelExtractOptions = $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfigurationExtract message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract} JobConfigurationExtract + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfigurationExtract.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfigurationExtract message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfigurationExtract.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) { + properties.source = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.sourceTable, long + 1); + if (error) + return "sourceTable." + error; + } + } + if (message.sourceModel != null && Object.hasOwnProperty.call(message, "sourceModel")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.bigquery.v2.ModelReference.verify(message.sourceModel, long + 1); + if (error) + return "sourceModel." + error; + } + } + if (message.destinationUris != null && Object.hasOwnProperty.call(message, "destinationUris")) { + if (!Array.isArray(message.destinationUris)) + return "destinationUris: array expected"; + for (var i = 0; i < message.destinationUris.length; ++i) + if (!$util.isString(message.destinationUris[i])) + return "destinationUris: string[] expected"; + } + if (message.printHeader != null && Object.hasOwnProperty.call(message, "printHeader")) { + var error = $root.google.protobuf.BoolValue.verify(message.printHeader, long + 1); + if (error) + return "printHeader." + error; + } + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + if (!$util.isString(message.fieldDelimiter)) + return "fieldDelimiter: string expected"; + if (message.destinationFormat != null && Object.hasOwnProperty.call(message, "destinationFormat")) + if (!$util.isString(message.destinationFormat)) + return "destinationFormat: string expected"; + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + if (!$util.isString(message.compression)) + return "compression: string expected"; + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) { + var error = $root.google.protobuf.BoolValue.verify(message.useAvroLogicalTypes, long + 1); + if (error) + return "useAvroLogicalTypes." + error; + } + if (message.modelExtractOptions != null && Object.hasOwnProperty.call(message, "modelExtractOptions")) { + var error = $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.verify(message.modelExtractOptions, long + 1); + if (error) + return "modelExtractOptions." + error; + } + return null; + }; + + /** + * Creates a JobConfigurationExtract message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract} JobConfigurationExtract + */ + JobConfigurationExtract.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfigurationExtract) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfigurationExtract(); + if (object.sourceTable != null) { + if (!$util.isObject(object.sourceTable)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.sourceTable: object expected"); + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.sourceTable, long + 1); + } + if (object.sourceModel != null) { + if (!$util.isObject(object.sourceModel)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.sourceModel: object expected"); + message.sourceModel = $root.google.cloud.bigquery.v2.ModelReference.fromObject(object.sourceModel, long + 1); + } + if (object.destinationUris) { + if (!Array.isArray(object.destinationUris)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.destinationUris: array expected"); + message.destinationUris = []; + for (var i = 0; i < object.destinationUris.length; ++i) + message.destinationUris[i] = String(object.destinationUris[i]); + } + if (object.printHeader != null) { + if (!$util.isObject(object.printHeader)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.printHeader: object expected"); + message.printHeader = $root.google.protobuf.BoolValue.fromObject(object.printHeader, long + 1); + } + if (object.fieldDelimiter != null) + message.fieldDelimiter = String(object.fieldDelimiter); + if (object.destinationFormat != null) + message.destinationFormat = String(object.destinationFormat); + if (object.compression != null) + message.compression = String(object.compression); + if (object.useAvroLogicalTypes != null) { + if (!$util.isObject(object.useAvroLogicalTypes)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.useAvroLogicalTypes: object expected"); + message.useAvroLogicalTypes = $root.google.protobuf.BoolValue.fromObject(object.useAvroLogicalTypes, long + 1); + } + if (object.modelExtractOptions != null) { + if (!$util.isObject(object.modelExtractOptions)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.modelExtractOptions: object expected"); + message.modelExtractOptions = $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.fromObject(object.modelExtractOptions, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JobConfigurationExtract message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationExtract} message JobConfigurationExtract + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfigurationExtract.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.destinationUris = []; + if (options.defaults) { + object.printHeader = null; + object.fieldDelimiter = ""; + object.destinationFormat = ""; + object.compression = ""; + object.useAvroLogicalTypes = null; + object.modelExtractOptions = null; + } + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) { + object.sourceTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.sourceTable, options, q + 1); + if (options.oneofs) + object.source = "sourceTable"; + } + if (message.destinationUris && message.destinationUris.length) { + object.destinationUris = []; + for (var j = 0; j < message.destinationUris.length; ++j) + object.destinationUris[j] = message.destinationUris[j]; + } + if (message.printHeader != null && Object.hasOwnProperty.call(message, "printHeader")) + object.printHeader = $root.google.protobuf.BoolValue.toObject(message.printHeader, options, q + 1); + if (message.fieldDelimiter != null && Object.hasOwnProperty.call(message, "fieldDelimiter")) + object.fieldDelimiter = message.fieldDelimiter; + if (message.destinationFormat != null && Object.hasOwnProperty.call(message, "destinationFormat")) + object.destinationFormat = message.destinationFormat; + if (message.compression != null && Object.hasOwnProperty.call(message, "compression")) + object.compression = message.compression; + if (message.sourceModel != null && Object.hasOwnProperty.call(message, "sourceModel")) { + object.sourceModel = $root.google.cloud.bigquery.v2.ModelReference.toObject(message.sourceModel, options, q + 1); + if (options.oneofs) + object.source = "sourceModel"; + } + if (message.useAvroLogicalTypes != null && Object.hasOwnProperty.call(message, "useAvroLogicalTypes")) + object.useAvroLogicalTypes = $root.google.protobuf.BoolValue.toObject(message.useAvroLogicalTypes, options, q + 1); + if (message.modelExtractOptions != null && Object.hasOwnProperty.call(message, "modelExtractOptions")) + object.modelExtractOptions = $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.toObject(message.modelExtractOptions, options, q + 1); + return object; + }; + + /** + * Converts this JobConfigurationExtract to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @instance + * @returns {Object.} JSON object + */ + JobConfigurationExtract.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfigurationExtract + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfigurationExtract.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfigurationExtract"; + }; + + JobConfigurationExtract.ModelExtractOptions = (function() { + + /** + * Properties of a ModelExtractOptions. + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @interface IModelExtractOptions + * @property {google.protobuf.IInt64Value|null} [trialId] ModelExtractOptions trialId + */ + + /** + * Constructs a new ModelExtractOptions. + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract + * @classdesc Represents a ModelExtractOptions. + * @implements IModelExtractOptions + * @constructor + * @param {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions=} [properties] Properties to set + */ + function ModelExtractOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExtractOptions trialId. + * @member {google.protobuf.IInt64Value|null|undefined} trialId + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @instance + */ + ModelExtractOptions.prototype.trialId = null; + + /** + * Creates a new ModelExtractOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions} ModelExtractOptions instance + */ + ModelExtractOptions.create = function create(properties) { + return new ModelExtractOptions(properties); + }; + + /** + * Encodes the specified ModelExtractOptions message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions} message ModelExtractOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExtractOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) + $root.google.protobuf.Int64Value.encode(message.trialId, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelExtractOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationExtract.IModelExtractOptions} message ModelExtractOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExtractOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ModelExtractOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions} ModelExtractOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExtractOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trialId = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExtractOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions} ModelExtractOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExtractOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExtractOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExtractOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) { + var error = $root.google.protobuf.Int64Value.verify(message.trialId, long + 1); + if (error) + return "trialId." + error; + } + return null; + }; + + /** + * Creates a ModelExtractOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions} ModelExtractOptions + */ + ModelExtractOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions(); + if (object.trialId != null) { + if (!$util.isObject(object.trialId)) + throw TypeError(".google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions.trialId: object expected"); + message.trialId = $root.google.protobuf.Int64Value.fromObject(object.trialId, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ModelExtractOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions} message ModelExtractOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExtractOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.trialId = null; + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) + object.trialId = $root.google.protobuf.Int64Value.toObject(message.trialId, options, q + 1); + return object; + }; + + /** + * Converts this ModelExtractOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @instance + * @returns {Object.} JSON object + */ + ModelExtractOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelExtractOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelExtractOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfigurationExtract.ModelExtractOptions"; + }; + + return ModelExtractOptions; + })(); + + return JobConfigurationExtract; + })(); + + v2.JobConfiguration = (function() { + + /** + * Properties of a JobConfiguration. + * @memberof google.cloud.bigquery.v2 + * @interface IJobConfiguration + * @property {string|null} [jobType] JobConfiguration jobType + * @property {google.cloud.bigquery.v2.IJobConfigurationQuery|null} [query] JobConfiguration query + * @property {google.cloud.bigquery.v2.IJobConfigurationLoad|null} [load] JobConfiguration load + * @property {google.cloud.bigquery.v2.IJobConfigurationTableCopy|null} [copy] JobConfiguration copy + * @property {google.cloud.bigquery.v2.IJobConfigurationExtract|null} [extract] JobConfiguration extract + * @property {google.protobuf.IBoolValue|null} [dryRun] JobConfiguration dryRun + * @property {google.protobuf.IInt64Value|null} [jobTimeoutMs] JobConfiguration jobTimeoutMs + * @property {number|null} [maxSlots] JobConfiguration maxSlots + * @property {Object.|null} [labels] JobConfiguration labels + * @property {string|null} [reservation] JobConfiguration reservation + */ + + /** + * Constructs a new JobConfiguration. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobConfiguration. + * @implements IJobConfiguration + * @constructor + * @param {google.cloud.bigquery.v2.IJobConfiguration=} [properties] Properties to set + */ + function JobConfiguration(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobConfiguration jobType. + * @member {string} jobType + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.jobType = ""; + + /** + * JobConfiguration query. + * @member {google.cloud.bigquery.v2.IJobConfigurationQuery|null|undefined} query + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.query = null; + + /** + * JobConfiguration load. + * @member {google.cloud.bigquery.v2.IJobConfigurationLoad|null|undefined} load + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.load = null; + + /** + * JobConfiguration copy. + * @member {google.cloud.bigquery.v2.IJobConfigurationTableCopy|null|undefined} copy + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.copy = null; + + /** + * JobConfiguration extract. + * @member {google.cloud.bigquery.v2.IJobConfigurationExtract|null|undefined} extract + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.extract = null; + + /** + * JobConfiguration dryRun. + * @member {google.protobuf.IBoolValue|null|undefined} dryRun + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.dryRun = null; + + /** + * JobConfiguration jobTimeoutMs. + * @member {google.protobuf.IInt64Value|null|undefined} jobTimeoutMs + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.jobTimeoutMs = null; + + /** + * JobConfiguration maxSlots. + * @member {number|null|undefined} maxSlots + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.maxSlots = null; + + /** + * JobConfiguration labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.labels = $util.emptyObject; + + /** + * JobConfiguration reservation. + * @member {string|null|undefined} reservation + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + */ + JobConfiguration.prototype.reservation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfiguration.prototype, "_maxSlots", { + get: $util.oneOfGetter($oneOfFields = ["maxSlots"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobConfiguration.prototype, "_reservation", { + get: $util.oneOfGetter($oneOfFields = ["reservation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobConfiguration instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {google.cloud.bigquery.v2.IJobConfiguration=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobConfiguration} JobConfiguration instance + */ + JobConfiguration.create = function create(properties) { + return new JobConfiguration(properties); + }; + + /** + * Encodes the specified JobConfiguration message. Does not implicitly {@link google.cloud.bigquery.v2.JobConfiguration.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {google.cloud.bigquery.v2.IJobConfiguration} message JobConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfiguration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.cloud.bigquery.v2.JobConfigurationQuery.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.load != null && Object.hasOwnProperty.call(message, "load")) + $root.google.cloud.bigquery.v2.JobConfigurationLoad.encode(message.load, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) + $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.encode(message.copy, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) + $root.google.cloud.bigquery.v2.JobConfigurationExtract.encode(message.extract, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + $root.google.protobuf.BoolValue.encode(message.dryRun, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) + $root.google.protobuf.Int64Value.encode(message.jobTimeoutMs, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.jobType); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.reservation); + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.maxSlots); + return writer; + }; + + /** + * Encodes the specified JobConfiguration message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobConfiguration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {google.cloud.bigquery.v2.IJobConfiguration} message JobConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobConfiguration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobConfiguration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobConfiguration} JobConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfiguration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobConfiguration(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + message.jobType = reader.string(); + break; + } + case 1: { + message.query = $root.google.cloud.bigquery.v2.JobConfigurationQuery.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.load = $root.google.cloud.bigquery.v2.JobConfigurationLoad.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.copy = $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.extract = $root.google.cloud.bigquery.v2.JobConfigurationExtract.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.dryRun = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.jobTimeoutMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.maxSlots = reader.int32(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 11: { + message.reservation = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobConfiguration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobConfiguration} JobConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobConfiguration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobConfiguration message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobConfiguration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + if (!$util.isString(message.jobType)) + return "jobType: string expected"; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) { + var error = $root.google.cloud.bigquery.v2.JobConfigurationQuery.verify(message.query, long + 1); + if (error) + return "query." + error; + } + if (message.load != null && Object.hasOwnProperty.call(message, "load")) { + var error = $root.google.cloud.bigquery.v2.JobConfigurationLoad.verify(message.load, long + 1); + if (error) + return "load." + error; + } + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) { + var error = $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.verify(message.copy, long + 1); + if (error) + return "copy." + error; + } + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) { + var error = $root.google.cloud.bigquery.v2.JobConfigurationExtract.verify(message.extract, long + 1); + if (error) + return "extract." + error; + } + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) { + var error = $root.google.protobuf.BoolValue.verify(message.dryRun, long + 1); + if (error) + return "dryRun." + error; + } + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.jobTimeoutMs, long + 1); + if (error) + return "jobTimeoutMs." + error; + } + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) { + properties._maxSlots = 1; + if (!$util.isInteger(message.maxSlots)) + return "maxSlots: integer expected"; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) { + properties._reservation = 1; + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + } + return null; + }; + + /** + * Creates a JobConfiguration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobConfiguration} JobConfiguration + */ + JobConfiguration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobConfiguration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobConfiguration(); + if (object.jobType != null) + message.jobType = String(object.jobType); + if (object.query != null) { + if (!$util.isObject(object.query)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.query: object expected"); + message.query = $root.google.cloud.bigquery.v2.JobConfigurationQuery.fromObject(object.query, long + 1); + } + if (object.load != null) { + if (!$util.isObject(object.load)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.load: object expected"); + message.load = $root.google.cloud.bigquery.v2.JobConfigurationLoad.fromObject(object.load, long + 1); + } + if (object.copy != null) { + if (!$util.isObject(object.copy)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.copy: object expected"); + message.copy = $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.fromObject(object.copy, long + 1); + } + if (object.extract != null) { + if (!$util.isObject(object.extract)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.extract: object expected"); + message.extract = $root.google.cloud.bigquery.v2.JobConfigurationExtract.fromObject(object.extract, long + 1); + } + if (object.dryRun != null) { + if (!$util.isObject(object.dryRun)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.dryRun: object expected"); + message.dryRun = $root.google.protobuf.BoolValue.fromObject(object.dryRun, long + 1); + } + if (object.jobTimeoutMs != null) { + if (!$util.isObject(object.jobTimeoutMs)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.jobTimeoutMs: object expected"); + message.jobTimeoutMs = $root.google.protobuf.Int64Value.fromObject(object.jobTimeoutMs, long + 1); + } + if (object.maxSlots != null) + message.maxSlots = object.maxSlots | 0; + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.JobConfiguration.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.reservation != null) + message.reservation = String(object.reservation); + return message; + }; + + /** + * Creates a plain object from a JobConfiguration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {google.cloud.bigquery.v2.JobConfiguration} message JobConfiguration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobConfiguration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.query = null; + object.load = null; + object.copy = null; + object.extract = null; + object.dryRun = null; + object.jobTimeoutMs = null; + object.jobType = ""; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = $root.google.cloud.bigquery.v2.JobConfigurationQuery.toObject(message.query, options, q + 1); + if (message.load != null && Object.hasOwnProperty.call(message, "load")) + object.load = $root.google.cloud.bigquery.v2.JobConfigurationLoad.toObject(message.load, options, q + 1); + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) + object.copy = $root.google.cloud.bigquery.v2.JobConfigurationTableCopy.toObject(message.copy, options, q + 1); + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) + object.extract = $root.google.cloud.bigquery.v2.JobConfigurationExtract.toObject(message.extract, options, q + 1); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + object.dryRun = $root.google.protobuf.BoolValue.toObject(message.dryRun, options, q + 1); + if (message.jobTimeoutMs != null && Object.hasOwnProperty.call(message, "jobTimeoutMs")) + object.jobTimeoutMs = $root.google.protobuf.Int64Value.toObject(message.jobTimeoutMs, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + object.jobType = message.jobType; + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) { + object.reservation = message.reservation; + if (options.oneofs) + object._reservation = "reservation"; + } + if (message.maxSlots != null && Object.hasOwnProperty.call(message, "maxSlots")) { + object.maxSlots = message.maxSlots; + if (options.oneofs) + object._maxSlots = "maxSlots"; + } + return object; + }; + + /** + * Converts this JobConfiguration to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @instance + * @returns {Object.} JSON object + */ + JobConfiguration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobConfiguration + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobConfiguration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobConfiguration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobConfiguration"; + }; + + return JobConfiguration; + })(); + + v2.ModelReference = (function() { + + /** + * Properties of a ModelReference. + * @memberof google.cloud.bigquery.v2 + * @interface IModelReference + * @property {string|null} [projectId] ModelReference projectId + * @property {string|null} [datasetId] ModelReference datasetId + * @property {string|null} [modelId] ModelReference modelId + */ + + /** + * Constructs a new ModelReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ModelReference. + * @implements IModelReference + * @constructor + * @param {google.cloud.bigquery.v2.IModelReference=} [properties] Properties to set + */ + function ModelReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ModelReference + * @instance + */ + ModelReference.prototype.projectId = ""; + + /** + * ModelReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.ModelReference + * @instance + */ + ModelReference.prototype.datasetId = ""; + + /** + * ModelReference modelId. + * @member {string} modelId + * @memberof google.cloud.bigquery.v2.ModelReference + * @instance + */ + ModelReference.prototype.modelId = ""; + + /** + * Creates a new ModelReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {google.cloud.bigquery.v2.IModelReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ModelReference} ModelReference instance + */ + ModelReference.create = function create(properties) { + return new ModelReference(properties); + }; + + /** + * Encodes the specified ModelReference message. Does not implicitly {@link google.cloud.bigquery.v2.ModelReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {google.cloud.bigquery.v2.IModelReference} message ModelReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelId); + return writer; + }; + + /** + * Encodes the specified ModelReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ModelReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {google.cloud.bigquery.v2.IModelReference} message ModelReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ModelReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ModelReference} ModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ModelReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.modelId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ModelReference} ModelReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + if (!$util.isString(message.modelId)) + return "modelId: string expected"; + return null; + }; + + /** + * Creates a ModelReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ModelReference} ModelReference + */ + ModelReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ModelReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ModelReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ModelReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.modelId != null) + message.modelId = String(object.modelId); + return message; + }; + + /** + * Creates a plain object from a ModelReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {google.cloud.bigquery.v2.ModelReference} message ModelReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.modelId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + object.modelId = message.modelId; + return object; + }; + + /** + * Converts this ModelReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ModelReference + * @instance + * @returns {Object.} JSON object + */ + ModelReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ModelReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ModelReference"; + }; + + return ModelReference; + })(); + + v2.QueryParameterStructType = (function() { + + /** + * Properties of a QueryParameterStructType. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryParameterStructType + * @property {string|null} [name] QueryParameterStructType name + * @property {google.cloud.bigquery.v2.IQueryParameterType|null} [type] QueryParameterStructType type + * @property {string|null} [description] QueryParameterStructType description + */ + + /** + * Constructs a new QueryParameterStructType. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryParameterStructType. + * @implements IQueryParameterStructType + * @constructor + * @param {google.cloud.bigquery.v2.IQueryParameterStructType=} [properties] Properties to set + */ + function QueryParameterStructType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameterStructType name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @instance + */ + QueryParameterStructType.prototype.name = ""; + + /** + * QueryParameterStructType type. + * @member {google.cloud.bigquery.v2.IQueryParameterType|null|undefined} type + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @instance + */ + QueryParameterStructType.prototype.type = null; + + /** + * QueryParameterStructType description. + * @member {string} description + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @instance + */ + QueryParameterStructType.prototype.description = ""; + + /** + * Creates a new QueryParameterStructType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterStructType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryParameterStructType} QueryParameterStructType instance + */ + QueryParameterStructType.create = function create(properties) { + return new QueryParameterStructType(properties); + }; + + /** + * Encodes the specified QueryParameterStructType message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterStructType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterStructType} message QueryParameterStructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterStructType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.bigquery.v2.QueryParameterType.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified QueryParameterStructType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterStructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterStructType} message QueryParameterStructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterStructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryParameterStructType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryParameterStructType} QueryParameterStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterStructType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryParameterStructType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.cloud.bigquery.v2.QueryParameterType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameterStructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryParameterStructType} QueryParameterStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterStructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameterStructType message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameterStructType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterType.verify(message.type, long + 1); + if (error) + return "type." + error; + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a QueryParameterStructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryParameterStructType} QueryParameterStructType + */ + QueryParameterStructType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryParameterStructType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterStructType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryParameterStructType(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (!$util.isObject(object.type)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterStructType.type: object expected"); + message.type = $root.google.cloud.bigquery.v2.QueryParameterType.fromObject(object.type, long + 1); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a QueryParameterStructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {google.cloud.bigquery.v2.QueryParameterStructType} message QueryParameterStructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameterStructType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + object.description = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.cloud.bigquery.v2.QueryParameterType.toObject(message.type, options, q + 1); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + return object; + }; + + /** + * Converts this QueryParameterStructType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @instance + * @returns {Object.} JSON object + */ + QueryParameterStructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameterStructType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryParameterStructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameterStructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryParameterStructType"; + }; + + return QueryParameterStructType; + })(); + + v2.QueryParameterType = (function() { + + /** + * Properties of a QueryParameterType. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryParameterType + * @property {string|null} [type] QueryParameterType type + * @property {number|Long|null} [timestampPrecision] QueryParameterType timestampPrecision + * @property {google.cloud.bigquery.v2.IQueryParameterType|null} [arrayType] QueryParameterType arrayType + * @property {Array.|null} [structTypes] QueryParameterType structTypes + * @property {google.cloud.bigquery.v2.IQueryParameterType|null} [rangeElementType] QueryParameterType rangeElementType + */ + + /** + * Constructs a new QueryParameterType. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryParameterType. + * @implements IQueryParameterType + * @constructor + * @param {google.cloud.bigquery.v2.IQueryParameterType=} [properties] Properties to set + */ + function QueryParameterType(properties) { + this.structTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameterType type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + */ + QueryParameterType.prototype.type = ""; + + /** + * QueryParameterType timestampPrecision. + * @member {number|Long|null|undefined} timestampPrecision + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + */ + QueryParameterType.prototype.timestampPrecision = null; + + /** + * QueryParameterType arrayType. + * @member {google.cloud.bigquery.v2.IQueryParameterType|null|undefined} arrayType + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + */ + QueryParameterType.prototype.arrayType = null; + + /** + * QueryParameterType structTypes. + * @member {Array.} structTypes + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + */ + QueryParameterType.prototype.structTypes = $util.emptyArray; + + /** + * QueryParameterType rangeElementType. + * @member {google.cloud.bigquery.v2.IQueryParameterType|null|undefined} rangeElementType + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + */ + QueryParameterType.prototype.rangeElementType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(QueryParameterType.prototype, "_timestampPrecision", { + get: $util.oneOfGetter($oneOfFields = ["timestampPrecision"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryParameterType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryParameterType} QueryParameterType instance + */ + QueryParameterType.create = function create(properties) { + return new QueryParameterType(properties); + }; + + /** + * Encodes the specified QueryParameterType message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterType} message QueryParameterType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + $root.google.cloud.bigquery.v2.QueryParameterType.encode(message.arrayType, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.structTypes != null && message.structTypes.length) + for (var i = 0; i < message.structTypes.length; ++i) + $root.google.cloud.bigquery.v2.QueryParameterStructType.encode(message.structTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) + $root.google.cloud.bigquery.v2.QueryParameterType.encode(message.rangeElementType, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.timestampPrecision); + return writer; + }; + + /** + * Encodes the specified QueryParameterType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterType} message QueryParameterType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryParameterType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryParameterType} QueryParameterType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryParameterType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 5: { + message.timestampPrecision = reader.int64(); + break; + } + case 2: { + message.arrayType = $root.google.cloud.bigquery.v2.QueryParameterType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.structTypes && message.structTypes.length)) + message.structTypes = []; + message.structTypes.push($root.google.cloud.bigquery.v2.QueryParameterStructType.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.rangeElementType = $root.google.cloud.bigquery.v2.QueryParameterType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameterType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryParameterType} QueryParameterType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameterType message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameterType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) { + properties._timestampPrecision = 1; + if (!$util.isInteger(message.timestampPrecision) && !(message.timestampPrecision && $util.isInteger(message.timestampPrecision.low) && $util.isInteger(message.timestampPrecision.high))) + return "timestampPrecision: integer|Long expected"; + } + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterType.verify(message.arrayType, long + 1); + if (error) + return "arrayType." + error; + } + if (message.structTypes != null && Object.hasOwnProperty.call(message, "structTypes")) { + if (!Array.isArray(message.structTypes)) + return "structTypes: array expected"; + for (var i = 0; i < message.structTypes.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameterStructType.verify(message.structTypes[i], long + 1); + if (error) + return "structTypes." + error; + } + } + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterType.verify(message.rangeElementType, long + 1); + if (error) + return "rangeElementType." + error; + } + return null; + }; + + /** + * Creates a QueryParameterType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryParameterType} QueryParameterType + */ + QueryParameterType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryParameterType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryParameterType(); + if (object.type != null) + message.type = String(object.type); + if (object.timestampPrecision != null) + if ($util.Long) + message.timestampPrecision = $util.Long.fromValue(object.timestampPrecision, false); + else if (typeof object.timestampPrecision === "string") + message.timestampPrecision = parseInt(object.timestampPrecision, 10); + else if (typeof object.timestampPrecision === "number") + message.timestampPrecision = object.timestampPrecision; + else if (typeof object.timestampPrecision === "object") + message.timestampPrecision = new $util.LongBits(object.timestampPrecision.low >>> 0, object.timestampPrecision.high >>> 0).toNumber(); + if (object.arrayType != null) { + if (!$util.isObject(object.arrayType)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterType.arrayType: object expected"); + message.arrayType = $root.google.cloud.bigquery.v2.QueryParameterType.fromObject(object.arrayType, long + 1); + } + if (object.structTypes) { + if (!Array.isArray(object.structTypes)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterType.structTypes: array expected"); + message.structTypes = []; + for (var i = 0; i < object.structTypes.length; ++i) { + if (!$util.isObject(object.structTypes[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterType.structTypes: object expected"); + message.structTypes[i] = $root.google.cloud.bigquery.v2.QueryParameterStructType.fromObject(object.structTypes[i], long + 1); + } + } + if (object.rangeElementType != null) { + if (!$util.isObject(object.rangeElementType)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterType.rangeElementType: object expected"); + message.rangeElementType = $root.google.cloud.bigquery.v2.QueryParameterType.fromObject(object.rangeElementType, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a QueryParameterType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {google.cloud.bigquery.v2.QueryParameterType} message QueryParameterType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameterType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.structTypes = []; + if (options.defaults) { + object.type = ""; + object.arrayType = null; + object.rangeElementType = null; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) + object.arrayType = $root.google.cloud.bigquery.v2.QueryParameterType.toObject(message.arrayType, options, q + 1); + if (message.structTypes && message.structTypes.length) { + object.structTypes = []; + for (var j = 0; j < message.structTypes.length; ++j) + object.structTypes[j] = $root.google.cloud.bigquery.v2.QueryParameterStructType.toObject(message.structTypes[j], options, q + 1); + } + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) + object.rangeElementType = $root.google.cloud.bigquery.v2.QueryParameterType.toObject(message.rangeElementType, options, q + 1); + if (message.timestampPrecision != null && Object.hasOwnProperty.call(message, "timestampPrecision")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.timestampPrecision = typeof message.timestampPrecision === "number" ? BigInt(message.timestampPrecision) : $util.Long.fromBits(message.timestampPrecision.low >>> 0, message.timestampPrecision.high >>> 0, false).toBigInt(); + else if (typeof message.timestampPrecision === "number") + object.timestampPrecision = options.longs === String ? String(message.timestampPrecision) : message.timestampPrecision; + else + object.timestampPrecision = options.longs === String ? $util.Long.prototype.toString.call(message.timestampPrecision) : options.longs === Number ? new $util.LongBits(message.timestampPrecision.low >>> 0, message.timestampPrecision.high >>> 0).toNumber() : message.timestampPrecision; + if (options.oneofs) + object._timestampPrecision = "timestampPrecision"; + } + return object; + }; + + /** + * Converts this QueryParameterType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @instance + * @returns {Object.} JSON object + */ + QueryParameterType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameterType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryParameterType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameterType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryParameterType"; + }; + + return QueryParameterType; + })(); + + v2.RangeValue = (function() { + + /** + * Properties of a RangeValue. + * @memberof google.cloud.bigquery.v2 + * @interface IRangeValue + * @property {google.cloud.bigquery.v2.IQueryParameterValue|null} [start] RangeValue start + * @property {google.cloud.bigquery.v2.IQueryParameterValue|null} [end] RangeValue end + */ + + /** + * Constructs a new RangeValue. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RangeValue. + * @implements IRangeValue + * @constructor + * @param {google.cloud.bigquery.v2.IRangeValue=} [properties] Properties to set + */ + function RangeValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeValue start. + * @member {google.cloud.bigquery.v2.IQueryParameterValue|null|undefined} start + * @memberof google.cloud.bigquery.v2.RangeValue + * @instance + */ + RangeValue.prototype.start = null; + + /** + * RangeValue end. + * @member {google.cloud.bigquery.v2.IQueryParameterValue|null|undefined} end + * @memberof google.cloud.bigquery.v2.RangeValue + * @instance + */ + RangeValue.prototype.end = null; + + /** + * Creates a new RangeValue instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {google.cloud.bigquery.v2.IRangeValue=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RangeValue} RangeValue instance + */ + RangeValue.create = function create(properties) { + return new RangeValue(properties); + }; + + /** + * Encodes the specified RangeValue message. Does not implicitly {@link google.cloud.bigquery.v2.RangeValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {google.cloud.bigquery.v2.IRangeValue} message RangeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + $root.google.cloud.bigquery.v2.QueryParameterValue.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + $root.google.cloud.bigquery.v2.QueryParameterValue.encode(message.end, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RangeValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangeValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {google.cloud.bigquery.v2.IRangeValue} message RangeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RangeValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RangeValue} RangeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RangeValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = $root.google.cloud.bigquery.v2.QueryParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.end = $root.google.cloud.bigquery.v2.QueryParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RangeValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RangeValue} RangeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeValue message. + * @function verify + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterValue.verify(message.start, long + 1); + if (error) + return "start." + error; + } + if (message.end != null && Object.hasOwnProperty.call(message, "end")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterValue.verify(message.end, long + 1); + if (error) + return "end." + error; + } + return null; + }; + + /** + * Creates a RangeValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RangeValue} RangeValue + */ + RangeValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RangeValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RangeValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RangeValue(); + if (object.start != null) { + if (!$util.isObject(object.start)) + throw TypeError(".google.cloud.bigquery.v2.RangeValue.start: object expected"); + message.start = $root.google.cloud.bigquery.v2.QueryParameterValue.fromObject(object.start, long + 1); + } + if (object.end != null) { + if (!$util.isObject(object.end)) + throw TypeError(".google.cloud.bigquery.v2.RangeValue.end: object expected"); + message.end = $root.google.cloud.bigquery.v2.QueryParameterValue.fromObject(object.end, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RangeValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {google.cloud.bigquery.v2.RangeValue} message RangeValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = null; + object.end = null; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = $root.google.cloud.bigquery.v2.QueryParameterValue.toObject(message.start, options, q + 1); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = $root.google.cloud.bigquery.v2.QueryParameterValue.toObject(message.end, options, q + 1); + return object; + }; + + /** + * Converts this RangeValue to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RangeValue + * @instance + * @returns {Object.} JSON object + */ + RangeValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeValue + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RangeValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RangeValue"; + }; + + return RangeValue; + })(); + + v2.QueryParameterValue = (function() { + + /** + * Properties of a QueryParameterValue. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryParameterValue + * @property {google.protobuf.IStringValue|null} [value] QueryParameterValue value + * @property {Array.|null} [arrayValues] QueryParameterValue arrayValues + * @property {Object.|null} [structValues] QueryParameterValue structValues + * @property {google.cloud.bigquery.v2.IRangeValue|null} [rangeValue] QueryParameterValue rangeValue + * @property {Array.|null} [altStructValues] QueryParameterValue altStructValues + */ + + /** + * Constructs a new QueryParameterValue. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryParameterValue. + * @implements IQueryParameterValue + * @constructor + * @param {google.cloud.bigquery.v2.IQueryParameterValue=} [properties] Properties to set + */ + function QueryParameterValue(properties) { + this.arrayValues = []; + this.structValues = {}; + this.altStructValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameterValue value. + * @member {google.protobuf.IStringValue|null|undefined} value + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + */ + QueryParameterValue.prototype.value = null; + + /** + * QueryParameterValue arrayValues. + * @member {Array.} arrayValues + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + */ + QueryParameterValue.prototype.arrayValues = $util.emptyArray; + + /** + * QueryParameterValue structValues. + * @member {Object.} structValues + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + */ + QueryParameterValue.prototype.structValues = $util.emptyObject; + + /** + * QueryParameterValue rangeValue. + * @member {google.cloud.bigquery.v2.IRangeValue|null|undefined} rangeValue + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + */ + QueryParameterValue.prototype.rangeValue = null; + + /** + * QueryParameterValue altStructValues. + * @member {Array.} altStructValues + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + */ + QueryParameterValue.prototype.altStructValues = $util.emptyArray; + + /** + * Creates a new QueryParameterValue instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterValue=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryParameterValue} QueryParameterValue instance + */ + QueryParameterValue.create = function create(properties) { + return new QueryParameterValue(properties); + }; + + /** + * Encodes the specified QueryParameterValue message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterValue} message QueryParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.StringValue.encode(message.value, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.arrayValues != null && message.arrayValues.length) + for (var i = 0; i < message.arrayValues.length; ++i) + $root.google.cloud.bigquery.v2.QueryParameterValue.encode(message.arrayValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.structValues != null && Object.hasOwnProperty.call(message, "structValues")) + for (var keys = Object.keys(message.structValues), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.bigquery.v2.QueryParameterValue.encode(message.structValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + if (message.altStructValues != null && message.altStructValues.length) + for (var i = 0; i < message.altStructValues.length; ++i) + $root.google.protobuf.Value.encode(message.altStructValues[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.rangeValue != null && Object.hasOwnProperty.call(message, "rangeValue")) + $root.google.cloud.bigquery.v2.RangeValue.encode(message.rangeValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParameterValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameterValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {google.cloud.bigquery.v2.IQueryParameterValue} message QueryParameterValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryParameterValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryParameterValue} QueryParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryParameterValue(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.arrayValues && message.arrayValues.length)) + message.arrayValues = []; + message.arrayValues.push($root.google.cloud.bigquery.v2.QueryParameterValue.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (message.structValues === $util.emptyObject) + message.structValues = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.bigquery.v2.QueryParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.structValues, key); + message.structValues[key] = value; + break; + } + case 6: { + message.rangeValue = $root.google.cloud.bigquery.v2.RangeValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + if (!(message.altStructValues && message.altStructValues.length)) + message.altStructValues = []; + message.altStructValues.push($root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameterValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryParameterValue} QueryParameterValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameterValue message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameterValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { + var error = $root.google.protobuf.StringValue.verify(message.value, long + 1); + if (error) + return "value." + error; + } + if (message.arrayValues != null && Object.hasOwnProperty.call(message, "arrayValues")) { + if (!Array.isArray(message.arrayValues)) + return "arrayValues: array expected"; + for (var i = 0; i < message.arrayValues.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameterValue.verify(message.arrayValues[i], long + 1); + if (error) + return "arrayValues." + error; + } + } + if (message.structValues != null && Object.hasOwnProperty.call(message, "structValues")) { + if (!$util.isObject(message.structValues)) + return "structValues: object expected"; + var key = Object.keys(message.structValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameterValue.verify(message.structValues[key[i]], long + 1); + if (error) + return "structValues." + error; + } + } + if (message.rangeValue != null && Object.hasOwnProperty.call(message, "rangeValue")) { + var error = $root.google.cloud.bigquery.v2.RangeValue.verify(message.rangeValue, long + 1); + if (error) + return "rangeValue." + error; + } + if (message.altStructValues != null && Object.hasOwnProperty.call(message, "altStructValues")) { + if (!Array.isArray(message.altStructValues)) + return "altStructValues: array expected"; + for (var i = 0; i < message.altStructValues.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.altStructValues[i], long + 1); + if (error) + return "altStructValues." + error; + } + } + return null; + }; + + /** + * Creates a QueryParameterValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryParameterValue} QueryParameterValue + */ + QueryParameterValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryParameterValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryParameterValue(); + if (object.value != null) { + if (!$util.isObject(object.value)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.value: object expected"); + message.value = $root.google.protobuf.StringValue.fromObject(object.value, long + 1); + } + if (object.arrayValues) { + if (!Array.isArray(object.arrayValues)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.arrayValues: array expected"); + message.arrayValues = []; + for (var i = 0; i < object.arrayValues.length; ++i) { + if (!$util.isObject(object.arrayValues[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.arrayValues: object expected"); + message.arrayValues[i] = $root.google.cloud.bigquery.v2.QueryParameterValue.fromObject(object.arrayValues[i], long + 1); + } + } + if (object.structValues) { + if (!$util.isObject(object.structValues)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.structValues: object expected"); + message.structValues = {}; + for (var keys = Object.keys(object.structValues), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.structValues, keys[i]); + if (!$util.isObject(object.structValues[keys[i]])) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.structValues: object expected"); + message.structValues[keys[i]] = $root.google.cloud.bigquery.v2.QueryParameterValue.fromObject(object.structValues[keys[i]], long + 1); + } + } + if (object.rangeValue != null) { + if (!$util.isObject(object.rangeValue)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.rangeValue: object expected"); + message.rangeValue = $root.google.cloud.bigquery.v2.RangeValue.fromObject(object.rangeValue, long + 1); + } + if (object.altStructValues) { + if (!Array.isArray(object.altStructValues)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.altStructValues: array expected"); + message.altStructValues = []; + for (var i = 0; i < object.altStructValues.length; ++i) { + if (!$util.isObject(object.altStructValues[i])) + throw TypeError(".google.cloud.bigquery.v2.QueryParameterValue.altStructValues: object expected"); + message.altStructValues[i] = $root.google.protobuf.Value.fromObject(object.altStructValues[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryParameterValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {google.cloud.bigquery.v2.QueryParameterValue} message QueryParameterValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameterValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.arrayValues = []; + object.altStructValues = []; + } + if (options.objects || options.defaults) + object.structValues = {}; + if (options.defaults) { + object.value = null; + object.rangeValue = null; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = $root.google.protobuf.StringValue.toObject(message.value, options, q + 1); + if (message.arrayValues && message.arrayValues.length) { + object.arrayValues = []; + for (var j = 0; j < message.arrayValues.length; ++j) + object.arrayValues[j] = $root.google.cloud.bigquery.v2.QueryParameterValue.toObject(message.arrayValues[j], options, q + 1); + } + var keys2; + if (message.structValues && (keys2 = Object.keys(message.structValues)).length) { + object.structValues = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.structValues, keys2[j]); + object.structValues[keys2[j]] = $root.google.cloud.bigquery.v2.QueryParameterValue.toObject(message.structValues[keys2[j]], options, q + 1); + } + } + if (message.altStructValues && message.altStructValues.length) { + object.altStructValues = []; + for (var j = 0; j < message.altStructValues.length; ++j) + object.altStructValues[j] = $root.google.protobuf.Value.toObject(message.altStructValues[j], options, q + 1); + } + if (message.rangeValue != null && Object.hasOwnProperty.call(message, "rangeValue")) + object.rangeValue = $root.google.cloud.bigquery.v2.RangeValue.toObject(message.rangeValue, options, q + 1); + return object; + }; + + /** + * Converts this QueryParameterValue to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @instance + * @returns {Object.} JSON object + */ + QueryParameterValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameterValue + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryParameterValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameterValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryParameterValue"; + }; + + return QueryParameterValue; + })(); + + v2.QueryParameter = (function() { + + /** + * Properties of a QueryParameter. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryParameter + * @property {string|null} [name] QueryParameter name + * @property {google.cloud.bigquery.v2.IQueryParameterType|null} [parameterType] QueryParameter parameterType + * @property {google.cloud.bigquery.v2.IQueryParameterValue|null} [parameterValue] QueryParameter parameterValue + */ + + /** + * Constructs a new QueryParameter. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryParameter. + * @implements IQueryParameter + * @constructor + * @param {google.cloud.bigquery.v2.IQueryParameter=} [properties] Properties to set + */ + function QueryParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameter name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.QueryParameter + * @instance + */ + QueryParameter.prototype.name = ""; + + /** + * QueryParameter parameterType. + * @member {google.cloud.bigquery.v2.IQueryParameterType|null|undefined} parameterType + * @memberof google.cloud.bigquery.v2.QueryParameter + * @instance + */ + QueryParameter.prototype.parameterType = null; + + /** + * QueryParameter parameterValue. + * @member {google.cloud.bigquery.v2.IQueryParameterValue|null|undefined} parameterValue + * @memberof google.cloud.bigquery.v2.QueryParameter + * @instance + */ + QueryParameter.prototype.parameterValue = null; + + /** + * Creates a new QueryParameter instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {google.cloud.bigquery.v2.IQueryParameter=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryParameter} QueryParameter instance + */ + QueryParameter.create = function create(properties) { + return new QueryParameter(properties); + }; + + /** + * Encodes the specified QueryParameter message. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {google.cloud.bigquery.v2.IQueryParameter} message QueryParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameter.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parameterType != null && Object.hasOwnProperty.call(message, "parameterType")) + $root.google.cloud.bigquery.v2.QueryParameterType.encode(message.parameterType, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.parameterValue != null && Object.hasOwnProperty.call(message, "parameterValue")) + $root.google.cloud.bigquery.v2.QueryParameterValue.encode(message.parameterValue, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParameter message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {google.cloud.bigquery.v2.IQueryParameter} message QueryParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryParameter} QueryParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameter.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parameterType = $root.google.cloud.bigquery.v2.QueryParameterType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.parameterValue = $root.google.cloud.bigquery.v2.QueryParameterValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryParameter} QueryParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameter message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameter.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parameterType != null && Object.hasOwnProperty.call(message, "parameterType")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterType.verify(message.parameterType, long + 1); + if (error) + return "parameterType." + error; + } + if (message.parameterValue != null && Object.hasOwnProperty.call(message, "parameterValue")) { + var error = $root.google.cloud.bigquery.v2.QueryParameterValue.verify(message.parameterValue, long + 1); + if (error) + return "parameterValue." + error; + } + return null; + }; + + /** + * Creates a QueryParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryParameter} QueryParameter + */ + QueryParameter.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryParameter) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameter: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryParameter(); + if (object.name != null) + message.name = String(object.name); + if (object.parameterType != null) { + if (!$util.isObject(object.parameterType)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameter.parameterType: object expected"); + message.parameterType = $root.google.cloud.bigquery.v2.QueryParameterType.fromObject(object.parameterType, long + 1); + } + if (object.parameterValue != null) { + if (!$util.isObject(object.parameterValue)) + throw TypeError(".google.cloud.bigquery.v2.QueryParameter.parameterValue: object expected"); + message.parameterValue = $root.google.cloud.bigquery.v2.QueryParameterValue.fromObject(object.parameterValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a QueryParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {google.cloud.bigquery.v2.QueryParameter} message QueryParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameter.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.parameterType = null; + object.parameterValue = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.parameterType != null && Object.hasOwnProperty.call(message, "parameterType")) + object.parameterType = $root.google.cloud.bigquery.v2.QueryParameterType.toObject(message.parameterType, options, q + 1); + if (message.parameterValue != null && Object.hasOwnProperty.call(message, "parameterValue")) + object.parameterValue = $root.google.cloud.bigquery.v2.QueryParameterValue.toObject(message.parameterValue, options, q + 1); + return object; + }; + + /** + * Converts this QueryParameter to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryParameter + * @instance + * @returns {Object.} JSON object + */ + QueryParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameter + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryParameter"; + }; + + return QueryParameter; + })(); + + v2.RangePartitioning = (function() { + + /** + * Properties of a RangePartitioning. + * @memberof google.cloud.bigquery.v2 + * @interface IRangePartitioning + * @property {string|null} [field] RangePartitioning field + * @property {google.cloud.bigquery.v2.RangePartitioning.IRange|null} [range] RangePartitioning range + */ + + /** + * Constructs a new RangePartitioning. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RangePartitioning. + * @implements IRangePartitioning + * @constructor + * @param {google.cloud.bigquery.v2.IRangePartitioning=} [properties] Properties to set + */ + function RangePartitioning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangePartitioning field. + * @member {string} field + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @instance + */ + RangePartitioning.prototype.field = ""; + + /** + * RangePartitioning range. + * @member {google.cloud.bigquery.v2.RangePartitioning.IRange|null|undefined} range + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @instance + */ + RangePartitioning.prototype.range = null; + + /** + * Creates a new RangePartitioning instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {google.cloud.bigquery.v2.IRangePartitioning=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RangePartitioning} RangePartitioning instance + */ + RangePartitioning.create = function create(properties) { + return new RangePartitioning(properties); + }; + + /** + * Encodes the specified RangePartitioning message. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {google.cloud.bigquery.v2.IRangePartitioning} message RangePartitioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangePartitioning.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.bigquery.v2.RangePartitioning.Range.encode(message.range, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RangePartitioning message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {google.cloud.bigquery.v2.IRangePartitioning} message RangePartitioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangePartitioning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RangePartitioning message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RangePartitioning} RangePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangePartitioning.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RangePartitioning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.range = $root.google.cloud.bigquery.v2.RangePartitioning.Range.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RangePartitioning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RangePartitioning} RangePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangePartitioning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangePartitioning message. + * @function verify + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangePartitioning.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + var error = $root.google.cloud.bigquery.v2.RangePartitioning.Range.verify(message.range, long + 1); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates a RangePartitioning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RangePartitioning} RangePartitioning + */ + RangePartitioning.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RangePartitioning) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RangePartitioning: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RangePartitioning(); + if (object.field != null) + message.field = String(object.field); + if (object.range != null) { + if (!$util.isObject(object.range)) + throw TypeError(".google.cloud.bigquery.v2.RangePartitioning.range: object expected"); + message.range = $root.google.cloud.bigquery.v2.RangePartitioning.Range.fromObject(object.range, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RangePartitioning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {google.cloud.bigquery.v2.RangePartitioning} message RangePartitioning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangePartitioning.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.field = ""; + object.range = null; + } + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + object.field = message.field; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + object.range = $root.google.cloud.bigquery.v2.RangePartitioning.Range.toObject(message.range, options, q + 1); + return object; + }; + + /** + * Converts this RangePartitioning to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @instance + * @returns {Object.} JSON object + */ + RangePartitioning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangePartitioning + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangePartitioning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RangePartitioning"; + }; + + RangePartitioning.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @interface IRange + * @property {string|null} [start] Range start + * @property {string|null} [end] Range end + * @property {string|null} [interval] Range interval + */ + + /** + * Constructs a new Range. + * @memberof google.cloud.bigquery.v2.RangePartitioning + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.cloud.bigquery.v2.RangePartitioning.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range start. + * @member {string} start + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @instance + */ + Range.prototype.start = ""; + + /** + * Range end. + * @member {string} end + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @instance + */ + Range.prototype.end = ""; + + /** + * Range interval. + * @member {string} interval + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @instance + */ + Range.prototype.interval = ""; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {google.cloud.bigquery.v2.RangePartitioning.IRange=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RangePartitioning.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.Range.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {google.cloud.bigquery.v2.RangePartitioning.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.interval); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RangePartitioning.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {google.cloud.bigquery.v2.RangePartitioning.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RangePartitioning.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RangePartitioning.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.string(); + break; + } + case 2: { + message.end = reader.string(); + break; + } + case 3: { + message.interval = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RangePartitioning.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isString(message.start)) + return "start: string expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isString(message.end)) + return "end: string expected"; + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + if (!$util.isString(message.interval)) + return "interval: string expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RangePartitioning.Range} Range + */ + Range.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RangePartitioning.Range) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RangePartitioning.Range: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RangePartitioning.Range(); + if (object.start != null) + message.start = String(object.start); + if (object.end != null) + message.end = String(object.end); + if (object.interval != null) + message.interval = String(object.interval); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {google.cloud.bigquery.v2.RangePartitioning.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = ""; + object.end = ""; + object.interval = ""; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + object.interval = message.interval; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RangePartitioning.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RangePartitioning.Range"; + }; + + return Range; + })(); + + return RangePartitioning; + })(); + + v2.SystemVariables = (function() { + + /** + * Properties of a SystemVariables. + * @memberof google.cloud.bigquery.v2 + * @interface ISystemVariables + * @property {Object.|null} [types] SystemVariables types + * @property {google.protobuf.IStruct|null} [values] SystemVariables values + */ + + /** + * Constructs a new SystemVariables. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SystemVariables. + * @implements ISystemVariables + * @constructor + * @param {google.cloud.bigquery.v2.ISystemVariables=} [properties] Properties to set + */ + function SystemVariables(properties) { + this.types = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SystemVariables types. + * @member {Object.} types + * @memberof google.cloud.bigquery.v2.SystemVariables + * @instance + */ + SystemVariables.prototype.types = $util.emptyObject; + + /** + * SystemVariables values. + * @member {google.protobuf.IStruct|null|undefined} values + * @memberof google.cloud.bigquery.v2.SystemVariables + * @instance + */ + SystemVariables.prototype.values = null; + + /** + * Creates a new SystemVariables instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {google.cloud.bigquery.v2.ISystemVariables=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SystemVariables} SystemVariables instance + */ + SystemVariables.create = function create(properties) { + return new SystemVariables(properties); + }; + + /** + * Encodes the specified SystemVariables message. Does not implicitly {@link google.cloud.bigquery.v2.SystemVariables.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {google.cloud.bigquery.v2.ISystemVariables} message SystemVariables message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemVariables.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.types != null && Object.hasOwnProperty.call(message, "types")) + for (var keys = Object.keys(message.types), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.types[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + $root.google.protobuf.Struct.encode(message.values, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified SystemVariables message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SystemVariables.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {google.cloud.bigquery.v2.ISystemVariables} message SystemVariables message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemVariables.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SystemVariables message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SystemVariables} SystemVariables + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemVariables.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SystemVariables(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.types === $util.emptyObject) + message.types = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.types, key); + message.types[key] = value; + break; + } + case 2: { + message.values = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SystemVariables message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SystemVariables} SystemVariables + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemVariables.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SystemVariables message. + * @function verify + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SystemVariables.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.types != null && Object.hasOwnProperty.call(message, "types")) { + if (!$util.isObject(message.types)) + return "types: object expected"; + var key = Object.keys(message.types); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.types[key[i]], long + 1); + if (error) + return "types." + error; + } + } + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { + var error = $root.google.protobuf.Struct.verify(message.values, long + 1); + if (error) + return "values." + error; + } + return null; + }; + + /** + * Creates a SystemVariables message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SystemVariables} SystemVariables + */ + SystemVariables.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SystemVariables) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SystemVariables: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SystemVariables(); + if (object.types) { + if (!$util.isObject(object.types)) + throw TypeError(".google.cloud.bigquery.v2.SystemVariables.types: object expected"); + message.types = {}; + for (var keys = Object.keys(object.types), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.types, keys[i]); + if (!$util.isObject(object.types[keys[i]])) + throw TypeError(".google.cloud.bigquery.v2.SystemVariables.types: object expected"); + message.types[keys[i]] = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.types[keys[i]], long + 1); + } + } + if (object.values != null) { + if (!$util.isObject(object.values)) + throw TypeError(".google.cloud.bigquery.v2.SystemVariables.values: object expected"); + message.values = $root.google.protobuf.Struct.fromObject(object.values, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SystemVariables message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {google.cloud.bigquery.v2.SystemVariables} message SystemVariables + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SystemVariables.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.types = {}; + if (options.defaults) + object.values = null; + var keys2; + if (message.types && (keys2 = Object.keys(message.types)).length) { + object.types = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.types, keys2[j]); + object.types[keys2[j]] = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.types[keys2[j]], options, q + 1); + } + } + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + object.values = $root.google.protobuf.Struct.toObject(message.values, options, q + 1); + return object; + }; + + /** + * Converts this SystemVariables to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SystemVariables + * @instance + * @returns {Object.} JSON object + */ + SystemVariables.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SystemVariables + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SystemVariables + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemVariables.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SystemVariables"; + }; + + return SystemVariables; + })(); + + v2.StandardSqlDataType = (function() { + + /** + * Properties of a StandardSqlDataType. + * @memberof google.cloud.bigquery.v2 + * @interface IStandardSqlDataType + * @property {google.cloud.bigquery.v2.StandardSqlDataType.TypeKind|null} [typeKind] StandardSqlDataType typeKind + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [arrayElementType] StandardSqlDataType arrayElementType + * @property {google.cloud.bigquery.v2.IStandardSqlStructType|null} [structType] StandardSqlDataType structType + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [rangeElementType] StandardSqlDataType rangeElementType + */ + + /** + * Constructs a new StandardSqlDataType. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StandardSqlDataType. + * @implements IStandardSqlDataType + * @constructor + * @param {google.cloud.bigquery.v2.IStandardSqlDataType=} [properties] Properties to set + */ + function StandardSqlDataType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSqlDataType typeKind. + * @member {google.cloud.bigquery.v2.StandardSqlDataType.TypeKind} typeKind + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + */ + StandardSqlDataType.prototype.typeKind = 0; + + /** + * StandardSqlDataType arrayElementType. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} arrayElementType + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + */ + StandardSqlDataType.prototype.arrayElementType = null; + + /** + * StandardSqlDataType structType. + * @member {google.cloud.bigquery.v2.IStandardSqlStructType|null|undefined} structType + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + */ + StandardSqlDataType.prototype.structType = null; + + /** + * StandardSqlDataType rangeElementType. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} rangeElementType + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + */ + StandardSqlDataType.prototype.rangeElementType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StandardSqlDataType subType. + * @member {"arrayElementType"|"structType"|"rangeElementType"|undefined} subType + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + */ + Object.defineProperty(StandardSqlDataType.prototype, "subType", { + get: $util.oneOfGetter($oneOfFields = ["arrayElementType", "structType", "rangeElementType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StandardSqlDataType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlDataType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StandardSqlDataType} StandardSqlDataType instance + */ + StandardSqlDataType.create = function create(properties) { + return new StandardSqlDataType(properties); + }; + + /** + * Encodes the specified StandardSqlDataType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlDataType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlDataType} message StandardSqlDataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlDataType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.typeKind != null && Object.hasOwnProperty.call(message, "typeKind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.typeKind); + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.cloud.bigquery.v2.StandardSqlStructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.rangeElementType, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StandardSqlDataType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlDataType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlDataType} message StandardSqlDataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlDataType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StandardSqlDataType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StandardSqlDataType} StandardSqlDataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlDataType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StandardSqlDataType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.typeKind = reader.int32(); + break; + } + case 2: { + message.arrayElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.structType = $root.google.cloud.bigquery.v2.StandardSqlStructType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.rangeElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSqlDataType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StandardSqlDataType} StandardSqlDataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlDataType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSqlDataType message. + * @function verify + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSqlDataType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.typeKind != null && Object.hasOwnProperty.call(message, "typeKind")) + switch (message.typeKind) { + default: + return "typeKind: enum value expected"; + case 0: + case 2: + case 5: + case 7: + case 8: + case 9: + case 19: + case 10: + case 20: + case 21: + case 26: + case 22: + case 23: + case 24: + case 25: + case 16: + case 17: + case 29: + break; + } + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) { + properties.subType = 1; + { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.arrayElementType, long + 1); + if (error) + return "arrayElementType." + error; + } + } + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) { + if (properties.subType === 1) + return "subType: multiple values"; + properties.subType = 1; + { + var error = $root.google.cloud.bigquery.v2.StandardSqlStructType.verify(message.structType, long + 1); + if (error) + return "structType." + error; + } + } + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) { + if (properties.subType === 1) + return "subType: multiple values"; + properties.subType = 1; + { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.rangeElementType, long + 1); + if (error) + return "rangeElementType." + error; + } + } + return null; + }; + + /** + * Creates a StandardSqlDataType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StandardSqlDataType} StandardSqlDataType + */ + StandardSqlDataType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StandardSqlDataType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlDataType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StandardSqlDataType(); + switch (object.typeKind) { + default: + if (typeof object.typeKind === "number") { + message.typeKind = object.typeKind; + break; + } + break; + case "TYPE_KIND_UNSPECIFIED": + case 0: + message.typeKind = 0; + break; + case "INT64": + case 2: + message.typeKind = 2; + break; + case "BOOL": + case 5: + message.typeKind = 5; + break; + case "FLOAT64": + case 7: + message.typeKind = 7; + break; + case "STRING": + case 8: + message.typeKind = 8; + break; + case "BYTES": + case 9: + message.typeKind = 9; + break; + case "TIMESTAMP": + case 19: + message.typeKind = 19; + break; + case "DATE": + case 10: + message.typeKind = 10; + break; + case "TIME": + case 20: + message.typeKind = 20; + break; + case "DATETIME": + case 21: + message.typeKind = 21; + break; + case "INTERVAL": + case 26: + message.typeKind = 26; + break; + case "GEOGRAPHY": + case 22: + message.typeKind = 22; + break; + case "NUMERIC": + case 23: + message.typeKind = 23; + break; + case "BIGNUMERIC": + case 24: + message.typeKind = 24; + break; + case "JSON": + case 25: + message.typeKind = 25; + break; + case "ARRAY": + case 16: + message.typeKind = 16; + break; + case "STRUCT": + case 17: + message.typeKind = 17; + break; + case "RANGE": + case 29: + message.typeKind = 29; + break; + } + if (object.arrayElementType != null) { + if (!$util.isObject(object.arrayElementType)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlDataType.arrayElementType: object expected"); + message.arrayElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.arrayElementType, long + 1); + } + if (object.structType != null) { + if (!$util.isObject(object.structType)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlDataType.structType: object expected"); + message.structType = $root.google.cloud.bigquery.v2.StandardSqlStructType.fromObject(object.structType, long + 1); + } + if (object.rangeElementType != null) { + if (!$util.isObject(object.rangeElementType)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlDataType.rangeElementType: object expected"); + message.rangeElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.rangeElementType, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StandardSqlDataType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {google.cloud.bigquery.v2.StandardSqlDataType} message StandardSqlDataType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSqlDataType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.typeKind = options.enums === String ? "TYPE_KIND_UNSPECIFIED" : 0; + if (message.typeKind != null && Object.hasOwnProperty.call(message, "typeKind")) + object.typeKind = options.enums === String ? $root.google.cloud.bigquery.v2.StandardSqlDataType.TypeKind[message.typeKind] === undefined ? message.typeKind : $root.google.cloud.bigquery.v2.StandardSqlDataType.TypeKind[message.typeKind] : message.typeKind; + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) { + object.arrayElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.arrayElementType, options, q + 1); + if (options.oneofs) + object.subType = "arrayElementType"; + } + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) { + object.structType = $root.google.cloud.bigquery.v2.StandardSqlStructType.toObject(message.structType, options, q + 1); + if (options.oneofs) + object.subType = "structType"; + } + if (message.rangeElementType != null && Object.hasOwnProperty.call(message, "rangeElementType")) { + object.rangeElementType = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.rangeElementType, options, q + 1); + if (options.oneofs) + object.subType = "rangeElementType"; + } + return object; + }; + + /** + * Converts this StandardSqlDataType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @instance + * @returns {Object.} JSON object + */ + StandardSqlDataType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSqlDataType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StandardSqlDataType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSqlDataType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StandardSqlDataType"; + }; + + /** + * TypeKind enum. + * @name google.cloud.bigquery.v2.StandardSqlDataType.TypeKind + * @enum {number} + * @property {number} TYPE_KIND_UNSPECIFIED=0 TYPE_KIND_UNSPECIFIED value + * @property {number} INT64=2 INT64 value + * @property {number} BOOL=5 BOOL value + * @property {number} FLOAT64=7 FLOAT64 value + * @property {number} STRING=8 STRING value + * @property {number} BYTES=9 BYTES value + * @property {number} TIMESTAMP=19 TIMESTAMP value + * @property {number} DATE=10 DATE value + * @property {number} TIME=20 TIME value + * @property {number} DATETIME=21 DATETIME value + * @property {number} INTERVAL=26 INTERVAL value + * @property {number} GEOGRAPHY=22 GEOGRAPHY value + * @property {number} NUMERIC=23 NUMERIC value + * @property {number} BIGNUMERIC=24 BIGNUMERIC value + * @property {number} JSON=25 JSON value + * @property {number} ARRAY=16 ARRAY value + * @property {number} STRUCT=17 STRUCT value + * @property {number} RANGE=29 RANGE value + */ + StandardSqlDataType.TypeKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_KIND_UNSPECIFIED"] = 0; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[5] = "BOOL"] = 5; + values[valuesById[7] = "FLOAT64"] = 7; + values[valuesById[8] = "STRING"] = 8; + values[valuesById[9] = "BYTES"] = 9; + values[valuesById[19] = "TIMESTAMP"] = 19; + values[valuesById[10] = "DATE"] = 10; + values[valuesById[20] = "TIME"] = 20; + values[valuesById[21] = "DATETIME"] = 21; + values[valuesById[26] = "INTERVAL"] = 26; + values[valuesById[22] = "GEOGRAPHY"] = 22; + values[valuesById[23] = "NUMERIC"] = 23; + values[valuesById[24] = "BIGNUMERIC"] = 24; + values[valuesById[25] = "JSON"] = 25; + values[valuesById[16] = "ARRAY"] = 16; + values[valuesById[17] = "STRUCT"] = 17; + values[valuesById[29] = "RANGE"] = 29; + return values; + })(); + + return StandardSqlDataType; + })(); + + v2.StandardSqlField = (function() { + + /** + * Properties of a StandardSqlField. + * @memberof google.cloud.bigquery.v2 + * @interface IStandardSqlField + * @property {string|null} [name] StandardSqlField name + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [type] StandardSqlField type + */ + + /** + * Constructs a new StandardSqlField. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StandardSqlField. + * @implements IStandardSqlField + * @constructor + * @param {google.cloud.bigquery.v2.IStandardSqlField=} [properties] Properties to set + */ + function StandardSqlField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSqlField name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @instance + */ + StandardSqlField.prototype.name = ""; + + /** + * StandardSqlField type. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} type + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @instance + */ + StandardSqlField.prototype.type = null; + + /** + * Creates a new StandardSqlField instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlField=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StandardSqlField} StandardSqlField instance + */ + StandardSqlField.create = function create(properties) { + return new StandardSqlField(properties); + }; + + /** + * Encodes the specified StandardSqlField message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlField.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlField} message StandardSqlField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlField.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StandardSqlField message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlField} message StandardSqlField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StandardSqlField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StandardSqlField} StandardSqlField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlField.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StandardSqlField(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSqlField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StandardSqlField} StandardSqlField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSqlField message. + * @function verify + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSqlField.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.type, long + 1); + if (error) + return "type." + error; + } + return null; + }; + + /** + * Creates a StandardSqlField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StandardSqlField} StandardSqlField + */ + StandardSqlField.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StandardSqlField) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlField: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StandardSqlField(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (!$util.isObject(object.type)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlField.type: object expected"); + message.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.type, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StandardSqlField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {google.cloud.bigquery.v2.StandardSqlField} message StandardSqlField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSqlField.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.type, options, q + 1); + return object; + }; + + /** + * Converts this StandardSqlField to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @instance + * @returns {Object.} JSON object + */ + StandardSqlField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSqlField + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StandardSqlField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSqlField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StandardSqlField"; + }; + + return StandardSqlField; + })(); + + v2.StandardSqlStructType = (function() { + + /** + * Properties of a StandardSqlStructType. + * @memberof google.cloud.bigquery.v2 + * @interface IStandardSqlStructType + * @property {Array.|null} [fields] StandardSqlStructType fields + */ + + /** + * Constructs a new StandardSqlStructType. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StandardSqlStructType. + * @implements IStandardSqlStructType + * @constructor + * @param {google.cloud.bigquery.v2.IStandardSqlStructType=} [properties] Properties to set + */ + function StandardSqlStructType(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSqlStructType fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @instance + */ + StandardSqlStructType.prototype.fields = $util.emptyArray; + + /** + * Creates a new StandardSqlStructType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlStructType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StandardSqlStructType} StandardSqlStructType instance + */ + StandardSqlStructType.create = function create(properties) { + return new StandardSqlStructType(properties); + }; + + /** + * Encodes the specified StandardSqlStructType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlStructType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlStructType} message StandardSqlStructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlStructType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.v2.StandardSqlField.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StandardSqlStructType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlStructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlStructType} message StandardSqlStructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlStructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StandardSqlStructType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StandardSqlStructType} StandardSqlStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlStructType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StandardSqlStructType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.v2.StandardSqlField.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSqlStructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StandardSqlStructType} StandardSqlStructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlStructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSqlStructType message. + * @function verify + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSqlStructType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StandardSqlField.verify(message.fields[i], long + 1); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a StandardSqlStructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StandardSqlStructType} StandardSqlStructType + */ + StandardSqlStructType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StandardSqlStructType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlStructType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StandardSqlStructType(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlStructType.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (!$util.isObject(object.fields[i])) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlStructType.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.v2.StandardSqlField.fromObject(object.fields[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a StandardSqlStructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {google.cloud.bigquery.v2.StandardSqlStructType} message StandardSqlStructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSqlStructType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.v2.StandardSqlField.toObject(message.fields[j], options, q + 1); + } + return object; + }; + + /** + * Converts this StandardSqlStructType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @instance + * @returns {Object.} JSON object + */ + StandardSqlStructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSqlStructType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StandardSqlStructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSqlStructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StandardSqlStructType"; + }; + + return StandardSqlStructType; + })(); + + v2.StandardSqlTableType = (function() { + + /** + * Properties of a StandardSqlTableType. + * @memberof google.cloud.bigquery.v2 + * @interface IStandardSqlTableType + * @property {Array.|null} [columns] StandardSqlTableType columns + */ + + /** + * Constructs a new StandardSqlTableType. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StandardSqlTableType. + * @implements IStandardSqlTableType + * @constructor + * @param {google.cloud.bigquery.v2.IStandardSqlTableType=} [properties] Properties to set + */ + function StandardSqlTableType(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSqlTableType columns. + * @member {Array.} columns + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @instance + */ + StandardSqlTableType.prototype.columns = $util.emptyArray; + + /** + * Creates a new StandardSqlTableType instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlTableType=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StandardSqlTableType} StandardSqlTableType instance + */ + StandardSqlTableType.create = function create(properties) { + return new StandardSqlTableType(properties); + }; + + /** + * Encodes the specified StandardSqlTableType message. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlTableType.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlTableType} message StandardSqlTableType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlTableType.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.bigquery.v2.StandardSqlField.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StandardSqlTableType message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StandardSqlTableType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {google.cloud.bigquery.v2.IStandardSqlTableType} message StandardSqlTableType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSqlTableType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StandardSqlTableType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StandardSqlTableType} StandardSqlTableType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlTableType.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StandardSqlTableType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.bigquery.v2.StandardSqlField.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSqlTableType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StandardSqlTableType} StandardSqlTableType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSqlTableType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSqlTableType message. + * @function verify + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSqlTableType.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StandardSqlField.verify(message.columns[i], long + 1); + if (error) + return "columns." + error; + } + } + return null; + }; + + /** + * Creates a StandardSqlTableType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StandardSqlTableType} StandardSqlTableType + */ + StandardSqlTableType.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StandardSqlTableType) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlTableType: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StandardSqlTableType(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlTableType.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (!$util.isObject(object.columns[i])) + throw TypeError(".google.cloud.bigquery.v2.StandardSqlTableType.columns: object expected"); + message.columns[i] = $root.google.cloud.bigquery.v2.StandardSqlField.fromObject(object.columns[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a StandardSqlTableType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {google.cloud.bigquery.v2.StandardSqlTableType} message StandardSqlTableType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSqlTableType.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.bigquery.v2.StandardSqlField.toObject(message.columns[j], options, q + 1); + } + return object; + }; + + /** + * Converts this StandardSqlTableType to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @instance + * @returns {Object.} JSON object + */ + StandardSqlTableType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSqlTableType + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StandardSqlTableType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSqlTableType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StandardSqlTableType"; + }; + + return StandardSqlTableType; + })(); + + v2.TimePartitioning = (function() { + + /** + * Properties of a TimePartitioning. + * @memberof google.cloud.bigquery.v2 + * @interface ITimePartitioning + * @property {string|null} [type] TimePartitioning type + * @property {google.protobuf.IInt64Value|null} [expirationMs] TimePartitioning expirationMs + * @property {google.protobuf.IStringValue|null} [field] TimePartitioning field + */ + + /** + * Constructs a new TimePartitioning. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TimePartitioning. + * @implements ITimePartitioning + * @constructor + * @param {google.cloud.bigquery.v2.ITimePartitioning=} [properties] Properties to set + */ + function TimePartitioning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimePartitioning type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @instance + */ + TimePartitioning.prototype.type = ""; + + /** + * TimePartitioning expirationMs. + * @member {google.protobuf.IInt64Value|null|undefined} expirationMs + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @instance + */ + TimePartitioning.prototype.expirationMs = null; + + /** + * TimePartitioning field. + * @member {google.protobuf.IStringValue|null|undefined} field + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @instance + */ + TimePartitioning.prototype.field = null; + + /** + * Creates a new TimePartitioning instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {google.cloud.bigquery.v2.ITimePartitioning=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TimePartitioning} TimePartitioning instance + */ + TimePartitioning.create = function create(properties) { + return new TimePartitioning(properties); + }; + + /** + * Encodes the specified TimePartitioning message. Does not implicitly {@link google.cloud.bigquery.v2.TimePartitioning.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {google.cloud.bigquery.v2.ITimePartitioning} message TimePartitioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimePartitioning.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.expirationMs != null && Object.hasOwnProperty.call(message, "expirationMs")) + $root.google.protobuf.Int64Value.encode(message.expirationMs, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + $root.google.protobuf.StringValue.encode(message.field, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimePartitioning message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TimePartitioning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {google.cloud.bigquery.v2.ITimePartitioning} message TimePartitioning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimePartitioning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TimePartitioning message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TimePartitioning} TimePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimePartitioning.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TimePartitioning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.expirationMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.field = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TimePartitioning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TimePartitioning} TimePartitioning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimePartitioning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimePartitioning message. + * @function verify + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimePartitioning.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.expirationMs != null && Object.hasOwnProperty.call(message, "expirationMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.expirationMs, long + 1); + if (error) + return "expirationMs." + error; + } + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + var error = $root.google.protobuf.StringValue.verify(message.field, long + 1); + if (error) + return "field." + error; + } + return null; + }; + + /** + * Creates a TimePartitioning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TimePartitioning} TimePartitioning + */ + TimePartitioning.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TimePartitioning) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TimePartitioning: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TimePartitioning(); + if (object.type != null) + message.type = String(object.type); + if (object.expirationMs != null) { + if (!$util.isObject(object.expirationMs)) + throw TypeError(".google.cloud.bigquery.v2.TimePartitioning.expirationMs: object expected"); + message.expirationMs = $root.google.protobuf.Int64Value.fromObject(object.expirationMs, long + 1); + } + if (object.field != null) { + if (!$util.isObject(object.field)) + throw TypeError(".google.cloud.bigquery.v2.TimePartitioning.field: object expected"); + message.field = $root.google.protobuf.StringValue.fromObject(object.field, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TimePartitioning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {google.cloud.bigquery.v2.TimePartitioning} message TimePartitioning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimePartitioning.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.type = ""; + object.expirationMs = null; + object.field = null; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.expirationMs != null && Object.hasOwnProperty.call(message, "expirationMs")) + object.expirationMs = $root.google.protobuf.Int64Value.toObject(message.expirationMs, options, q + 1); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + object.field = $root.google.protobuf.StringValue.toObject(message.field, options, q + 1); + return object; + }; + + /** + * Converts this TimePartitioning to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @instance + * @returns {Object.} JSON object + */ + TimePartitioning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimePartitioning + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TimePartitioning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimePartitioning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TimePartitioning"; + }; + + return TimePartitioning; + })(); + + v2.UserDefinedFunctionResource = (function() { + + /** + * Properties of a UserDefinedFunctionResource. + * @memberof google.cloud.bigquery.v2 + * @interface IUserDefinedFunctionResource + * @property {google.protobuf.IStringValue|null} [resourceUri] UserDefinedFunctionResource resourceUri + * @property {google.protobuf.IStringValue|null} [inlineCode] UserDefinedFunctionResource inlineCode + */ + + /** + * Constructs a new UserDefinedFunctionResource. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a UserDefinedFunctionResource. + * @implements IUserDefinedFunctionResource + * @constructor + * @param {google.cloud.bigquery.v2.IUserDefinedFunctionResource=} [properties] Properties to set + */ + function UserDefinedFunctionResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserDefinedFunctionResource resourceUri. + * @member {google.protobuf.IStringValue|null|undefined} resourceUri + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @instance + */ + UserDefinedFunctionResource.prototype.resourceUri = null; + + /** + * UserDefinedFunctionResource inlineCode. + * @member {google.protobuf.IStringValue|null|undefined} inlineCode + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @instance + */ + UserDefinedFunctionResource.prototype.inlineCode = null; + + /** + * Creates a new UserDefinedFunctionResource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {google.cloud.bigquery.v2.IUserDefinedFunctionResource=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UserDefinedFunctionResource} UserDefinedFunctionResource instance + */ + UserDefinedFunctionResource.create = function create(properties) { + return new UserDefinedFunctionResource(properties); + }; + + /** + * Encodes the specified UserDefinedFunctionResource message. Does not implicitly {@link google.cloud.bigquery.v2.UserDefinedFunctionResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {google.cloud.bigquery.v2.IUserDefinedFunctionResource} message UserDefinedFunctionResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserDefinedFunctionResource.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) + $root.google.protobuf.StringValue.encode(message.resourceUri, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.inlineCode != null && Object.hasOwnProperty.call(message, "inlineCode")) + $root.google.protobuf.StringValue.encode(message.inlineCode, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserDefinedFunctionResource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UserDefinedFunctionResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {google.cloud.bigquery.v2.IUserDefinedFunctionResource} message UserDefinedFunctionResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserDefinedFunctionResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a UserDefinedFunctionResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UserDefinedFunctionResource} UserDefinedFunctionResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserDefinedFunctionResource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UserDefinedFunctionResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceUri = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.inlineCode = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UserDefinedFunctionResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UserDefinedFunctionResource} UserDefinedFunctionResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserDefinedFunctionResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserDefinedFunctionResource message. + * @function verify + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserDefinedFunctionResource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) { + var error = $root.google.protobuf.StringValue.verify(message.resourceUri, long + 1); + if (error) + return "resourceUri." + error; + } + if (message.inlineCode != null && Object.hasOwnProperty.call(message, "inlineCode")) { + var error = $root.google.protobuf.StringValue.verify(message.inlineCode, long + 1); + if (error) + return "inlineCode." + error; + } + return null; + }; + + /** + * Creates a UserDefinedFunctionResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UserDefinedFunctionResource} UserDefinedFunctionResource + */ + UserDefinedFunctionResource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UserDefinedFunctionResource) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UserDefinedFunctionResource: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UserDefinedFunctionResource(); + if (object.resourceUri != null) { + if (!$util.isObject(object.resourceUri)) + throw TypeError(".google.cloud.bigquery.v2.UserDefinedFunctionResource.resourceUri: object expected"); + message.resourceUri = $root.google.protobuf.StringValue.fromObject(object.resourceUri, long + 1); + } + if (object.inlineCode != null) { + if (!$util.isObject(object.inlineCode)) + throw TypeError(".google.cloud.bigquery.v2.UserDefinedFunctionResource.inlineCode: object expected"); + message.inlineCode = $root.google.protobuf.StringValue.fromObject(object.inlineCode, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a UserDefinedFunctionResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {google.cloud.bigquery.v2.UserDefinedFunctionResource} message UserDefinedFunctionResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserDefinedFunctionResource.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.resourceUri = null; + object.inlineCode = null; + } + if (message.resourceUri != null && Object.hasOwnProperty.call(message, "resourceUri")) + object.resourceUri = $root.google.protobuf.StringValue.toObject(message.resourceUri, options, q + 1); + if (message.inlineCode != null && Object.hasOwnProperty.call(message, "inlineCode")) + object.inlineCode = $root.google.protobuf.StringValue.toObject(message.inlineCode, options, q + 1); + return object; + }; + + /** + * Converts this UserDefinedFunctionResource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @instance + * @returns {Object.} JSON object + */ + UserDefinedFunctionResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserDefinedFunctionResource + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UserDefinedFunctionResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserDefinedFunctionResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UserDefinedFunctionResource"; + }; + + return UserDefinedFunctionResource; + })(); + + v2.JobCreationReason = (function() { + + /** + * Properties of a JobCreationReason. + * @memberof google.cloud.bigquery.v2 + * @interface IJobCreationReason + * @property {google.cloud.bigquery.v2.JobCreationReason.Code|null} [code] JobCreationReason code + */ + + /** + * Constructs a new JobCreationReason. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobCreationReason. + * @implements IJobCreationReason + * @constructor + * @param {google.cloud.bigquery.v2.IJobCreationReason=} [properties] Properties to set + */ + function JobCreationReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobCreationReason code. + * @member {google.cloud.bigquery.v2.JobCreationReason.Code} code + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @instance + */ + JobCreationReason.prototype.code = 0; + + /** + * Creates a new JobCreationReason instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {google.cloud.bigquery.v2.IJobCreationReason=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobCreationReason} JobCreationReason instance + */ + JobCreationReason.create = function create(properties) { + return new JobCreationReason(properties); + }; + + /** + * Encodes the specified JobCreationReason message. Does not implicitly {@link google.cloud.bigquery.v2.JobCreationReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {google.cloud.bigquery.v2.IJobCreationReason} message JobCreationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobCreationReason.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + return writer; + }; + + /** + * Encodes the specified JobCreationReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobCreationReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {google.cloud.bigquery.v2.IJobCreationReason} message JobCreationReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobCreationReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobCreationReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobCreationReason} JobCreationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobCreationReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobCreationReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobCreationReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobCreationReason} JobCreationReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobCreationReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobCreationReason message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobCreationReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a JobCreationReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobCreationReason} JobCreationReason + */ + JobCreationReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobCreationReason) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobCreationReason: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobCreationReason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "REQUESTED": + case 1: + message.code = 1; + break; + case "LONG_RUNNING": + case 2: + message.code = 2; + break; + case "LARGE_RESULTS": + case 3: + message.code = 3; + break; + case "OTHER": + case 4: + message.code = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobCreationReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {google.cloud.bigquery.v2.JobCreationReason} message JobCreationReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobCreationReason.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + object.code = options.enums === String ? $root.google.cloud.bigquery.v2.JobCreationReason.Code[message.code] === undefined ? message.code : $root.google.cloud.bigquery.v2.JobCreationReason.Code[message.code] : message.code; + return object; + }; + + /** + * Converts this JobCreationReason to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @instance + * @returns {Object.} JSON object + */ + JobCreationReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobCreationReason + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobCreationReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobCreationReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobCreationReason"; + }; + + /** + * Code enum. + * @name google.cloud.bigquery.v2.JobCreationReason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} REQUESTED=1 REQUESTED value + * @property {number} LONG_RUNNING=2 LONG_RUNNING value + * @property {number} LARGE_RESULTS=3 LARGE_RESULTS value + * @property {number} OTHER=4 OTHER value + */ + JobCreationReason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUESTED"] = 1; + values[valuesById[2] = "LONG_RUNNING"] = 2; + values[valuesById[3] = "LARGE_RESULTS"] = 3; + values[valuesById[4] = "OTHER"] = 4; + return values; + })(); + + return JobCreationReason; + })(); + + v2.JobReference = (function() { + + /** + * Properties of a JobReference. + * @memberof google.cloud.bigquery.v2 + * @interface IJobReference + * @property {string|null} [projectId] JobReference projectId + * @property {string|null} [jobId] JobReference jobId + * @property {google.protobuf.IStringValue|null} [location] JobReference location + */ + + /** + * Constructs a new JobReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobReference. + * @implements IJobReference + * @constructor + * @param {google.cloud.bigquery.v2.IJobReference=} [properties] Properties to set + */ + function JobReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.JobReference + * @instance + */ + JobReference.prototype.projectId = ""; + + /** + * JobReference jobId. + * @member {string} jobId + * @memberof google.cloud.bigquery.v2.JobReference + * @instance + */ + JobReference.prototype.jobId = ""; + + /** + * JobReference location. + * @member {google.protobuf.IStringValue|null|undefined} location + * @memberof google.cloud.bigquery.v2.JobReference + * @instance + */ + JobReference.prototype.location = null; + + /** + * Creates a new JobReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {google.cloud.bigquery.v2.IJobReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobReference} JobReference instance + */ + JobReference.create = function create(properties) { + return new JobReference(properties); + }; + + /** + * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.bigquery.v2.JobReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {google.cloud.bigquery.v2.IJobReference} message JobReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.protobuf.StringValue.encode(message.location, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {google.cloud.bigquery.v2.IJobReference} message JobReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobReference} JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobReference} JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) { + var error = $root.google.protobuf.StringValue.verify(message.location, long + 1); + if (error) + return "location." + error; + } + return null; + }; + + /** + * Creates a JobReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobReference} JobReference + */ + JobReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) { + if (!$util.isObject(object.location)) + throw TypeError(".google.cloud.bigquery.v2.JobReference.location: object expected"); + message.location = $root.google.protobuf.StringValue.fromObject(object.location, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JobReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {google.cloud.bigquery.v2.JobReference} message JobReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + object.jobId = message.jobId; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = $root.google.protobuf.StringValue.toObject(message.location, options, q + 1); + return object; + }; + + /** + * Converts this JobReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobReference + * @instance + * @returns {Object.} JSON object + */ + JobReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobReference"; + }; + + return JobReference; + })(); + + v2.ExplainQueryStep = (function() { + + /** + * Properties of an ExplainQueryStep. + * @memberof google.cloud.bigquery.v2 + * @interface IExplainQueryStep + * @property {string|null} [kind] ExplainQueryStep kind + * @property {Array.|null} [substeps] ExplainQueryStep substeps + */ + + /** + * Constructs a new ExplainQueryStep. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExplainQueryStep. + * @implements IExplainQueryStep + * @constructor + * @param {google.cloud.bigquery.v2.IExplainQueryStep=} [properties] Properties to set + */ + function ExplainQueryStep(properties) { + this.substeps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainQueryStep kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @instance + */ + ExplainQueryStep.prototype.kind = ""; + + /** + * ExplainQueryStep substeps. + * @member {Array.} substeps + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @instance + */ + ExplainQueryStep.prototype.substeps = $util.emptyArray; + + /** + * Creates a new ExplainQueryStep instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStep=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExplainQueryStep} ExplainQueryStep instance + */ + ExplainQueryStep.create = function create(properties) { + return new ExplainQueryStep(properties); + }; + + /** + * Encodes the specified ExplainQueryStep message. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStep.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStep} message ExplainQueryStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainQueryStep.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.substeps != null && message.substeps.length) + for (var i = 0; i < message.substeps.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.substeps[i]); + return writer; + }; + + /** + * Encodes the specified ExplainQueryStep message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStep} message ExplainQueryStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainQueryStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExplainQueryStep message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExplainQueryStep} ExplainQueryStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainQueryStep.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExplainQueryStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + if (!(message.substeps && message.substeps.length)) + message.substeps = []; + message.substeps.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainQueryStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExplainQueryStep} ExplainQueryStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainQueryStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainQueryStep message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainQueryStep.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.substeps != null && Object.hasOwnProperty.call(message, "substeps")) { + if (!Array.isArray(message.substeps)) + return "substeps: array expected"; + for (var i = 0; i < message.substeps.length; ++i) + if (!$util.isString(message.substeps[i])) + return "substeps: string[] expected"; + } + return null; + }; + + /** + * Creates an ExplainQueryStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExplainQueryStep} ExplainQueryStep + */ + ExplainQueryStep.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExplainQueryStep) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStep: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExplainQueryStep(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.substeps) { + if (!Array.isArray(object.substeps)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStep.substeps: array expected"); + message.substeps = []; + for (var i = 0; i < object.substeps.length; ++i) + message.substeps[i] = String(object.substeps[i]); + } + return message; + }; + + /** + * Creates a plain object from an ExplainQueryStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {google.cloud.bigquery.v2.ExplainQueryStep} message ExplainQueryStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainQueryStep.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.substeps = []; + if (options.defaults) + object.kind = ""; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.substeps && message.substeps.length) { + object.substeps = []; + for (var j = 0; j < message.substeps.length; ++j) + object.substeps[j] = message.substeps[j]; + } + return object; + }; + + /** + * Converts this ExplainQueryStep to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @instance + * @returns {Object.} JSON object + */ + ExplainQueryStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainQueryStep + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExplainQueryStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainQueryStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExplainQueryStep"; + }; + + return ExplainQueryStep; + })(); + + v2.ExplainQueryStage = (function() { + + /** + * Properties of an ExplainQueryStage. + * @memberof google.cloud.bigquery.v2 + * @interface IExplainQueryStage + * @property {string|null} [name] ExplainQueryStage name + * @property {google.protobuf.IInt64Value|null} [id] ExplainQueryStage id + * @property {number|Long|null} [startMs] ExplainQueryStage startMs + * @property {number|Long|null} [endMs] ExplainQueryStage endMs + * @property {Array.|null} [inputStages] ExplainQueryStage inputStages + * @property {google.protobuf.IDoubleValue|null} [waitRatioAvg] ExplainQueryStage waitRatioAvg + * @property {google.protobuf.IInt64Value|null} [waitMsAvg] ExplainQueryStage waitMsAvg + * @property {google.protobuf.IDoubleValue|null} [waitRatioMax] ExplainQueryStage waitRatioMax + * @property {google.protobuf.IInt64Value|null} [waitMsMax] ExplainQueryStage waitMsMax + * @property {google.protobuf.IDoubleValue|null} [readRatioAvg] ExplainQueryStage readRatioAvg + * @property {google.protobuf.IInt64Value|null} [readMsAvg] ExplainQueryStage readMsAvg + * @property {google.protobuf.IDoubleValue|null} [readRatioMax] ExplainQueryStage readRatioMax + * @property {google.protobuf.IInt64Value|null} [readMsMax] ExplainQueryStage readMsMax + * @property {google.protobuf.IDoubleValue|null} [computeRatioAvg] ExplainQueryStage computeRatioAvg + * @property {google.protobuf.IInt64Value|null} [computeMsAvg] ExplainQueryStage computeMsAvg + * @property {google.protobuf.IDoubleValue|null} [computeRatioMax] ExplainQueryStage computeRatioMax + * @property {google.protobuf.IInt64Value|null} [computeMsMax] ExplainQueryStage computeMsMax + * @property {google.protobuf.IDoubleValue|null} [writeRatioAvg] ExplainQueryStage writeRatioAvg + * @property {google.protobuf.IInt64Value|null} [writeMsAvg] ExplainQueryStage writeMsAvg + * @property {google.protobuf.IDoubleValue|null} [writeRatioMax] ExplainQueryStage writeRatioMax + * @property {google.protobuf.IInt64Value|null} [writeMsMax] ExplainQueryStage writeMsMax + * @property {google.protobuf.IInt64Value|null} [shuffleOutputBytes] ExplainQueryStage shuffleOutputBytes + * @property {google.protobuf.IInt64Value|null} [shuffleOutputBytesSpilled] ExplainQueryStage shuffleOutputBytesSpilled + * @property {google.protobuf.IInt64Value|null} [recordsRead] ExplainQueryStage recordsRead + * @property {google.protobuf.IInt64Value|null} [recordsWritten] ExplainQueryStage recordsWritten + * @property {google.protobuf.IInt64Value|null} [parallelInputs] ExplainQueryStage parallelInputs + * @property {google.protobuf.IInt64Value|null} [completedParallelInputs] ExplainQueryStage completedParallelInputs + * @property {string|null} [status] ExplainQueryStage status + * @property {Array.|null} [steps] ExplainQueryStage steps + * @property {google.protobuf.IInt64Value|null} [slotMs] ExplainQueryStage slotMs + * @property {google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode|null} [computeMode] ExplainQueryStage computeMode + */ + + /** + * Constructs a new ExplainQueryStage. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExplainQueryStage. + * @implements IExplainQueryStage + * @constructor + * @param {google.cloud.bigquery.v2.IExplainQueryStage=} [properties] Properties to set + */ + function ExplainQueryStage(properties) { + this.inputStages = []; + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainQueryStage name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.name = ""; + + /** + * ExplainQueryStage id. + * @member {google.protobuf.IInt64Value|null|undefined} id + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.id = null; + + /** + * ExplainQueryStage startMs. + * @member {number|Long} startMs + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.startMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExplainQueryStage endMs. + * @member {number|Long} endMs + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.endMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExplainQueryStage inputStages. + * @member {Array.} inputStages + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.inputStages = $util.emptyArray; + + /** + * ExplainQueryStage waitRatioAvg. + * @member {google.protobuf.IDoubleValue|null|undefined} waitRatioAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.waitRatioAvg = null; + + /** + * ExplainQueryStage waitMsAvg. + * @member {google.protobuf.IInt64Value|null|undefined} waitMsAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.waitMsAvg = null; + + /** + * ExplainQueryStage waitRatioMax. + * @member {google.protobuf.IDoubleValue|null|undefined} waitRatioMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.waitRatioMax = null; + + /** + * ExplainQueryStage waitMsMax. + * @member {google.protobuf.IInt64Value|null|undefined} waitMsMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.waitMsMax = null; + + /** + * ExplainQueryStage readRatioAvg. + * @member {google.protobuf.IDoubleValue|null|undefined} readRatioAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.readRatioAvg = null; + + /** + * ExplainQueryStage readMsAvg. + * @member {google.protobuf.IInt64Value|null|undefined} readMsAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.readMsAvg = null; + + /** + * ExplainQueryStage readRatioMax. + * @member {google.protobuf.IDoubleValue|null|undefined} readRatioMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.readRatioMax = null; + + /** + * ExplainQueryStage readMsMax. + * @member {google.protobuf.IInt64Value|null|undefined} readMsMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.readMsMax = null; + + /** + * ExplainQueryStage computeRatioAvg. + * @member {google.protobuf.IDoubleValue|null|undefined} computeRatioAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.computeRatioAvg = null; + + /** + * ExplainQueryStage computeMsAvg. + * @member {google.protobuf.IInt64Value|null|undefined} computeMsAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.computeMsAvg = null; + + /** + * ExplainQueryStage computeRatioMax. + * @member {google.protobuf.IDoubleValue|null|undefined} computeRatioMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.computeRatioMax = null; + + /** + * ExplainQueryStage computeMsMax. + * @member {google.protobuf.IInt64Value|null|undefined} computeMsMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.computeMsMax = null; + + /** + * ExplainQueryStage writeRatioAvg. + * @member {google.protobuf.IDoubleValue|null|undefined} writeRatioAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.writeRatioAvg = null; + + /** + * ExplainQueryStage writeMsAvg. + * @member {google.protobuf.IInt64Value|null|undefined} writeMsAvg + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.writeMsAvg = null; + + /** + * ExplainQueryStage writeRatioMax. + * @member {google.protobuf.IDoubleValue|null|undefined} writeRatioMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.writeRatioMax = null; + + /** + * ExplainQueryStage writeMsMax. + * @member {google.protobuf.IInt64Value|null|undefined} writeMsMax + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.writeMsMax = null; + + /** + * ExplainQueryStage shuffleOutputBytes. + * @member {google.protobuf.IInt64Value|null|undefined} shuffleOutputBytes + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.shuffleOutputBytes = null; + + /** + * ExplainQueryStage shuffleOutputBytesSpilled. + * @member {google.protobuf.IInt64Value|null|undefined} shuffleOutputBytesSpilled + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.shuffleOutputBytesSpilled = null; + + /** + * ExplainQueryStage recordsRead. + * @member {google.protobuf.IInt64Value|null|undefined} recordsRead + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.recordsRead = null; + + /** + * ExplainQueryStage recordsWritten. + * @member {google.protobuf.IInt64Value|null|undefined} recordsWritten + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.recordsWritten = null; + + /** + * ExplainQueryStage parallelInputs. + * @member {google.protobuf.IInt64Value|null|undefined} parallelInputs + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.parallelInputs = null; + + /** + * ExplainQueryStage completedParallelInputs. + * @member {google.protobuf.IInt64Value|null|undefined} completedParallelInputs + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.completedParallelInputs = null; + + /** + * ExplainQueryStage status. + * @member {string} status + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.status = ""; + + /** + * ExplainQueryStage steps. + * @member {Array.} steps + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.steps = $util.emptyArray; + + /** + * ExplainQueryStage slotMs. + * @member {google.protobuf.IInt64Value|null|undefined} slotMs + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.slotMs = null; + + /** + * ExplainQueryStage computeMode. + * @member {google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode} computeMode + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + */ + ExplainQueryStage.prototype.computeMode = 0; + + /** + * Creates a new ExplainQueryStage instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStage=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExplainQueryStage} ExplainQueryStage instance + */ + ExplainQueryStage.create = function create(properties) { + return new ExplainQueryStage(properties); + }; + + /** + * Encodes the specified ExplainQueryStage message. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStage.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStage} message ExplainQueryStage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainQueryStage.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + $root.google.protobuf.Int64Value.encode(message.id, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.startMs != null && Object.hasOwnProperty.call(message, "startMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.startMs); + if (message.endMs != null && Object.hasOwnProperty.call(message, "endMs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.endMs); + if (message.inputStages != null && message.inputStages.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.inputStages.length; ++i) + writer.int64(message.inputStages[i]); + writer.ldelim(); + } + if (message.waitRatioAvg != null && Object.hasOwnProperty.call(message, "waitRatioAvg")) + $root.google.protobuf.DoubleValue.encode(message.waitRatioAvg, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.waitMsAvg != null && Object.hasOwnProperty.call(message, "waitMsAvg")) + $root.google.protobuf.Int64Value.encode(message.waitMsAvg, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.waitRatioMax != null && Object.hasOwnProperty.call(message, "waitRatioMax")) + $root.google.protobuf.DoubleValue.encode(message.waitRatioMax, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.waitMsMax != null && Object.hasOwnProperty.call(message, "waitMsMax")) + $root.google.protobuf.Int64Value.encode(message.waitMsMax, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.readRatioAvg != null && Object.hasOwnProperty.call(message, "readRatioAvg")) + $root.google.protobuf.DoubleValue.encode(message.readRatioAvg, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.readMsAvg != null && Object.hasOwnProperty.call(message, "readMsAvg")) + $root.google.protobuf.Int64Value.encode(message.readMsAvg, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.readRatioMax != null && Object.hasOwnProperty.call(message, "readRatioMax")) + $root.google.protobuf.DoubleValue.encode(message.readRatioMax, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.readMsMax != null && Object.hasOwnProperty.call(message, "readMsMax")) + $root.google.protobuf.Int64Value.encode(message.readMsMax, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.computeRatioAvg != null && Object.hasOwnProperty.call(message, "computeRatioAvg")) + $root.google.protobuf.DoubleValue.encode(message.computeRatioAvg, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.computeMsAvg != null && Object.hasOwnProperty.call(message, "computeMsAvg")) + $root.google.protobuf.Int64Value.encode(message.computeMsAvg, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.computeRatioMax != null && Object.hasOwnProperty.call(message, "computeRatioMax")) + $root.google.protobuf.DoubleValue.encode(message.computeRatioMax, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.computeMsMax != null && Object.hasOwnProperty.call(message, "computeMsMax")) + $root.google.protobuf.Int64Value.encode(message.computeMsMax, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.writeRatioAvg != null && Object.hasOwnProperty.call(message, "writeRatioAvg")) + $root.google.protobuf.DoubleValue.encode(message.writeRatioAvg, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.writeMsAvg != null && Object.hasOwnProperty.call(message, "writeMsAvg")) + $root.google.protobuf.Int64Value.encode(message.writeMsAvg, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); + if (message.writeRatioMax != null && Object.hasOwnProperty.call(message, "writeRatioMax")) + $root.google.protobuf.DoubleValue.encode(message.writeRatioMax, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.writeMsMax != null && Object.hasOwnProperty.call(message, "writeMsMax")) + $root.google.protobuf.Int64Value.encode(message.writeMsMax, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.shuffleOutputBytes != null && Object.hasOwnProperty.call(message, "shuffleOutputBytes")) + $root.google.protobuf.Int64Value.encode(message.shuffleOutputBytes, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.shuffleOutputBytesSpilled != null && Object.hasOwnProperty.call(message, "shuffleOutputBytesSpilled")) + $root.google.protobuf.Int64Value.encode(message.shuffleOutputBytesSpilled, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.recordsRead != null && Object.hasOwnProperty.call(message, "recordsRead")) + $root.google.protobuf.Int64Value.encode(message.recordsRead, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.recordsWritten != null && Object.hasOwnProperty.call(message, "recordsWritten")) + $root.google.protobuf.Int64Value.encode(message.recordsWritten, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.parallelInputs != null && Object.hasOwnProperty.call(message, "parallelInputs")) + $root.google.protobuf.Int64Value.encode(message.parallelInputs, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.completedParallelInputs != null && Object.hasOwnProperty.call(message, "completedParallelInputs")) + $root.google.protobuf.Int64Value.encode(message.completedParallelInputs, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.status); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.bigquery.v2.ExplainQueryStep.encode(message.steps[i], writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) + $root.google.protobuf.Int64Value.encode(message.slotMs, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); + if (message.computeMode != null && Object.hasOwnProperty.call(message, "computeMode")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.computeMode); + return writer; + }; + + /** + * Encodes the specified ExplainQueryStage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExplainQueryStage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {google.cloud.bigquery.v2.IExplainQueryStage} message ExplainQueryStage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainQueryStage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExplainQueryStage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExplainQueryStage} ExplainQueryStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainQueryStage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExplainQueryStage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.startMs = reader.int64(); + break; + } + case 4: { + message.endMs = reader.int64(); + break; + } + case 5: { + if (!(message.inputStages && message.inputStages.length)) + message.inputStages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.inputStages.push(reader.int64()); + } else + message.inputStages.push(reader.int64()); + break; + } + case 6: { + message.waitRatioAvg = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.waitMsAvg = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.waitRatioMax = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.waitMsMax = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.readRatioAvg = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.readMsAvg = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.readRatioMax = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.readMsMax = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.computeRatioAvg = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.computeMsAvg = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.computeRatioMax = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.computeMsMax = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.writeRatioAvg = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.writeMsAvg = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.writeRatioMax = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.writeMsMax = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.shuffleOutputBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.shuffleOutputBytesSpilled = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.recordsRead = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.recordsWritten = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.parallelInputs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.completedParallelInputs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + message.status = reader.string(); + break; + } + case 29: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.bigquery.v2.ExplainQueryStep.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 30: { + message.slotMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.computeMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainQueryStage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExplainQueryStage} ExplainQueryStage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainQueryStage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainQueryStage message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainQueryStage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) { + var error = $root.google.protobuf.Int64Value.verify(message.id, long + 1); + if (error) + return "id." + error; + } + if (message.startMs != null && Object.hasOwnProperty.call(message, "startMs")) + if (!$util.isInteger(message.startMs) && !(message.startMs && $util.isInteger(message.startMs.low) && $util.isInteger(message.startMs.high))) + return "startMs: integer|Long expected"; + if (message.endMs != null && Object.hasOwnProperty.call(message, "endMs")) + if (!$util.isInteger(message.endMs) && !(message.endMs && $util.isInteger(message.endMs.low) && $util.isInteger(message.endMs.high))) + return "endMs: integer|Long expected"; + if (message.inputStages != null && Object.hasOwnProperty.call(message, "inputStages")) { + if (!Array.isArray(message.inputStages)) + return "inputStages: array expected"; + for (var i = 0; i < message.inputStages.length; ++i) + if (!$util.isInteger(message.inputStages[i]) && !(message.inputStages[i] && $util.isInteger(message.inputStages[i].low) && $util.isInteger(message.inputStages[i].high))) + return "inputStages: integer|Long[] expected"; + } + if (message.waitRatioAvg != null && Object.hasOwnProperty.call(message, "waitRatioAvg")) { + var error = $root.google.protobuf.DoubleValue.verify(message.waitRatioAvg, long + 1); + if (error) + return "waitRatioAvg." + error; + } + if (message.waitMsAvg != null && Object.hasOwnProperty.call(message, "waitMsAvg")) { + var error = $root.google.protobuf.Int64Value.verify(message.waitMsAvg, long + 1); + if (error) + return "waitMsAvg." + error; + } + if (message.waitRatioMax != null && Object.hasOwnProperty.call(message, "waitRatioMax")) { + var error = $root.google.protobuf.DoubleValue.verify(message.waitRatioMax, long + 1); + if (error) + return "waitRatioMax." + error; + } + if (message.waitMsMax != null && Object.hasOwnProperty.call(message, "waitMsMax")) { + var error = $root.google.protobuf.Int64Value.verify(message.waitMsMax, long + 1); + if (error) + return "waitMsMax." + error; + } + if (message.readRatioAvg != null && Object.hasOwnProperty.call(message, "readRatioAvg")) { + var error = $root.google.protobuf.DoubleValue.verify(message.readRatioAvg, long + 1); + if (error) + return "readRatioAvg." + error; + } + if (message.readMsAvg != null && Object.hasOwnProperty.call(message, "readMsAvg")) { + var error = $root.google.protobuf.Int64Value.verify(message.readMsAvg, long + 1); + if (error) + return "readMsAvg." + error; + } + if (message.readRatioMax != null && Object.hasOwnProperty.call(message, "readRatioMax")) { + var error = $root.google.protobuf.DoubleValue.verify(message.readRatioMax, long + 1); + if (error) + return "readRatioMax." + error; + } + if (message.readMsMax != null && Object.hasOwnProperty.call(message, "readMsMax")) { + var error = $root.google.protobuf.Int64Value.verify(message.readMsMax, long + 1); + if (error) + return "readMsMax." + error; + } + if (message.computeRatioAvg != null && Object.hasOwnProperty.call(message, "computeRatioAvg")) { + var error = $root.google.protobuf.DoubleValue.verify(message.computeRatioAvg, long + 1); + if (error) + return "computeRatioAvg." + error; + } + if (message.computeMsAvg != null && Object.hasOwnProperty.call(message, "computeMsAvg")) { + var error = $root.google.protobuf.Int64Value.verify(message.computeMsAvg, long + 1); + if (error) + return "computeMsAvg." + error; + } + if (message.computeRatioMax != null && Object.hasOwnProperty.call(message, "computeRatioMax")) { + var error = $root.google.protobuf.DoubleValue.verify(message.computeRatioMax, long + 1); + if (error) + return "computeRatioMax." + error; + } + if (message.computeMsMax != null && Object.hasOwnProperty.call(message, "computeMsMax")) { + var error = $root.google.protobuf.Int64Value.verify(message.computeMsMax, long + 1); + if (error) + return "computeMsMax." + error; + } + if (message.writeRatioAvg != null && Object.hasOwnProperty.call(message, "writeRatioAvg")) { + var error = $root.google.protobuf.DoubleValue.verify(message.writeRatioAvg, long + 1); + if (error) + return "writeRatioAvg." + error; + } + if (message.writeMsAvg != null && Object.hasOwnProperty.call(message, "writeMsAvg")) { + var error = $root.google.protobuf.Int64Value.verify(message.writeMsAvg, long + 1); + if (error) + return "writeMsAvg." + error; + } + if (message.writeRatioMax != null && Object.hasOwnProperty.call(message, "writeRatioMax")) { + var error = $root.google.protobuf.DoubleValue.verify(message.writeRatioMax, long + 1); + if (error) + return "writeRatioMax." + error; + } + if (message.writeMsMax != null && Object.hasOwnProperty.call(message, "writeMsMax")) { + var error = $root.google.protobuf.Int64Value.verify(message.writeMsMax, long + 1); + if (error) + return "writeMsMax." + error; + } + if (message.shuffleOutputBytes != null && Object.hasOwnProperty.call(message, "shuffleOutputBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.shuffleOutputBytes, long + 1); + if (error) + return "shuffleOutputBytes." + error; + } + if (message.shuffleOutputBytesSpilled != null && Object.hasOwnProperty.call(message, "shuffleOutputBytesSpilled")) { + var error = $root.google.protobuf.Int64Value.verify(message.shuffleOutputBytesSpilled, long + 1); + if (error) + return "shuffleOutputBytesSpilled." + error; + } + if (message.recordsRead != null && Object.hasOwnProperty.call(message, "recordsRead")) { + var error = $root.google.protobuf.Int64Value.verify(message.recordsRead, long + 1); + if (error) + return "recordsRead." + error; + } + if (message.recordsWritten != null && Object.hasOwnProperty.call(message, "recordsWritten")) { + var error = $root.google.protobuf.Int64Value.verify(message.recordsWritten, long + 1); + if (error) + return "recordsWritten." + error; + } + if (message.parallelInputs != null && Object.hasOwnProperty.call(message, "parallelInputs")) { + var error = $root.google.protobuf.Int64Value.verify(message.parallelInputs, long + 1); + if (error) + return "parallelInputs." + error; + } + if (message.completedParallelInputs != null && Object.hasOwnProperty.call(message, "completedParallelInputs")) { + var error = $root.google.protobuf.Int64Value.verify(message.completedParallelInputs, long + 1); + if (error) + return "completedParallelInputs." + error; + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + if (!$util.isString(message.status)) + return "status: string expected"; + if (message.steps != null && Object.hasOwnProperty.call(message, "steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ExplainQueryStep.verify(message.steps[i], long + 1); + if (error) + return "steps." + error; + } + } + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.slotMs, long + 1); + if (error) + return "slotMs." + error; + } + if (message.computeMode != null && Object.hasOwnProperty.call(message, "computeMode")) + switch (message.computeMode) { + default: + return "computeMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExplainQueryStage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExplainQueryStage} ExplainQueryStage + */ + ExplainQueryStage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExplainQueryStage) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExplainQueryStage(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) { + if (!$util.isObject(object.id)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.id: object expected"); + message.id = $root.google.protobuf.Int64Value.fromObject(object.id, long + 1); + } + if (object.startMs != null) + if ($util.Long) + message.startMs = $util.Long.fromValue(object.startMs, false); + else if (typeof object.startMs === "string") + message.startMs = parseInt(object.startMs, 10); + else if (typeof object.startMs === "number") + message.startMs = object.startMs; + else if (typeof object.startMs === "object") + message.startMs = new $util.LongBits(object.startMs.low >>> 0, object.startMs.high >>> 0).toNumber(); + if (object.endMs != null) + if ($util.Long) + message.endMs = $util.Long.fromValue(object.endMs, false); + else if (typeof object.endMs === "string") + message.endMs = parseInt(object.endMs, 10); + else if (typeof object.endMs === "number") + message.endMs = object.endMs; + else if (typeof object.endMs === "object") + message.endMs = new $util.LongBits(object.endMs.low >>> 0, object.endMs.high >>> 0).toNumber(); + if (object.inputStages) { + if (!Array.isArray(object.inputStages)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.inputStages: array expected"); + message.inputStages = []; + for (var i = 0; i < object.inputStages.length; ++i) + if ($util.Long) + message.inputStages[i] = $util.Long.fromValue(object.inputStages[i], false); + else if (typeof object.inputStages[i] === "string") + message.inputStages[i] = parseInt(object.inputStages[i], 10); + else if (typeof object.inputStages[i] === "number") + message.inputStages[i] = object.inputStages[i]; + else if (typeof object.inputStages[i] === "object") + message.inputStages[i] = new $util.LongBits(object.inputStages[i].low >>> 0, object.inputStages[i].high >>> 0).toNumber(); + } + if (object.waitRatioAvg != null) { + if (!$util.isObject(object.waitRatioAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.waitRatioAvg: object expected"); + message.waitRatioAvg = $root.google.protobuf.DoubleValue.fromObject(object.waitRatioAvg, long + 1); + } + if (object.waitMsAvg != null) { + if (!$util.isObject(object.waitMsAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.waitMsAvg: object expected"); + message.waitMsAvg = $root.google.protobuf.Int64Value.fromObject(object.waitMsAvg, long + 1); + } + if (object.waitRatioMax != null) { + if (!$util.isObject(object.waitRatioMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.waitRatioMax: object expected"); + message.waitRatioMax = $root.google.protobuf.DoubleValue.fromObject(object.waitRatioMax, long + 1); + } + if (object.waitMsMax != null) { + if (!$util.isObject(object.waitMsMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.waitMsMax: object expected"); + message.waitMsMax = $root.google.protobuf.Int64Value.fromObject(object.waitMsMax, long + 1); + } + if (object.readRatioAvg != null) { + if (!$util.isObject(object.readRatioAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.readRatioAvg: object expected"); + message.readRatioAvg = $root.google.protobuf.DoubleValue.fromObject(object.readRatioAvg, long + 1); + } + if (object.readMsAvg != null) { + if (!$util.isObject(object.readMsAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.readMsAvg: object expected"); + message.readMsAvg = $root.google.protobuf.Int64Value.fromObject(object.readMsAvg, long + 1); + } + if (object.readRatioMax != null) { + if (!$util.isObject(object.readRatioMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.readRatioMax: object expected"); + message.readRatioMax = $root.google.protobuf.DoubleValue.fromObject(object.readRatioMax, long + 1); + } + if (object.readMsMax != null) { + if (!$util.isObject(object.readMsMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.readMsMax: object expected"); + message.readMsMax = $root.google.protobuf.Int64Value.fromObject(object.readMsMax, long + 1); + } + if (object.computeRatioAvg != null) { + if (!$util.isObject(object.computeRatioAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.computeRatioAvg: object expected"); + message.computeRatioAvg = $root.google.protobuf.DoubleValue.fromObject(object.computeRatioAvg, long + 1); + } + if (object.computeMsAvg != null) { + if (!$util.isObject(object.computeMsAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.computeMsAvg: object expected"); + message.computeMsAvg = $root.google.protobuf.Int64Value.fromObject(object.computeMsAvg, long + 1); + } + if (object.computeRatioMax != null) { + if (!$util.isObject(object.computeRatioMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.computeRatioMax: object expected"); + message.computeRatioMax = $root.google.protobuf.DoubleValue.fromObject(object.computeRatioMax, long + 1); + } + if (object.computeMsMax != null) { + if (!$util.isObject(object.computeMsMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.computeMsMax: object expected"); + message.computeMsMax = $root.google.protobuf.Int64Value.fromObject(object.computeMsMax, long + 1); + } + if (object.writeRatioAvg != null) { + if (!$util.isObject(object.writeRatioAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.writeRatioAvg: object expected"); + message.writeRatioAvg = $root.google.protobuf.DoubleValue.fromObject(object.writeRatioAvg, long + 1); + } + if (object.writeMsAvg != null) { + if (!$util.isObject(object.writeMsAvg)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.writeMsAvg: object expected"); + message.writeMsAvg = $root.google.protobuf.Int64Value.fromObject(object.writeMsAvg, long + 1); + } + if (object.writeRatioMax != null) { + if (!$util.isObject(object.writeRatioMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.writeRatioMax: object expected"); + message.writeRatioMax = $root.google.protobuf.DoubleValue.fromObject(object.writeRatioMax, long + 1); + } + if (object.writeMsMax != null) { + if (!$util.isObject(object.writeMsMax)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.writeMsMax: object expected"); + message.writeMsMax = $root.google.protobuf.Int64Value.fromObject(object.writeMsMax, long + 1); + } + if (object.shuffleOutputBytes != null) { + if (!$util.isObject(object.shuffleOutputBytes)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.shuffleOutputBytes: object expected"); + message.shuffleOutputBytes = $root.google.protobuf.Int64Value.fromObject(object.shuffleOutputBytes, long + 1); + } + if (object.shuffleOutputBytesSpilled != null) { + if (!$util.isObject(object.shuffleOutputBytesSpilled)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.shuffleOutputBytesSpilled: object expected"); + message.shuffleOutputBytesSpilled = $root.google.protobuf.Int64Value.fromObject(object.shuffleOutputBytesSpilled, long + 1); + } + if (object.recordsRead != null) { + if (!$util.isObject(object.recordsRead)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.recordsRead: object expected"); + message.recordsRead = $root.google.protobuf.Int64Value.fromObject(object.recordsRead, long + 1); + } + if (object.recordsWritten != null) { + if (!$util.isObject(object.recordsWritten)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.recordsWritten: object expected"); + message.recordsWritten = $root.google.protobuf.Int64Value.fromObject(object.recordsWritten, long + 1); + } + if (object.parallelInputs != null) { + if (!$util.isObject(object.parallelInputs)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.parallelInputs: object expected"); + message.parallelInputs = $root.google.protobuf.Int64Value.fromObject(object.parallelInputs, long + 1); + } + if (object.completedParallelInputs != null) { + if (!$util.isObject(object.completedParallelInputs)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.completedParallelInputs: object expected"); + message.completedParallelInputs = $root.google.protobuf.Int64Value.fromObject(object.completedParallelInputs, long + 1); + } + if (object.status != null) + message.status = String(object.status); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (!$util.isObject(object.steps[i])) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.steps: object expected"); + message.steps[i] = $root.google.cloud.bigquery.v2.ExplainQueryStep.fromObject(object.steps[i], long + 1); + } + } + if (object.slotMs != null) { + if (!$util.isObject(object.slotMs)) + throw TypeError(".google.cloud.bigquery.v2.ExplainQueryStage.slotMs: object expected"); + message.slotMs = $root.google.protobuf.Int64Value.fromObject(object.slotMs, long + 1); + } + switch (object.computeMode) { + default: + if (typeof object.computeMode === "number") { + message.computeMode = object.computeMode; + break; + } + break; + case "COMPUTE_MODE_UNSPECIFIED": + case 0: + message.computeMode = 0; + break; + case "BIGQUERY": + case 1: + message.computeMode = 1; + break; + case "BI_ENGINE": + case 2: + message.computeMode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplainQueryStage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {google.cloud.bigquery.v2.ExplainQueryStage} message ExplainQueryStage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainQueryStage.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.inputStages = []; + object.steps = []; + } + if (options.defaults) { + object.name = ""; + object.id = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.startMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.endMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.waitRatioAvg = null; + object.waitMsAvg = null; + object.waitRatioMax = null; + object.waitMsMax = null; + object.readRatioAvg = null; + object.readMsAvg = null; + object.readRatioMax = null; + object.readMsMax = null; + object.computeRatioAvg = null; + object.computeMsAvg = null; + object.computeRatioMax = null; + object.computeMsMax = null; + object.writeRatioAvg = null; + object.writeMsAvg = null; + object.writeRatioMax = null; + object.writeMsMax = null; + object.shuffleOutputBytes = null; + object.shuffleOutputBytesSpilled = null; + object.recordsRead = null; + object.recordsWritten = null; + object.parallelInputs = null; + object.completedParallelInputs = null; + object.status = ""; + object.slotMs = null; + object.computeMode = options.enums === String ? "COMPUTE_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = $root.google.protobuf.Int64Value.toObject(message.id, options, q + 1); + if (message.startMs != null && Object.hasOwnProperty.call(message, "startMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.startMs = typeof message.startMs === "number" ? BigInt(message.startMs) : $util.Long.fromBits(message.startMs.low >>> 0, message.startMs.high >>> 0, false).toBigInt(); + else if (typeof message.startMs === "number") + object.startMs = options.longs === String ? String(message.startMs) : message.startMs; + else + object.startMs = options.longs === String ? $util.Long.prototype.toString.call(message.startMs) : options.longs === Number ? new $util.LongBits(message.startMs.low >>> 0, message.startMs.high >>> 0).toNumber() : message.startMs; + if (message.endMs != null && Object.hasOwnProperty.call(message, "endMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.endMs = typeof message.endMs === "number" ? BigInt(message.endMs) : $util.Long.fromBits(message.endMs.low >>> 0, message.endMs.high >>> 0, false).toBigInt(); + else if (typeof message.endMs === "number") + object.endMs = options.longs === String ? String(message.endMs) : message.endMs; + else + object.endMs = options.longs === String ? $util.Long.prototype.toString.call(message.endMs) : options.longs === Number ? new $util.LongBits(message.endMs.low >>> 0, message.endMs.high >>> 0).toNumber() : message.endMs; + if (message.inputStages && message.inputStages.length) { + object.inputStages = []; + for (var j = 0; j < message.inputStages.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.inputStages[j] = typeof message.inputStages[j] === "number" ? BigInt(message.inputStages[j]) : $util.Long.fromBits(message.inputStages[j].low >>> 0, message.inputStages[j].high >>> 0, false).toBigInt(); + else if (typeof message.inputStages[j] === "number") + object.inputStages[j] = options.longs === String ? String(message.inputStages[j]) : message.inputStages[j]; + else + object.inputStages[j] = options.longs === String ? $util.Long.prototype.toString.call(message.inputStages[j]) : options.longs === Number ? new $util.LongBits(message.inputStages[j].low >>> 0, message.inputStages[j].high >>> 0).toNumber() : message.inputStages[j]; + } + if (message.waitRatioAvg != null && Object.hasOwnProperty.call(message, "waitRatioAvg")) + object.waitRatioAvg = $root.google.protobuf.DoubleValue.toObject(message.waitRatioAvg, options, q + 1); + if (message.waitMsAvg != null && Object.hasOwnProperty.call(message, "waitMsAvg")) + object.waitMsAvg = $root.google.protobuf.Int64Value.toObject(message.waitMsAvg, options, q + 1); + if (message.waitRatioMax != null && Object.hasOwnProperty.call(message, "waitRatioMax")) + object.waitRatioMax = $root.google.protobuf.DoubleValue.toObject(message.waitRatioMax, options, q + 1); + if (message.waitMsMax != null && Object.hasOwnProperty.call(message, "waitMsMax")) + object.waitMsMax = $root.google.protobuf.Int64Value.toObject(message.waitMsMax, options, q + 1); + if (message.readRatioAvg != null && Object.hasOwnProperty.call(message, "readRatioAvg")) + object.readRatioAvg = $root.google.protobuf.DoubleValue.toObject(message.readRatioAvg, options, q + 1); + if (message.readMsAvg != null && Object.hasOwnProperty.call(message, "readMsAvg")) + object.readMsAvg = $root.google.protobuf.Int64Value.toObject(message.readMsAvg, options, q + 1); + if (message.readRatioMax != null && Object.hasOwnProperty.call(message, "readRatioMax")) + object.readRatioMax = $root.google.protobuf.DoubleValue.toObject(message.readRatioMax, options, q + 1); + if (message.readMsMax != null && Object.hasOwnProperty.call(message, "readMsMax")) + object.readMsMax = $root.google.protobuf.Int64Value.toObject(message.readMsMax, options, q + 1); + if (message.computeRatioAvg != null && Object.hasOwnProperty.call(message, "computeRatioAvg")) + object.computeRatioAvg = $root.google.protobuf.DoubleValue.toObject(message.computeRatioAvg, options, q + 1); + if (message.computeMsAvg != null && Object.hasOwnProperty.call(message, "computeMsAvg")) + object.computeMsAvg = $root.google.protobuf.Int64Value.toObject(message.computeMsAvg, options, q + 1); + if (message.computeRatioMax != null && Object.hasOwnProperty.call(message, "computeRatioMax")) + object.computeRatioMax = $root.google.protobuf.DoubleValue.toObject(message.computeRatioMax, options, q + 1); + if (message.computeMsMax != null && Object.hasOwnProperty.call(message, "computeMsMax")) + object.computeMsMax = $root.google.protobuf.Int64Value.toObject(message.computeMsMax, options, q + 1); + if (message.writeRatioAvg != null && Object.hasOwnProperty.call(message, "writeRatioAvg")) + object.writeRatioAvg = $root.google.protobuf.DoubleValue.toObject(message.writeRatioAvg, options, q + 1); + if (message.writeMsAvg != null && Object.hasOwnProperty.call(message, "writeMsAvg")) + object.writeMsAvg = $root.google.protobuf.Int64Value.toObject(message.writeMsAvg, options, q + 1); + if (message.writeRatioMax != null && Object.hasOwnProperty.call(message, "writeRatioMax")) + object.writeRatioMax = $root.google.protobuf.DoubleValue.toObject(message.writeRatioMax, options, q + 1); + if (message.writeMsMax != null && Object.hasOwnProperty.call(message, "writeMsMax")) + object.writeMsMax = $root.google.protobuf.Int64Value.toObject(message.writeMsMax, options, q + 1); + if (message.shuffleOutputBytes != null && Object.hasOwnProperty.call(message, "shuffleOutputBytes")) + object.shuffleOutputBytes = $root.google.protobuf.Int64Value.toObject(message.shuffleOutputBytes, options, q + 1); + if (message.shuffleOutputBytesSpilled != null && Object.hasOwnProperty.call(message, "shuffleOutputBytesSpilled")) + object.shuffleOutputBytesSpilled = $root.google.protobuf.Int64Value.toObject(message.shuffleOutputBytesSpilled, options, q + 1); + if (message.recordsRead != null && Object.hasOwnProperty.call(message, "recordsRead")) + object.recordsRead = $root.google.protobuf.Int64Value.toObject(message.recordsRead, options, q + 1); + if (message.recordsWritten != null && Object.hasOwnProperty.call(message, "recordsWritten")) + object.recordsWritten = $root.google.protobuf.Int64Value.toObject(message.recordsWritten, options, q + 1); + if (message.parallelInputs != null && Object.hasOwnProperty.call(message, "parallelInputs")) + object.parallelInputs = $root.google.protobuf.Int64Value.toObject(message.parallelInputs, options, q + 1); + if (message.completedParallelInputs != null && Object.hasOwnProperty.call(message, "completedParallelInputs")) + object.completedParallelInputs = $root.google.protobuf.Int64Value.toObject(message.completedParallelInputs, options, q + 1); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = message.status; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.bigquery.v2.ExplainQueryStep.toObject(message.steps[j], options, q + 1); + } + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) + object.slotMs = $root.google.protobuf.Int64Value.toObject(message.slotMs, options, q + 1); + if (message.computeMode != null && Object.hasOwnProperty.call(message, "computeMode")) + object.computeMode = options.enums === String ? $root.google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode[message.computeMode] === undefined ? message.computeMode : $root.google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode[message.computeMode] : message.computeMode; + return object; + }; + + /** + * Converts this ExplainQueryStage to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @instance + * @returns {Object.} JSON object + */ + ExplainQueryStage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainQueryStage + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExplainQueryStage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainQueryStage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExplainQueryStage"; + }; + + /** + * ComputeMode enum. + * @name google.cloud.bigquery.v2.ExplainQueryStage.ComputeMode + * @enum {number} + * @property {number} COMPUTE_MODE_UNSPECIFIED=0 COMPUTE_MODE_UNSPECIFIED value + * @property {number} BIGQUERY=1 BIGQUERY value + * @property {number} BI_ENGINE=2 BI_ENGINE value + */ + ExplainQueryStage.ComputeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BIGQUERY"] = 1; + values[valuesById[2] = "BI_ENGINE"] = 2; + return values; + })(); + + return ExplainQueryStage; + })(); + + v2.QueryTimelineSample = (function() { + + /** + * Properties of a QueryTimelineSample. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryTimelineSample + * @property {google.protobuf.IInt64Value|null} [elapsedMs] QueryTimelineSample elapsedMs + * @property {google.protobuf.IInt64Value|null} [totalSlotMs] QueryTimelineSample totalSlotMs + * @property {google.protobuf.IInt64Value|null} [pendingUnits] QueryTimelineSample pendingUnits + * @property {google.protobuf.IInt64Value|null} [completedUnits] QueryTimelineSample completedUnits + * @property {google.protobuf.IInt64Value|null} [activeUnits] QueryTimelineSample activeUnits + * @property {google.protobuf.IDoubleValue|null} [shuffleRamUsageRatio] QueryTimelineSample shuffleRamUsageRatio + * @property {google.protobuf.IInt64Value|null} [estimatedRunnableUnits] QueryTimelineSample estimatedRunnableUnits + */ + + /** + * Constructs a new QueryTimelineSample. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryTimelineSample. + * @implements IQueryTimelineSample + * @constructor + * @param {google.cloud.bigquery.v2.IQueryTimelineSample=} [properties] Properties to set + */ + function QueryTimelineSample(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryTimelineSample elapsedMs. + * @member {google.protobuf.IInt64Value|null|undefined} elapsedMs + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.elapsedMs = null; + + /** + * QueryTimelineSample totalSlotMs. + * @member {google.protobuf.IInt64Value|null|undefined} totalSlotMs + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.totalSlotMs = null; + + /** + * QueryTimelineSample pendingUnits. + * @member {google.protobuf.IInt64Value|null|undefined} pendingUnits + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.pendingUnits = null; + + /** + * QueryTimelineSample completedUnits. + * @member {google.protobuf.IInt64Value|null|undefined} completedUnits + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.completedUnits = null; + + /** + * QueryTimelineSample activeUnits. + * @member {google.protobuf.IInt64Value|null|undefined} activeUnits + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.activeUnits = null; + + /** + * QueryTimelineSample shuffleRamUsageRatio. + * @member {google.protobuf.IDoubleValue|null|undefined} shuffleRamUsageRatio + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.shuffleRamUsageRatio = null; + + /** + * QueryTimelineSample estimatedRunnableUnits. + * @member {google.protobuf.IInt64Value|null|undefined} estimatedRunnableUnits + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + */ + QueryTimelineSample.prototype.estimatedRunnableUnits = null; + + /** + * Creates a new QueryTimelineSample instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {google.cloud.bigquery.v2.IQueryTimelineSample=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryTimelineSample} QueryTimelineSample instance + */ + QueryTimelineSample.create = function create(properties) { + return new QueryTimelineSample(properties); + }; + + /** + * Encodes the specified QueryTimelineSample message. Does not implicitly {@link google.cloud.bigquery.v2.QueryTimelineSample.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {google.cloud.bigquery.v2.IQueryTimelineSample} message QueryTimelineSample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTimelineSample.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.elapsedMs != null && Object.hasOwnProperty.call(message, "elapsedMs")) + $root.google.protobuf.Int64Value.encode(message.elapsedMs, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + $root.google.protobuf.Int64Value.encode(message.totalSlotMs, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.pendingUnits != null && Object.hasOwnProperty.call(message, "pendingUnits")) + $root.google.protobuf.Int64Value.encode(message.pendingUnits, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.completedUnits != null && Object.hasOwnProperty.call(message, "completedUnits")) + $root.google.protobuf.Int64Value.encode(message.completedUnits, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.activeUnits != null && Object.hasOwnProperty.call(message, "activeUnits")) + $root.google.protobuf.Int64Value.encode(message.activeUnits, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.shuffleRamUsageRatio != null && Object.hasOwnProperty.call(message, "shuffleRamUsageRatio")) + $root.google.protobuf.DoubleValue.encode(message.shuffleRamUsageRatio, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.estimatedRunnableUnits != null && Object.hasOwnProperty.call(message, "estimatedRunnableUnits")) + $root.google.protobuf.Int64Value.encode(message.estimatedRunnableUnits, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryTimelineSample message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryTimelineSample.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {google.cloud.bigquery.v2.IQueryTimelineSample} message QueryTimelineSample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTimelineSample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryTimelineSample message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryTimelineSample} QueryTimelineSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTimelineSample.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryTimelineSample(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.elapsedMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.totalSlotMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.pendingUnits = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.completedUnits = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.activeUnits = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.shuffleRamUsageRatio = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.estimatedRunnableUnits = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTimelineSample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryTimelineSample} QueryTimelineSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTimelineSample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTimelineSample message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTimelineSample.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.elapsedMs != null && Object.hasOwnProperty.call(message, "elapsedMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.elapsedMs, long + 1); + if (error) + return "elapsedMs." + error; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalSlotMs, long + 1); + if (error) + return "totalSlotMs." + error; + } + if (message.pendingUnits != null && Object.hasOwnProperty.call(message, "pendingUnits")) { + var error = $root.google.protobuf.Int64Value.verify(message.pendingUnits, long + 1); + if (error) + return "pendingUnits." + error; + } + if (message.completedUnits != null && Object.hasOwnProperty.call(message, "completedUnits")) { + var error = $root.google.protobuf.Int64Value.verify(message.completedUnits, long + 1); + if (error) + return "completedUnits." + error; + } + if (message.activeUnits != null && Object.hasOwnProperty.call(message, "activeUnits")) { + var error = $root.google.protobuf.Int64Value.verify(message.activeUnits, long + 1); + if (error) + return "activeUnits." + error; + } + if (message.shuffleRamUsageRatio != null && Object.hasOwnProperty.call(message, "shuffleRamUsageRatio")) { + var error = $root.google.protobuf.DoubleValue.verify(message.shuffleRamUsageRatio, long + 1); + if (error) + return "shuffleRamUsageRatio." + error; + } + if (message.estimatedRunnableUnits != null && Object.hasOwnProperty.call(message, "estimatedRunnableUnits")) { + var error = $root.google.protobuf.Int64Value.verify(message.estimatedRunnableUnits, long + 1); + if (error) + return "estimatedRunnableUnits." + error; + } + return null; + }; + + /** + * Creates a QueryTimelineSample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryTimelineSample} QueryTimelineSample + */ + QueryTimelineSample.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryTimelineSample) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryTimelineSample(); + if (object.elapsedMs != null) { + if (!$util.isObject(object.elapsedMs)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.elapsedMs: object expected"); + message.elapsedMs = $root.google.protobuf.Int64Value.fromObject(object.elapsedMs, long + 1); + } + if (object.totalSlotMs != null) { + if (!$util.isObject(object.totalSlotMs)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.totalSlotMs: object expected"); + message.totalSlotMs = $root.google.protobuf.Int64Value.fromObject(object.totalSlotMs, long + 1); + } + if (object.pendingUnits != null) { + if (!$util.isObject(object.pendingUnits)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.pendingUnits: object expected"); + message.pendingUnits = $root.google.protobuf.Int64Value.fromObject(object.pendingUnits, long + 1); + } + if (object.completedUnits != null) { + if (!$util.isObject(object.completedUnits)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.completedUnits: object expected"); + message.completedUnits = $root.google.protobuf.Int64Value.fromObject(object.completedUnits, long + 1); + } + if (object.activeUnits != null) { + if (!$util.isObject(object.activeUnits)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.activeUnits: object expected"); + message.activeUnits = $root.google.protobuf.Int64Value.fromObject(object.activeUnits, long + 1); + } + if (object.shuffleRamUsageRatio != null) { + if (!$util.isObject(object.shuffleRamUsageRatio)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.shuffleRamUsageRatio: object expected"); + message.shuffleRamUsageRatio = $root.google.protobuf.DoubleValue.fromObject(object.shuffleRamUsageRatio, long + 1); + } + if (object.estimatedRunnableUnits != null) { + if (!$util.isObject(object.estimatedRunnableUnits)) + throw TypeError(".google.cloud.bigquery.v2.QueryTimelineSample.estimatedRunnableUnits: object expected"); + message.estimatedRunnableUnits = $root.google.protobuf.Int64Value.fromObject(object.estimatedRunnableUnits, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a QueryTimelineSample message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {google.cloud.bigquery.v2.QueryTimelineSample} message QueryTimelineSample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTimelineSample.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.elapsedMs = null; + object.totalSlotMs = null; + object.pendingUnits = null; + object.completedUnits = null; + object.activeUnits = null; + object.shuffleRamUsageRatio = null; + object.estimatedRunnableUnits = null; + } + if (message.elapsedMs != null && Object.hasOwnProperty.call(message, "elapsedMs")) + object.elapsedMs = $root.google.protobuf.Int64Value.toObject(message.elapsedMs, options, q + 1); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + object.totalSlotMs = $root.google.protobuf.Int64Value.toObject(message.totalSlotMs, options, q + 1); + if (message.pendingUnits != null && Object.hasOwnProperty.call(message, "pendingUnits")) + object.pendingUnits = $root.google.protobuf.Int64Value.toObject(message.pendingUnits, options, q + 1); + if (message.completedUnits != null && Object.hasOwnProperty.call(message, "completedUnits")) + object.completedUnits = $root.google.protobuf.Int64Value.toObject(message.completedUnits, options, q + 1); + if (message.activeUnits != null && Object.hasOwnProperty.call(message, "activeUnits")) + object.activeUnits = $root.google.protobuf.Int64Value.toObject(message.activeUnits, options, q + 1); + if (message.shuffleRamUsageRatio != null && Object.hasOwnProperty.call(message, "shuffleRamUsageRatio")) + object.shuffleRamUsageRatio = $root.google.protobuf.DoubleValue.toObject(message.shuffleRamUsageRatio, options, q + 1); + if (message.estimatedRunnableUnits != null && Object.hasOwnProperty.call(message, "estimatedRunnableUnits")) + object.estimatedRunnableUnits = $root.google.protobuf.Int64Value.toObject(message.estimatedRunnableUnits, options, q + 1); + return object; + }; + + /** + * Converts this QueryTimelineSample to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @instance + * @returns {Object.} JSON object + */ + QueryTimelineSample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryTimelineSample + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryTimelineSample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryTimelineSample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryTimelineSample"; + }; + + return QueryTimelineSample; + })(); + + v2.ExternalServiceCost = (function() { + + /** + * Properties of an ExternalServiceCost. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalServiceCost + * @property {string|null} [externalService] ExternalServiceCost externalService + * @property {google.protobuf.IInt64Value|null} [bytesProcessed] ExternalServiceCost bytesProcessed + * @property {google.protobuf.IInt64Value|null} [bytesBilled] ExternalServiceCost bytesBilled + * @property {google.protobuf.IInt64Value|null} [slotMs] ExternalServiceCost slotMs + * @property {number|Long|null} [reservedSlotCount] ExternalServiceCost reservedSlotCount + * @property {string|null} [billingMethod] ExternalServiceCost billingMethod + */ + + /** + * Constructs a new ExternalServiceCost. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalServiceCost. + * @implements IExternalServiceCost + * @constructor + * @param {google.cloud.bigquery.v2.IExternalServiceCost=} [properties] Properties to set + */ + function ExternalServiceCost(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalServiceCost externalService. + * @member {string} externalService + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.externalService = ""; + + /** + * ExternalServiceCost bytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} bytesProcessed + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.bytesProcessed = null; + + /** + * ExternalServiceCost bytesBilled. + * @member {google.protobuf.IInt64Value|null|undefined} bytesBilled + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.bytesBilled = null; + + /** + * ExternalServiceCost slotMs. + * @member {google.protobuf.IInt64Value|null|undefined} slotMs + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.slotMs = null; + + /** + * ExternalServiceCost reservedSlotCount. + * @member {number|Long} reservedSlotCount + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.reservedSlotCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExternalServiceCost billingMethod. + * @member {string} billingMethod + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + */ + ExternalServiceCost.prototype.billingMethod = ""; + + /** + * Creates a new ExternalServiceCost instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {google.cloud.bigquery.v2.IExternalServiceCost=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalServiceCost} ExternalServiceCost instance + */ + ExternalServiceCost.create = function create(properties) { + return new ExternalServiceCost(properties); + }; + + /** + * Encodes the specified ExternalServiceCost message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalServiceCost.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {google.cloud.bigquery.v2.IExternalServiceCost} message ExternalServiceCost message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalServiceCost.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.externalService != null && Object.hasOwnProperty.call(message, "externalService")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.externalService); + if (message.bytesProcessed != null && Object.hasOwnProperty.call(message, "bytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.bytesProcessed, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.bytesBilled != null && Object.hasOwnProperty.call(message, "bytesBilled")) + $root.google.protobuf.Int64Value.encode(message.bytesBilled, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) + $root.google.protobuf.Int64Value.encode(message.slotMs, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.reservedSlotCount != null && Object.hasOwnProperty.call(message, "reservedSlotCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.reservedSlotCount); + if (message.billingMethod != null && Object.hasOwnProperty.call(message, "billingMethod")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.billingMethod); + return writer; + }; + + /** + * Encodes the specified ExternalServiceCost message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalServiceCost.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {google.cloud.bigquery.v2.IExternalServiceCost} message ExternalServiceCost message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalServiceCost.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalServiceCost message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalServiceCost} ExternalServiceCost + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalServiceCost.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalServiceCost(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.externalService = reader.string(); + break; + } + case 2: { + message.bytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.bytesBilled = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.slotMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.reservedSlotCount = reader.int64(); + break; + } + case 6: { + message.billingMethod = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalServiceCost message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalServiceCost} ExternalServiceCost + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalServiceCost.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalServiceCost message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalServiceCost.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.externalService != null && Object.hasOwnProperty.call(message, "externalService")) + if (!$util.isString(message.externalService)) + return "externalService: string expected"; + if (message.bytesProcessed != null && Object.hasOwnProperty.call(message, "bytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.bytesProcessed, long + 1); + if (error) + return "bytesProcessed." + error; + } + if (message.bytesBilled != null && Object.hasOwnProperty.call(message, "bytesBilled")) { + var error = $root.google.protobuf.Int64Value.verify(message.bytesBilled, long + 1); + if (error) + return "bytesBilled." + error; + } + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.slotMs, long + 1); + if (error) + return "slotMs." + error; + } + if (message.reservedSlotCount != null && Object.hasOwnProperty.call(message, "reservedSlotCount")) + if (!$util.isInteger(message.reservedSlotCount) && !(message.reservedSlotCount && $util.isInteger(message.reservedSlotCount.low) && $util.isInteger(message.reservedSlotCount.high))) + return "reservedSlotCount: integer|Long expected"; + if (message.billingMethod != null && Object.hasOwnProperty.call(message, "billingMethod")) + if (!$util.isString(message.billingMethod)) + return "billingMethod: string expected"; + return null; + }; + + /** + * Creates an ExternalServiceCost message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalServiceCost} ExternalServiceCost + */ + ExternalServiceCost.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalServiceCost) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalServiceCost: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalServiceCost(); + if (object.externalService != null) + message.externalService = String(object.externalService); + if (object.bytesProcessed != null) { + if (!$util.isObject(object.bytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.ExternalServiceCost.bytesProcessed: object expected"); + message.bytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.bytesProcessed, long + 1); + } + if (object.bytesBilled != null) { + if (!$util.isObject(object.bytesBilled)) + throw TypeError(".google.cloud.bigquery.v2.ExternalServiceCost.bytesBilled: object expected"); + message.bytesBilled = $root.google.protobuf.Int64Value.fromObject(object.bytesBilled, long + 1); + } + if (object.slotMs != null) { + if (!$util.isObject(object.slotMs)) + throw TypeError(".google.cloud.bigquery.v2.ExternalServiceCost.slotMs: object expected"); + message.slotMs = $root.google.protobuf.Int64Value.fromObject(object.slotMs, long + 1); + } + if (object.reservedSlotCount != null) + if ($util.Long) + message.reservedSlotCount = $util.Long.fromValue(object.reservedSlotCount, false); + else if (typeof object.reservedSlotCount === "string") + message.reservedSlotCount = parseInt(object.reservedSlotCount, 10); + else if (typeof object.reservedSlotCount === "number") + message.reservedSlotCount = object.reservedSlotCount; + else if (typeof object.reservedSlotCount === "object") + message.reservedSlotCount = new $util.LongBits(object.reservedSlotCount.low >>> 0, object.reservedSlotCount.high >>> 0).toNumber(); + if (object.billingMethod != null) + message.billingMethod = String(object.billingMethod); + return message; + }; + + /** + * Creates a plain object from an ExternalServiceCost message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {google.cloud.bigquery.v2.ExternalServiceCost} message ExternalServiceCost + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalServiceCost.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.externalService = ""; + object.bytesProcessed = null; + object.bytesBilled = null; + object.slotMs = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.reservedSlotCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.reservedSlotCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.billingMethod = ""; + } + if (message.externalService != null && Object.hasOwnProperty.call(message, "externalService")) + object.externalService = message.externalService; + if (message.bytesProcessed != null && Object.hasOwnProperty.call(message, "bytesProcessed")) + object.bytesProcessed = $root.google.protobuf.Int64Value.toObject(message.bytesProcessed, options, q + 1); + if (message.bytesBilled != null && Object.hasOwnProperty.call(message, "bytesBilled")) + object.bytesBilled = $root.google.protobuf.Int64Value.toObject(message.bytesBilled, options, q + 1); + if (message.slotMs != null && Object.hasOwnProperty.call(message, "slotMs")) + object.slotMs = $root.google.protobuf.Int64Value.toObject(message.slotMs, options, q + 1); + if (message.reservedSlotCount != null && Object.hasOwnProperty.call(message, "reservedSlotCount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.reservedSlotCount = typeof message.reservedSlotCount === "number" ? BigInt(message.reservedSlotCount) : $util.Long.fromBits(message.reservedSlotCount.low >>> 0, message.reservedSlotCount.high >>> 0, false).toBigInt(); + else if (typeof message.reservedSlotCount === "number") + object.reservedSlotCount = options.longs === String ? String(message.reservedSlotCount) : message.reservedSlotCount; + else + object.reservedSlotCount = options.longs === String ? $util.Long.prototype.toString.call(message.reservedSlotCount) : options.longs === Number ? new $util.LongBits(message.reservedSlotCount.low >>> 0, message.reservedSlotCount.high >>> 0).toNumber() : message.reservedSlotCount; + if (message.billingMethod != null && Object.hasOwnProperty.call(message, "billingMethod")) + object.billingMethod = message.billingMethod; + return object; + }; + + /** + * Converts this ExternalServiceCost to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @instance + * @returns {Object.} JSON object + */ + ExternalServiceCost.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalServiceCost + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalServiceCost + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalServiceCost.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalServiceCost"; + }; + + return ExternalServiceCost; + })(); + + v2.ExportDataStatistics = (function() { + + /** + * Properties of an ExportDataStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IExportDataStatistics + * @property {google.protobuf.IInt64Value|null} [fileCount] ExportDataStatistics fileCount + * @property {google.protobuf.IInt64Value|null} [rowCount] ExportDataStatistics rowCount + */ + + /** + * Constructs a new ExportDataStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExportDataStatistics. + * @implements IExportDataStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IExportDataStatistics=} [properties] Properties to set + */ + function ExportDataStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataStatistics fileCount. + * @member {google.protobuf.IInt64Value|null|undefined} fileCount + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @instance + */ + ExportDataStatistics.prototype.fileCount = null; + + /** + * ExportDataStatistics rowCount. + * @member {google.protobuf.IInt64Value|null|undefined} rowCount + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @instance + */ + ExportDataStatistics.prototype.rowCount = null; + + /** + * Creates a new ExportDataStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {google.cloud.bigquery.v2.IExportDataStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExportDataStatistics} ExportDataStatistics instance + */ + ExportDataStatistics.create = function create(properties) { + return new ExportDataStatistics(properties); + }; + + /** + * Encodes the specified ExportDataStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.ExportDataStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {google.cloud.bigquery.v2.IExportDataStatistics} message ExportDataStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fileCount != null && Object.hasOwnProperty.call(message, "fileCount")) + $root.google.protobuf.Int64Value.encode(message.fileCount, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + $root.google.protobuf.Int64Value.encode(message.rowCount, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExportDataStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {google.cloud.bigquery.v2.IExportDataStatistics} message ExportDataStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExportDataStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExportDataStatistics} ExportDataStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExportDataStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fileCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.rowCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExportDataStatistics} ExportDataStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fileCount != null && Object.hasOwnProperty.call(message, "fileCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.fileCount, long + 1); + if (error) + return "fileCount." + error; + } + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.rowCount, long + 1); + if (error) + return "rowCount." + error; + } + return null; + }; + + /** + * Creates an ExportDataStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExportDataStatistics} ExportDataStatistics + */ + ExportDataStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExportDataStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExportDataStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExportDataStatistics(); + if (object.fileCount != null) { + if (!$util.isObject(object.fileCount)) + throw TypeError(".google.cloud.bigquery.v2.ExportDataStatistics.fileCount: object expected"); + message.fileCount = $root.google.protobuf.Int64Value.fromObject(object.fileCount, long + 1); + } + if (object.rowCount != null) { + if (!$util.isObject(object.rowCount)) + throw TypeError(".google.cloud.bigquery.v2.ExportDataStatistics.rowCount: object expected"); + message.rowCount = $root.google.protobuf.Int64Value.fromObject(object.rowCount, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {google.cloud.bigquery.v2.ExportDataStatistics} message ExportDataStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.fileCount = null; + object.rowCount = null; + } + if (message.fileCount != null && Object.hasOwnProperty.call(message, "fileCount")) + object.fileCount = $root.google.protobuf.Int64Value.toObject(message.fileCount, options, q + 1); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + object.rowCount = $root.google.protobuf.Int64Value.toObject(message.rowCount, options, q + 1); + return object; + }; + + /** + * Converts this ExportDataStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @instance + * @returns {Object.} JSON object + */ + ExportDataStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExportDataStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExportDataStatistics"; + }; + + return ExportDataStatistics; + })(); + + v2.BiEngineReason = (function() { + + /** + * Properties of a BiEngineReason. + * @memberof google.cloud.bigquery.v2 + * @interface IBiEngineReason + * @property {google.cloud.bigquery.v2.BiEngineReason.Code|null} [code] BiEngineReason code + * @property {string|null} [message] BiEngineReason message + */ + + /** + * Constructs a new BiEngineReason. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BiEngineReason. + * @implements IBiEngineReason + * @constructor + * @param {google.cloud.bigquery.v2.IBiEngineReason=} [properties] Properties to set + */ + function BiEngineReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BiEngineReason code. + * @member {google.cloud.bigquery.v2.BiEngineReason.Code} code + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @instance + */ + BiEngineReason.prototype.code = 0; + + /** + * BiEngineReason message. + * @member {string} message + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @instance + */ + BiEngineReason.prototype.message = ""; + + /** + * Creates a new BiEngineReason instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {google.cloud.bigquery.v2.IBiEngineReason=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BiEngineReason} BiEngineReason instance + */ + BiEngineReason.create = function create(properties) { + return new BiEngineReason(properties); + }; + + /** + * Encodes the specified BiEngineReason message. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {google.cloud.bigquery.v2.IBiEngineReason} message BiEngineReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiEngineReason.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified BiEngineReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {google.cloud.bigquery.v2.IBiEngineReason} message BiEngineReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiEngineReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BiEngineReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BiEngineReason} BiEngineReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiEngineReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BiEngineReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BiEngineReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BiEngineReason} BiEngineReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiEngineReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BiEngineReason message. + * @function verify + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BiEngineReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a BiEngineReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BiEngineReason} BiEngineReason + */ + BiEngineReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BiEngineReason) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BiEngineReason: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BiEngineReason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "NO_RESERVATION": + case 1: + message.code = 1; + break; + case "INSUFFICIENT_RESERVATION": + case 2: + message.code = 2; + break; + case "UNSUPPORTED_SQL_TEXT": + case 4: + message.code = 4; + break; + case "INPUT_TOO_LARGE": + case 5: + message.code = 5; + break; + case "OTHER_REASON": + case 6: + message.code = 6; + break; + case "TABLE_EXCLUDED": + case 7: + message.code = 7; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a BiEngineReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {google.cloud.bigquery.v2.BiEngineReason} message BiEngineReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BiEngineReason.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + object.code = options.enums === String ? $root.google.cloud.bigquery.v2.BiEngineReason.Code[message.code] === undefined ? message.code : $root.google.cloud.bigquery.v2.BiEngineReason.Code[message.code] : message.code; + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + object.message = message.message; + return object; + }; + + /** + * Converts this BiEngineReason to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @instance + * @returns {Object.} JSON object + */ + BiEngineReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BiEngineReason + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BiEngineReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BiEngineReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BiEngineReason"; + }; + + /** + * Code enum. + * @name google.cloud.bigquery.v2.BiEngineReason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} NO_RESERVATION=1 NO_RESERVATION value + * @property {number} INSUFFICIENT_RESERVATION=2 INSUFFICIENT_RESERVATION value + * @property {number} UNSUPPORTED_SQL_TEXT=4 UNSUPPORTED_SQL_TEXT value + * @property {number} INPUT_TOO_LARGE=5 INPUT_TOO_LARGE value + * @property {number} OTHER_REASON=6 OTHER_REASON value + * @property {number} TABLE_EXCLUDED=7 TABLE_EXCLUDED value + */ + BiEngineReason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESERVATION"] = 1; + values[valuesById[2] = "INSUFFICIENT_RESERVATION"] = 2; + values[valuesById[4] = "UNSUPPORTED_SQL_TEXT"] = 4; + values[valuesById[5] = "INPUT_TOO_LARGE"] = 5; + values[valuesById[6] = "OTHER_REASON"] = 6; + values[valuesById[7] = "TABLE_EXCLUDED"] = 7; + return values; + })(); + + return BiEngineReason; + })(); + + v2.BiEngineStatistics = (function() { + + /** + * Properties of a BiEngineStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IBiEngineStatistics + * @property {google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode|null} [biEngineMode] BiEngineStatistics biEngineMode + * @property {google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode|null} [accelerationMode] BiEngineStatistics accelerationMode + * @property {Array.|null} [biEngineReasons] BiEngineStatistics biEngineReasons + */ + + /** + * Constructs a new BiEngineStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BiEngineStatistics. + * @implements IBiEngineStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IBiEngineStatistics=} [properties] Properties to set + */ + function BiEngineStatistics(properties) { + this.biEngineReasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BiEngineStatistics biEngineMode. + * @member {google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode} biEngineMode + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @instance + */ + BiEngineStatistics.prototype.biEngineMode = 0; + + /** + * BiEngineStatistics accelerationMode. + * @member {google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode} accelerationMode + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @instance + */ + BiEngineStatistics.prototype.accelerationMode = 0; + + /** + * BiEngineStatistics biEngineReasons. + * @member {Array.} biEngineReasons + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @instance + */ + BiEngineStatistics.prototype.biEngineReasons = $util.emptyArray; + + /** + * Creates a new BiEngineStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {google.cloud.bigquery.v2.IBiEngineStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BiEngineStatistics} BiEngineStatistics instance + */ + BiEngineStatistics.create = function create(properties) { + return new BiEngineStatistics(properties); + }; + + /** + * Encodes the specified BiEngineStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {google.cloud.bigquery.v2.IBiEngineStatistics} message BiEngineStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiEngineStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.biEngineMode != null && Object.hasOwnProperty.call(message, "biEngineMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.biEngineMode); + if (message.biEngineReasons != null && message.biEngineReasons.length) + for (var i = 0; i < message.biEngineReasons.length; ++i) + $root.google.cloud.bigquery.v2.BiEngineReason.encode(message.biEngineReasons[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.accelerationMode != null && Object.hasOwnProperty.call(message, "accelerationMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.accelerationMode); + return writer; + }; + + /** + * Encodes the specified BiEngineStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BiEngineStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {google.cloud.bigquery.v2.IBiEngineStatistics} message BiEngineStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiEngineStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BiEngineStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BiEngineStatistics} BiEngineStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiEngineStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BiEngineStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.biEngineMode = reader.int32(); + break; + } + case 3: { + message.accelerationMode = reader.int32(); + break; + } + case 2: { + if (!(message.biEngineReasons && message.biEngineReasons.length)) + message.biEngineReasons = []; + message.biEngineReasons.push($root.google.cloud.bigquery.v2.BiEngineReason.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BiEngineStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BiEngineStatistics} BiEngineStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiEngineStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BiEngineStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BiEngineStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.biEngineMode != null && Object.hasOwnProperty.call(message, "biEngineMode")) + switch (message.biEngineMode) { + default: + return "biEngineMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accelerationMode != null && Object.hasOwnProperty.call(message, "accelerationMode")) + switch (message.accelerationMode) { + default: + return "accelerationMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.biEngineReasons != null && Object.hasOwnProperty.call(message, "biEngineReasons")) { + if (!Array.isArray(message.biEngineReasons)) + return "biEngineReasons: array expected"; + for (var i = 0; i < message.biEngineReasons.length; ++i) { + var error = $root.google.cloud.bigquery.v2.BiEngineReason.verify(message.biEngineReasons[i], long + 1); + if (error) + return "biEngineReasons." + error; + } + } + return null; + }; + + /** + * Creates a BiEngineStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BiEngineStatistics} BiEngineStatistics + */ + BiEngineStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BiEngineStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BiEngineStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BiEngineStatistics(); + switch (object.biEngineMode) { + default: + if (typeof object.biEngineMode === "number") { + message.biEngineMode = object.biEngineMode; + break; + } + break; + case "ACCELERATION_MODE_UNSPECIFIED": + case 0: + message.biEngineMode = 0; + break; + case "DISABLED": + case 1: + message.biEngineMode = 1; + break; + case "PARTIAL": + case 2: + message.biEngineMode = 2; + break; + case "FULL": + case 3: + message.biEngineMode = 3; + break; + } + switch (object.accelerationMode) { + default: + if (typeof object.accelerationMode === "number") { + message.accelerationMode = object.accelerationMode; + break; + } + break; + case "BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED": + case 0: + message.accelerationMode = 0; + break; + case "BI_ENGINE_DISABLED": + case 1: + message.accelerationMode = 1; + break; + case "PARTIAL_INPUT": + case 2: + message.accelerationMode = 2; + break; + case "FULL_INPUT": + case 3: + message.accelerationMode = 3; + break; + case "FULL_QUERY": + case 4: + message.accelerationMode = 4; + break; + } + if (object.biEngineReasons) { + if (!Array.isArray(object.biEngineReasons)) + throw TypeError(".google.cloud.bigquery.v2.BiEngineStatistics.biEngineReasons: array expected"); + message.biEngineReasons = []; + for (var i = 0; i < object.biEngineReasons.length; ++i) { + if (!$util.isObject(object.biEngineReasons[i])) + throw TypeError(".google.cloud.bigquery.v2.BiEngineStatistics.biEngineReasons: object expected"); + message.biEngineReasons[i] = $root.google.cloud.bigquery.v2.BiEngineReason.fromObject(object.biEngineReasons[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a BiEngineStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {google.cloud.bigquery.v2.BiEngineStatistics} message BiEngineStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BiEngineStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.biEngineReasons = []; + if (options.defaults) { + object.biEngineMode = options.enums === String ? "ACCELERATION_MODE_UNSPECIFIED" : 0; + object.accelerationMode = options.enums === String ? "BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED" : 0; + } + if (message.biEngineMode != null && Object.hasOwnProperty.call(message, "biEngineMode")) + object.biEngineMode = options.enums === String ? $root.google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode[message.biEngineMode] === undefined ? message.biEngineMode : $root.google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode[message.biEngineMode] : message.biEngineMode; + if (message.biEngineReasons && message.biEngineReasons.length) { + object.biEngineReasons = []; + for (var j = 0; j < message.biEngineReasons.length; ++j) + object.biEngineReasons[j] = $root.google.cloud.bigquery.v2.BiEngineReason.toObject(message.biEngineReasons[j], options, q + 1); + } + if (message.accelerationMode != null && Object.hasOwnProperty.call(message, "accelerationMode")) + object.accelerationMode = options.enums === String ? $root.google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode[message.accelerationMode] === undefined ? message.accelerationMode : $root.google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode[message.accelerationMode] : message.accelerationMode; + return object; + }; + + /** + * Converts this BiEngineStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @instance + * @returns {Object.} JSON object + */ + BiEngineStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BiEngineStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BiEngineStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BiEngineStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BiEngineStatistics"; + }; + + /** + * BiEngineMode enum. + * @name google.cloud.bigquery.v2.BiEngineStatistics.BiEngineMode + * @enum {number} + * @property {number} ACCELERATION_MODE_UNSPECIFIED=0 ACCELERATION_MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} PARTIAL=2 PARTIAL value + * @property {number} FULL=3 FULL value + */ + BiEngineStatistics.BiEngineMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCELERATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "PARTIAL"] = 2; + values[valuesById[3] = "FULL"] = 3; + return values; + })(); + + /** + * BiEngineAccelerationMode enum. + * @name google.cloud.bigquery.v2.BiEngineStatistics.BiEngineAccelerationMode + * @enum {number} + * @property {number} BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED=0 BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED value + * @property {number} BI_ENGINE_DISABLED=1 BI_ENGINE_DISABLED value + * @property {number} PARTIAL_INPUT=2 PARTIAL_INPUT value + * @property {number} FULL_INPUT=3 FULL_INPUT value + * @property {number} FULL_QUERY=4 FULL_QUERY value + */ + BiEngineStatistics.BiEngineAccelerationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BI_ENGINE_DISABLED"] = 1; + values[valuesById[2] = "PARTIAL_INPUT"] = 2; + values[valuesById[3] = "FULL_INPUT"] = 3; + values[valuesById[4] = "FULL_QUERY"] = 4; + return values; + })(); + + return BiEngineStatistics; + })(); + + v2.IndexUnusedReason = (function() { + + /** + * Properties of an IndexUnusedReason. + * @memberof google.cloud.bigquery.v2 + * @interface IIndexUnusedReason + * @property {google.cloud.bigquery.v2.IndexUnusedReason.Code|null} [code] IndexUnusedReason code + * @property {string|null} [message] IndexUnusedReason message + * @property {google.cloud.bigquery.v2.ITableReference|null} [baseTable] IndexUnusedReason baseTable + * @property {string|null} [indexName] IndexUnusedReason indexName + */ + + /** + * Constructs a new IndexUnusedReason. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an IndexUnusedReason. + * @implements IIndexUnusedReason + * @constructor + * @param {google.cloud.bigquery.v2.IIndexUnusedReason=} [properties] Properties to set + */ + function IndexUnusedReason(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexUnusedReason code. + * @member {google.cloud.bigquery.v2.IndexUnusedReason.Code|null|undefined} code + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @instance + */ + IndexUnusedReason.prototype.code = null; + + /** + * IndexUnusedReason message. + * @member {string|null|undefined} message + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @instance + */ + IndexUnusedReason.prototype.message = null; + + /** + * IndexUnusedReason baseTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} baseTable + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @instance + */ + IndexUnusedReason.prototype.baseTable = null; + + /** + * IndexUnusedReason indexName. + * @member {string|null|undefined} indexName + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @instance + */ + IndexUnusedReason.prototype.indexName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexUnusedReason.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexUnusedReason.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexUnusedReason.prototype, "_baseTable", { + get: $util.oneOfGetter($oneOfFields = ["baseTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexUnusedReason.prototype, "_indexName", { + get: $util.oneOfGetter($oneOfFields = ["indexName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IndexUnusedReason instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {google.cloud.bigquery.v2.IIndexUnusedReason=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.IndexUnusedReason} IndexUnusedReason instance + */ + IndexUnusedReason.create = function create(properties) { + return new IndexUnusedReason(properties); + }; + + /** + * Encodes the specified IndexUnusedReason message. Does not implicitly {@link google.cloud.bigquery.v2.IndexUnusedReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {google.cloud.bigquery.v2.IIndexUnusedReason} message IndexUnusedReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexUnusedReason.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.baseTable, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.indexName); + return writer; + }; + + /** + * Encodes the specified IndexUnusedReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IndexUnusedReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {google.cloud.bigquery.v2.IIndexUnusedReason} message IndexUnusedReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexUnusedReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IndexUnusedReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.IndexUnusedReason} IndexUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexUnusedReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.IndexUnusedReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.indexName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IndexUnusedReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.IndexUnusedReason} IndexUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexUnusedReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexUnusedReason message. + * @function verify + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexUnusedReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) { + properties._code = 1; + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 11: + case 12: + case 13: + case 14: + case 15: + case 21: + case 17: + case 18: + case 19: + case 20: + case 10: + case 16: + break; + } + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + properties._baseTable = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.baseTable, long + 1); + if (error) + return "baseTable." + error; + } + } + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) { + properties._indexName = 1; + if (!$util.isString(message.indexName)) + return "indexName: string expected"; + } + return null; + }; + + /** + * Creates an IndexUnusedReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.IndexUnusedReason} IndexUnusedReason + */ + IndexUnusedReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.IndexUnusedReason) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.IndexUnusedReason: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.IndexUnusedReason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INDEX_CONFIG_NOT_AVAILABLE": + case 1: + message.code = 1; + break; + case "PENDING_INDEX_CREATION": + case 2: + message.code = 2; + break; + case "BASE_TABLE_TRUNCATED": + case 3: + message.code = 3; + break; + case "INDEX_CONFIG_MODIFIED": + case 4: + message.code = 4; + break; + case "TIME_TRAVEL_QUERY": + case 5: + message.code = 5; + break; + case "NO_PRUNING_POWER": + case 6: + message.code = 6; + break; + case "UNINDEXED_SEARCH_FIELDS": + case 7: + message.code = 7; + break; + case "UNSUPPORTED_SEARCH_PATTERN": + case 8: + message.code = 8; + break; + case "OPTIMIZED_WITH_MATERIALIZED_VIEW": + case 9: + message.code = 9; + break; + case "SECURED_BY_DATA_MASKING": + case 11: + message.code = 11; + break; + case "MISMATCHED_TEXT_ANALYZER": + case 12: + message.code = 12; + break; + case "BASE_TABLE_TOO_SMALL": + case 13: + message.code = 13; + break; + case "BASE_TABLE_TOO_LARGE": + case 14: + message.code = 14; + break; + case "ESTIMATED_PERFORMANCE_GAIN_TOO_LOW": + case 15: + message.code = 15; + break; + case "COLUMN_METADATA_INDEX_NOT_USED": + case 21: + message.code = 21; + break; + case "NOT_SUPPORTED_IN_STANDARD_EDITION": + case 17: + message.code = 17; + break; + case "INDEX_SUPPRESSED_BY_FUNCTION_OPTION": + case 18: + message.code = 18; + break; + case "QUERY_CACHE_HIT": + case 19: + message.code = 19; + break; + case "STALE_INDEX": + case 20: + message.code = 20; + break; + case "INTERNAL_ERROR": + case 10: + message.code = 10; + break; + case "OTHER_REASON": + case 16: + message.code = 16; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.baseTable != null) { + if (!$util.isObject(object.baseTable)) + throw TypeError(".google.cloud.bigquery.v2.IndexUnusedReason.baseTable: object expected"); + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.baseTable, long + 1); + } + if (object.indexName != null) + message.indexName = String(object.indexName); + return message; + }; + + /** + * Creates a plain object from an IndexUnusedReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {google.cloud.bigquery.v2.IndexUnusedReason} message IndexUnusedReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexUnusedReason.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) { + object.code = options.enums === String ? $root.google.cloud.bigquery.v2.IndexUnusedReason.Code[message.code] === undefined ? message.code : $root.google.cloud.bigquery.v2.IndexUnusedReason.Code[message.code] : message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + object.baseTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.baseTable, options, q + 1); + if (options.oneofs) + object._baseTable = "baseTable"; + } + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) { + object.indexName = message.indexName; + if (options.oneofs) + object._indexName = "indexName"; + } + return object; + }; + + /** + * Converts this IndexUnusedReason to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @instance + * @returns {Object.} JSON object + */ + IndexUnusedReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexUnusedReason + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.IndexUnusedReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexUnusedReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.IndexUnusedReason"; + }; + + /** + * Code enum. + * @name google.cloud.bigquery.v2.IndexUnusedReason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} INDEX_CONFIG_NOT_AVAILABLE=1 INDEX_CONFIG_NOT_AVAILABLE value + * @property {number} PENDING_INDEX_CREATION=2 PENDING_INDEX_CREATION value + * @property {number} BASE_TABLE_TRUNCATED=3 BASE_TABLE_TRUNCATED value + * @property {number} INDEX_CONFIG_MODIFIED=4 INDEX_CONFIG_MODIFIED value + * @property {number} TIME_TRAVEL_QUERY=5 TIME_TRAVEL_QUERY value + * @property {number} NO_PRUNING_POWER=6 NO_PRUNING_POWER value + * @property {number} UNINDEXED_SEARCH_FIELDS=7 UNINDEXED_SEARCH_FIELDS value + * @property {number} UNSUPPORTED_SEARCH_PATTERN=8 UNSUPPORTED_SEARCH_PATTERN value + * @property {number} OPTIMIZED_WITH_MATERIALIZED_VIEW=9 OPTIMIZED_WITH_MATERIALIZED_VIEW value + * @property {number} SECURED_BY_DATA_MASKING=11 SECURED_BY_DATA_MASKING value + * @property {number} MISMATCHED_TEXT_ANALYZER=12 MISMATCHED_TEXT_ANALYZER value + * @property {number} BASE_TABLE_TOO_SMALL=13 BASE_TABLE_TOO_SMALL value + * @property {number} BASE_TABLE_TOO_LARGE=14 BASE_TABLE_TOO_LARGE value + * @property {number} ESTIMATED_PERFORMANCE_GAIN_TOO_LOW=15 ESTIMATED_PERFORMANCE_GAIN_TOO_LOW value + * @property {number} COLUMN_METADATA_INDEX_NOT_USED=21 COLUMN_METADATA_INDEX_NOT_USED value + * @property {number} NOT_SUPPORTED_IN_STANDARD_EDITION=17 NOT_SUPPORTED_IN_STANDARD_EDITION value + * @property {number} INDEX_SUPPRESSED_BY_FUNCTION_OPTION=18 INDEX_SUPPRESSED_BY_FUNCTION_OPTION value + * @property {number} QUERY_CACHE_HIT=19 QUERY_CACHE_HIT value + * @property {number} STALE_INDEX=20 STALE_INDEX value + * @property {number} INTERNAL_ERROR=10 INTERNAL_ERROR value + * @property {number} OTHER_REASON=16 OTHER_REASON value + */ + IndexUnusedReason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INDEX_CONFIG_NOT_AVAILABLE"] = 1; + values[valuesById[2] = "PENDING_INDEX_CREATION"] = 2; + values[valuesById[3] = "BASE_TABLE_TRUNCATED"] = 3; + values[valuesById[4] = "INDEX_CONFIG_MODIFIED"] = 4; + values[valuesById[5] = "TIME_TRAVEL_QUERY"] = 5; + values[valuesById[6] = "NO_PRUNING_POWER"] = 6; + values[valuesById[7] = "UNINDEXED_SEARCH_FIELDS"] = 7; + values[valuesById[8] = "UNSUPPORTED_SEARCH_PATTERN"] = 8; + values[valuesById[9] = "OPTIMIZED_WITH_MATERIALIZED_VIEW"] = 9; + values[valuesById[11] = "SECURED_BY_DATA_MASKING"] = 11; + values[valuesById[12] = "MISMATCHED_TEXT_ANALYZER"] = 12; + values[valuesById[13] = "BASE_TABLE_TOO_SMALL"] = 13; + values[valuesById[14] = "BASE_TABLE_TOO_LARGE"] = 14; + values[valuesById[15] = "ESTIMATED_PERFORMANCE_GAIN_TOO_LOW"] = 15; + values[valuesById[21] = "COLUMN_METADATA_INDEX_NOT_USED"] = 21; + values[valuesById[17] = "NOT_SUPPORTED_IN_STANDARD_EDITION"] = 17; + values[valuesById[18] = "INDEX_SUPPRESSED_BY_FUNCTION_OPTION"] = 18; + values[valuesById[19] = "QUERY_CACHE_HIT"] = 19; + values[valuesById[20] = "STALE_INDEX"] = 20; + values[valuesById[10] = "INTERNAL_ERROR"] = 10; + values[valuesById[16] = "OTHER_REASON"] = 16; + return values; + })(); + + return IndexUnusedReason; + })(); + + v2.IndexPruningStats = (function() { + + /** + * Properties of an IndexPruningStats. + * @memberof google.cloud.bigquery.v2 + * @interface IIndexPruningStats + * @property {google.cloud.bigquery.v2.ITableReference|null} [baseTable] IndexPruningStats baseTable + * @property {string|null} [indexId] IndexPruningStats indexId + * @property {number|Long|null} [preIndexPruningParallelInputCount] IndexPruningStats preIndexPruningParallelInputCount + * @property {number|Long|null} [postIndexPruningParallelInputCount] IndexPruningStats postIndexPruningParallelInputCount + */ + + /** + * Constructs a new IndexPruningStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an IndexPruningStats. + * @implements IIndexPruningStats + * @constructor + * @param {google.cloud.bigquery.v2.IIndexPruningStats=} [properties] Properties to set + */ + function IndexPruningStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexPruningStats baseTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} baseTable + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @instance + */ + IndexPruningStats.prototype.baseTable = null; + + /** + * IndexPruningStats indexId. + * @member {string|null|undefined} indexId + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @instance + */ + IndexPruningStats.prototype.indexId = null; + + /** + * IndexPruningStats preIndexPruningParallelInputCount. + * @member {number|Long|null|undefined} preIndexPruningParallelInputCount + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @instance + */ + IndexPruningStats.prototype.preIndexPruningParallelInputCount = null; + + /** + * IndexPruningStats postIndexPruningParallelInputCount. + * @member {number|Long|null|undefined} postIndexPruningParallelInputCount + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @instance + */ + IndexPruningStats.prototype.postIndexPruningParallelInputCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexPruningStats.prototype, "_baseTable", { + get: $util.oneOfGetter($oneOfFields = ["baseTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexPruningStats.prototype, "_indexId", { + get: $util.oneOfGetter($oneOfFields = ["indexId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexPruningStats.prototype, "_preIndexPruningParallelInputCount", { + get: $util.oneOfGetter($oneOfFields = ["preIndexPruningParallelInputCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IndexPruningStats.prototype, "_postIndexPruningParallelInputCount", { + get: $util.oneOfGetter($oneOfFields = ["postIndexPruningParallelInputCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IndexPruningStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {google.cloud.bigquery.v2.IIndexPruningStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.IndexPruningStats} IndexPruningStats instance + */ + IndexPruningStats.create = function create(properties) { + return new IndexPruningStats(properties); + }; + + /** + * Encodes the specified IndexPruningStats message. Does not implicitly {@link google.cloud.bigquery.v2.IndexPruningStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {google.cloud.bigquery.v2.IIndexPruningStats} message IndexPruningStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexPruningStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.baseTable, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.preIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preIndexPruningParallelInputCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.preIndexPruningParallelInputCount); + if (message.postIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postIndexPruningParallelInputCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.postIndexPruningParallelInputCount); + if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.indexId); + return writer; + }; + + /** + * Encodes the specified IndexPruningStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IndexPruningStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {google.cloud.bigquery.v2.IIndexPruningStats} message IndexPruningStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexPruningStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IndexPruningStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.IndexPruningStats} IndexPruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexPruningStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.IndexPruningStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.indexId = reader.string(); + break; + } + case 2: { + message.preIndexPruningParallelInputCount = reader.int64(); + break; + } + case 3: { + message.postIndexPruningParallelInputCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IndexPruningStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.IndexPruningStats} IndexPruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexPruningStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexPruningStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexPruningStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + properties._baseTable = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.baseTable, long + 1); + if (error) + return "baseTable." + error; + } + } + if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) { + properties._indexId = 1; + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + } + if (message.preIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preIndexPruningParallelInputCount")) { + properties._preIndexPruningParallelInputCount = 1; + if (!$util.isInteger(message.preIndexPruningParallelInputCount) && !(message.preIndexPruningParallelInputCount && $util.isInteger(message.preIndexPruningParallelInputCount.low) && $util.isInteger(message.preIndexPruningParallelInputCount.high))) + return "preIndexPruningParallelInputCount: integer|Long expected"; + } + if (message.postIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postIndexPruningParallelInputCount")) { + properties._postIndexPruningParallelInputCount = 1; + if (!$util.isInteger(message.postIndexPruningParallelInputCount) && !(message.postIndexPruningParallelInputCount && $util.isInteger(message.postIndexPruningParallelInputCount.low) && $util.isInteger(message.postIndexPruningParallelInputCount.high))) + return "postIndexPruningParallelInputCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates an IndexPruningStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.IndexPruningStats} IndexPruningStats + */ + IndexPruningStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.IndexPruningStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.IndexPruningStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.IndexPruningStats(); + if (object.baseTable != null) { + if (!$util.isObject(object.baseTable)) + throw TypeError(".google.cloud.bigquery.v2.IndexPruningStats.baseTable: object expected"); + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.baseTable, long + 1); + } + if (object.indexId != null) + message.indexId = String(object.indexId); + if (object.preIndexPruningParallelInputCount != null) + if ($util.Long) + message.preIndexPruningParallelInputCount = $util.Long.fromValue(object.preIndexPruningParallelInputCount, false); + else if (typeof object.preIndexPruningParallelInputCount === "string") + message.preIndexPruningParallelInputCount = parseInt(object.preIndexPruningParallelInputCount, 10); + else if (typeof object.preIndexPruningParallelInputCount === "number") + message.preIndexPruningParallelInputCount = object.preIndexPruningParallelInputCount; + else if (typeof object.preIndexPruningParallelInputCount === "object") + message.preIndexPruningParallelInputCount = new $util.LongBits(object.preIndexPruningParallelInputCount.low >>> 0, object.preIndexPruningParallelInputCount.high >>> 0).toNumber(); + if (object.postIndexPruningParallelInputCount != null) + if ($util.Long) + message.postIndexPruningParallelInputCount = $util.Long.fromValue(object.postIndexPruningParallelInputCount, false); + else if (typeof object.postIndexPruningParallelInputCount === "string") + message.postIndexPruningParallelInputCount = parseInt(object.postIndexPruningParallelInputCount, 10); + else if (typeof object.postIndexPruningParallelInputCount === "number") + message.postIndexPruningParallelInputCount = object.postIndexPruningParallelInputCount; + else if (typeof object.postIndexPruningParallelInputCount === "object") + message.postIndexPruningParallelInputCount = new $util.LongBits(object.postIndexPruningParallelInputCount.low >>> 0, object.postIndexPruningParallelInputCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IndexPruningStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {google.cloud.bigquery.v2.IndexPruningStats} message IndexPruningStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexPruningStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + object.baseTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.baseTable, options, q + 1); + if (options.oneofs) + object._baseTable = "baseTable"; + } + if (message.preIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preIndexPruningParallelInputCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.preIndexPruningParallelInputCount = typeof message.preIndexPruningParallelInputCount === "number" ? BigInt(message.preIndexPruningParallelInputCount) : $util.Long.fromBits(message.preIndexPruningParallelInputCount.low >>> 0, message.preIndexPruningParallelInputCount.high >>> 0, false).toBigInt(); + else if (typeof message.preIndexPruningParallelInputCount === "number") + object.preIndexPruningParallelInputCount = options.longs === String ? String(message.preIndexPruningParallelInputCount) : message.preIndexPruningParallelInputCount; + else + object.preIndexPruningParallelInputCount = options.longs === String ? $util.Long.prototype.toString.call(message.preIndexPruningParallelInputCount) : options.longs === Number ? new $util.LongBits(message.preIndexPruningParallelInputCount.low >>> 0, message.preIndexPruningParallelInputCount.high >>> 0).toNumber() : message.preIndexPruningParallelInputCount; + if (options.oneofs) + object._preIndexPruningParallelInputCount = "preIndexPruningParallelInputCount"; + } + if (message.postIndexPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postIndexPruningParallelInputCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.postIndexPruningParallelInputCount = typeof message.postIndexPruningParallelInputCount === "number" ? BigInt(message.postIndexPruningParallelInputCount) : $util.Long.fromBits(message.postIndexPruningParallelInputCount.low >>> 0, message.postIndexPruningParallelInputCount.high >>> 0, false).toBigInt(); + else if (typeof message.postIndexPruningParallelInputCount === "number") + object.postIndexPruningParallelInputCount = options.longs === String ? String(message.postIndexPruningParallelInputCount) : message.postIndexPruningParallelInputCount; + else + object.postIndexPruningParallelInputCount = options.longs === String ? $util.Long.prototype.toString.call(message.postIndexPruningParallelInputCount) : options.longs === Number ? new $util.LongBits(message.postIndexPruningParallelInputCount.low >>> 0, message.postIndexPruningParallelInputCount.high >>> 0).toNumber() : message.postIndexPruningParallelInputCount; + if (options.oneofs) + object._postIndexPruningParallelInputCount = "postIndexPruningParallelInputCount"; + } + if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) { + object.indexId = message.indexId; + if (options.oneofs) + object._indexId = "indexId"; + } + return object; + }; + + /** + * Converts this IndexPruningStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @instance + * @returns {Object.} JSON object + */ + IndexPruningStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexPruningStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.IndexPruningStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexPruningStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.IndexPruningStats"; + }; + + return IndexPruningStats; + })(); + + v2.StoredColumnsUsage = (function() { + + /** + * Properties of a StoredColumnsUsage. + * @memberof google.cloud.bigquery.v2 + * @interface IStoredColumnsUsage + * @property {boolean|null} [isQueryAccelerated] StoredColumnsUsage isQueryAccelerated + * @property {google.cloud.bigquery.v2.ITableReference|null} [baseTable] StoredColumnsUsage baseTable + * @property {Array.|null} [storedColumnsUnusedReasons] StoredColumnsUsage storedColumnsUnusedReasons + */ + + /** + * Constructs a new StoredColumnsUsage. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StoredColumnsUsage. + * @implements IStoredColumnsUsage + * @constructor + * @param {google.cloud.bigquery.v2.IStoredColumnsUsage=} [properties] Properties to set + */ + function StoredColumnsUsage(properties) { + this.storedColumnsUnusedReasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredColumnsUsage isQueryAccelerated. + * @member {boolean|null|undefined} isQueryAccelerated + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @instance + */ + StoredColumnsUsage.prototype.isQueryAccelerated = null; + + /** + * StoredColumnsUsage baseTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} baseTable + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @instance + */ + StoredColumnsUsage.prototype.baseTable = null; + + /** + * StoredColumnsUsage storedColumnsUnusedReasons. + * @member {Array.} storedColumnsUnusedReasons + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @instance + */ + StoredColumnsUsage.prototype.storedColumnsUnusedReasons = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StoredColumnsUsage.prototype, "_isQueryAccelerated", { + get: $util.oneOfGetter($oneOfFields = ["isQueryAccelerated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StoredColumnsUsage.prototype, "_baseTable", { + get: $util.oneOfGetter($oneOfFields = ["baseTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoredColumnsUsage instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {google.cloud.bigquery.v2.IStoredColumnsUsage=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage} StoredColumnsUsage instance + */ + StoredColumnsUsage.create = function create(properties) { + return new StoredColumnsUsage(properties); + }; + + /** + * Encodes the specified StoredColumnsUsage message. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {google.cloud.bigquery.v2.IStoredColumnsUsage} message StoredColumnsUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredColumnsUsage.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.isQueryAccelerated != null && Object.hasOwnProperty.call(message, "isQueryAccelerated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isQueryAccelerated); + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.baseTable, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.storedColumnsUnusedReasons != null && message.storedColumnsUnusedReasons.length) + for (var i = 0; i < message.storedColumnsUnusedReasons.length; ++i) + $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.encode(message.storedColumnsUnusedReasons[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredColumnsUsage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {google.cloud.bigquery.v2.IStoredColumnsUsage} message StoredColumnsUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredColumnsUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StoredColumnsUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage} StoredColumnsUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredColumnsUsage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StoredColumnsUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.isQueryAccelerated = reader.bool(); + break; + } + case 2: { + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.storedColumnsUnusedReasons && message.storedColumnsUnusedReasons.length)) + message.storedColumnsUnusedReasons = []; + message.storedColumnsUnusedReasons.push($root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StoredColumnsUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage} StoredColumnsUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredColumnsUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredColumnsUsage message. + * @function verify + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredColumnsUsage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.isQueryAccelerated != null && Object.hasOwnProperty.call(message, "isQueryAccelerated")) { + properties._isQueryAccelerated = 1; + if (typeof message.isQueryAccelerated !== "boolean") + return "isQueryAccelerated: boolean expected"; + } + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + properties._baseTable = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.baseTable, long + 1); + if (error) + return "baseTable." + error; + } + } + if (message.storedColumnsUnusedReasons != null && Object.hasOwnProperty.call(message, "storedColumnsUnusedReasons")) { + if (!Array.isArray(message.storedColumnsUnusedReasons)) + return "storedColumnsUnusedReasons: array expected"; + for (var i = 0; i < message.storedColumnsUnusedReasons.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.verify(message.storedColumnsUnusedReasons[i], long + 1); + if (error) + return "storedColumnsUnusedReasons." + error; + } + } + return null; + }; + + /** + * Creates a StoredColumnsUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage} StoredColumnsUsage + */ + StoredColumnsUsage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StoredColumnsUsage) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StoredColumnsUsage(); + if (object.isQueryAccelerated != null) + message.isQueryAccelerated = Boolean(object.isQueryAccelerated); + if (object.baseTable != null) { + if (!$util.isObject(object.baseTable)) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage.baseTable: object expected"); + message.baseTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.baseTable, long + 1); + } + if (object.storedColumnsUnusedReasons) { + if (!Array.isArray(object.storedColumnsUnusedReasons)) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage.storedColumnsUnusedReasons: array expected"); + message.storedColumnsUnusedReasons = []; + for (var i = 0; i < object.storedColumnsUnusedReasons.length; ++i) { + if (!$util.isObject(object.storedColumnsUnusedReasons[i])) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage.storedColumnsUnusedReasons: object expected"); + message.storedColumnsUnusedReasons[i] = $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.fromObject(object.storedColumnsUnusedReasons[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a StoredColumnsUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {google.cloud.bigquery.v2.StoredColumnsUsage} message StoredColumnsUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredColumnsUsage.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.storedColumnsUnusedReasons = []; + if (message.isQueryAccelerated != null && Object.hasOwnProperty.call(message, "isQueryAccelerated")) { + object.isQueryAccelerated = message.isQueryAccelerated; + if (options.oneofs) + object._isQueryAccelerated = "isQueryAccelerated"; + } + if (message.baseTable != null && Object.hasOwnProperty.call(message, "baseTable")) { + object.baseTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.baseTable, options, q + 1); + if (options.oneofs) + object._baseTable = "baseTable"; + } + if (message.storedColumnsUnusedReasons && message.storedColumnsUnusedReasons.length) { + object.storedColumnsUnusedReasons = []; + for (var j = 0; j < message.storedColumnsUnusedReasons.length; ++j) + object.storedColumnsUnusedReasons[j] = $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.toObject(message.storedColumnsUnusedReasons[j], options, q + 1); + } + return object; + }; + + /** + * Converts this StoredColumnsUsage to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @instance + * @returns {Object.} JSON object + */ + StoredColumnsUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StoredColumnsUsage + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StoredColumnsUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StoredColumnsUsage"; + }; + + StoredColumnsUsage.StoredColumnsUnusedReason = (function() { + + /** + * Properties of a StoredColumnsUnusedReason. + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @interface IStoredColumnsUnusedReason + * @property {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|null} [code] StoredColumnsUnusedReason code + * @property {string|null} [message] StoredColumnsUnusedReason message + * @property {Array.|null} [uncoveredColumns] StoredColumnsUnusedReason uncoveredColumns + */ + + /** + * Constructs a new StoredColumnsUnusedReason. + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage + * @classdesc Represents a StoredColumnsUnusedReason. + * @implements IStoredColumnsUnusedReason + * @constructor + * @param {google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason=} [properties] Properties to set + */ + function StoredColumnsUnusedReason(properties) { + this.uncoveredColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StoredColumnsUnusedReason code. + * @member {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code|null|undefined} code + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @instance + */ + StoredColumnsUnusedReason.prototype.code = null; + + /** + * StoredColumnsUnusedReason message. + * @member {string|null|undefined} message + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @instance + */ + StoredColumnsUnusedReason.prototype.message = null; + + /** + * StoredColumnsUnusedReason uncoveredColumns. + * @member {Array.} uncoveredColumns + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @instance + */ + StoredColumnsUnusedReason.prototype.uncoveredColumns = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StoredColumnsUnusedReason.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StoredColumnsUnusedReason.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoredColumnsUnusedReason instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason} StoredColumnsUnusedReason instance + */ + StoredColumnsUnusedReason.create = function create(properties) { + return new StoredColumnsUnusedReason(properties); + }; + + /** + * Encodes the specified StoredColumnsUnusedReason message. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason} message StoredColumnsUnusedReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredColumnsUnusedReason.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.uncoveredColumns != null && message.uncoveredColumns.length) + for (var i = 0; i < message.uncoveredColumns.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uncoveredColumns[i]); + return writer; + }; + + /** + * Encodes the specified StoredColumnsUnusedReason message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {google.cloud.bigquery.v2.StoredColumnsUsage.IStoredColumnsUnusedReason} message StoredColumnsUnusedReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredColumnsUnusedReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StoredColumnsUnusedReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason} StoredColumnsUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredColumnsUnusedReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.uncoveredColumns && message.uncoveredColumns.length)) + message.uncoveredColumns = []; + message.uncoveredColumns.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StoredColumnsUnusedReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason} StoredColumnsUnusedReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredColumnsUnusedReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredColumnsUnusedReason message. + * @function verify + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredColumnsUnusedReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) { + properties._code = 1; + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + if (message.uncoveredColumns != null && Object.hasOwnProperty.call(message, "uncoveredColumns")) { + if (!Array.isArray(message.uncoveredColumns)) + return "uncoveredColumns: array expected"; + for (var i = 0; i < message.uncoveredColumns.length; ++i) + if (!$util.isString(message.uncoveredColumns[i])) + return "uncoveredColumns: string[] expected"; + } + return null; + }; + + /** + * Creates a StoredColumnsUnusedReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason} StoredColumnsUnusedReason + */ + StoredColumnsUnusedReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "STORED_COLUMNS_COVER_INSUFFICIENT": + case 1: + message.code = 1; + break; + case "BASE_TABLE_HAS_RLS": + case 2: + message.code = 2; + break; + case "BASE_TABLE_HAS_CLS": + case 3: + message.code = 3; + break; + case "UNSUPPORTED_PREFILTER": + case 4: + message.code = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.code = 5; + break; + case "OTHER_REASON": + case 6: + message.code = 6; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.uncoveredColumns) { + if (!Array.isArray(object.uncoveredColumns)) + throw TypeError(".google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.uncoveredColumns: array expected"); + message.uncoveredColumns = []; + for (var i = 0; i < object.uncoveredColumns.length; ++i) + message.uncoveredColumns[i] = String(object.uncoveredColumns[i]); + } + return message; + }; + + /** + * Creates a plain object from a StoredColumnsUnusedReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason} message StoredColumnsUnusedReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredColumnsUnusedReason.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uncoveredColumns = []; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) { + object.code = options.enums === String ? $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code[message.code] === undefined ? message.code : $root.google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code[message.code] : message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + if (message.uncoveredColumns && message.uncoveredColumns.length) { + object.uncoveredColumns = []; + for (var j = 0; j < message.uncoveredColumns.length; ++j) + object.uncoveredColumns[j] = message.uncoveredColumns[j]; + } + return object; + }; + + /** + * Converts this StoredColumnsUnusedReason to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @instance + * @returns {Object.} JSON object + */ + StoredColumnsUnusedReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StoredColumnsUnusedReason + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StoredColumnsUnusedReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason"; + }; + + /** + * Code enum. + * @name google.cloud.bigquery.v2.StoredColumnsUsage.StoredColumnsUnusedReason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} STORED_COLUMNS_COVER_INSUFFICIENT=1 STORED_COLUMNS_COVER_INSUFFICIENT value + * @property {number} BASE_TABLE_HAS_RLS=2 BASE_TABLE_HAS_RLS value + * @property {number} BASE_TABLE_HAS_CLS=3 BASE_TABLE_HAS_CLS value + * @property {number} UNSUPPORTED_PREFILTER=4 UNSUPPORTED_PREFILTER value + * @property {number} INTERNAL_ERROR=5 INTERNAL_ERROR value + * @property {number} OTHER_REASON=6 OTHER_REASON value + */ + StoredColumnsUnusedReason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STORED_COLUMNS_COVER_INSUFFICIENT"] = 1; + values[valuesById[2] = "BASE_TABLE_HAS_RLS"] = 2; + values[valuesById[3] = "BASE_TABLE_HAS_CLS"] = 3; + values[valuesById[4] = "UNSUPPORTED_PREFILTER"] = 4; + values[valuesById[5] = "INTERNAL_ERROR"] = 5; + values[valuesById[6] = "OTHER_REASON"] = 6; + return values; + })(); + + return StoredColumnsUnusedReason; + })(); + + return StoredColumnsUsage; + })(); + + v2.SearchStatistics = (function() { + + /** + * Properties of a SearchStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface ISearchStatistics + * @property {google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode|null} [indexUsageMode] SearchStatistics indexUsageMode + * @property {Array.|null} [indexUnusedReasons] SearchStatistics indexUnusedReasons + * @property {Array.|null} [indexPruningStats] SearchStatistics indexPruningStats + */ + + /** + * Constructs a new SearchStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SearchStatistics. + * @implements ISearchStatistics + * @constructor + * @param {google.cloud.bigquery.v2.ISearchStatistics=} [properties] Properties to set + */ + function SearchStatistics(properties) { + this.indexUnusedReasons = []; + this.indexPruningStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchStatistics indexUsageMode. + * @member {google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode} indexUsageMode + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @instance + */ + SearchStatistics.prototype.indexUsageMode = 0; + + /** + * SearchStatistics indexUnusedReasons. + * @member {Array.} indexUnusedReasons + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @instance + */ + SearchStatistics.prototype.indexUnusedReasons = $util.emptyArray; + + /** + * SearchStatistics indexPruningStats. + * @member {Array.} indexPruningStats + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @instance + */ + SearchStatistics.prototype.indexPruningStats = $util.emptyArray; + + /** + * Creates a new SearchStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {google.cloud.bigquery.v2.ISearchStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SearchStatistics} SearchStatistics instance + */ + SearchStatistics.create = function create(properties) { + return new SearchStatistics(properties); + }; + + /** + * Encodes the specified SearchStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.SearchStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {google.cloud.bigquery.v2.ISearchStatistics} message SearchStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.indexUsageMode); + if (message.indexUnusedReasons != null && message.indexUnusedReasons.length) + for (var i = 0; i < message.indexUnusedReasons.length; ++i) + $root.google.cloud.bigquery.v2.IndexUnusedReason.encode(message.indexUnusedReasons[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.indexPruningStats != null && message.indexPruningStats.length) + for (var i = 0; i < message.indexPruningStats.length; ++i) + $root.google.cloud.bigquery.v2.IndexPruningStats.encode(message.indexPruningStats[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SearchStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {google.cloud.bigquery.v2.ISearchStatistics} message SearchStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SearchStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SearchStatistics} SearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SearchStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.indexUsageMode = reader.int32(); + break; + } + case 2: { + if (!(message.indexUnusedReasons && message.indexUnusedReasons.length)) + message.indexUnusedReasons = []; + message.indexUnusedReasons.push($root.google.cloud.bigquery.v2.IndexUnusedReason.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.indexPruningStats && message.indexPruningStats.length)) + message.indexPruningStats = []; + message.indexPruningStats.push($root.google.cloud.bigquery.v2.IndexPruningStats.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SearchStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SearchStatistics} SearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + switch (message.indexUsageMode) { + default: + return "indexUsageMode: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.indexUnusedReasons != null && Object.hasOwnProperty.call(message, "indexUnusedReasons")) { + if (!Array.isArray(message.indexUnusedReasons)) + return "indexUnusedReasons: array expected"; + for (var i = 0; i < message.indexUnusedReasons.length; ++i) { + var error = $root.google.cloud.bigquery.v2.IndexUnusedReason.verify(message.indexUnusedReasons[i], long + 1); + if (error) + return "indexUnusedReasons." + error; + } + } + if (message.indexPruningStats != null && Object.hasOwnProperty.call(message, "indexPruningStats")) { + if (!Array.isArray(message.indexPruningStats)) + return "indexPruningStats: array expected"; + for (var i = 0; i < message.indexPruningStats.length; ++i) { + var error = $root.google.cloud.bigquery.v2.IndexPruningStats.verify(message.indexPruningStats[i], long + 1); + if (error) + return "indexPruningStats." + error; + } + } + return null; + }; + + /** + * Creates a SearchStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SearchStatistics} SearchStatistics + */ + SearchStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SearchStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SearchStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SearchStatistics(); + switch (object.indexUsageMode) { + default: + if (typeof object.indexUsageMode === "number") { + message.indexUsageMode = object.indexUsageMode; + break; + } + break; + case "INDEX_USAGE_MODE_UNSPECIFIED": + case 0: + message.indexUsageMode = 0; + break; + case "UNUSED": + case 1: + message.indexUsageMode = 1; + break; + case "PARTIALLY_USED": + case 2: + message.indexUsageMode = 2; + break; + case "FULLY_USED": + case 4: + message.indexUsageMode = 4; + break; + } + if (object.indexUnusedReasons) { + if (!Array.isArray(object.indexUnusedReasons)) + throw TypeError(".google.cloud.bigquery.v2.SearchStatistics.indexUnusedReasons: array expected"); + message.indexUnusedReasons = []; + for (var i = 0; i < object.indexUnusedReasons.length; ++i) { + if (!$util.isObject(object.indexUnusedReasons[i])) + throw TypeError(".google.cloud.bigquery.v2.SearchStatistics.indexUnusedReasons: object expected"); + message.indexUnusedReasons[i] = $root.google.cloud.bigquery.v2.IndexUnusedReason.fromObject(object.indexUnusedReasons[i], long + 1); + } + } + if (object.indexPruningStats) { + if (!Array.isArray(object.indexPruningStats)) + throw TypeError(".google.cloud.bigquery.v2.SearchStatistics.indexPruningStats: array expected"); + message.indexPruningStats = []; + for (var i = 0; i < object.indexPruningStats.length; ++i) { + if (!$util.isObject(object.indexPruningStats[i])) + throw TypeError(".google.cloud.bigquery.v2.SearchStatistics.indexPruningStats: object expected"); + message.indexPruningStats[i] = $root.google.cloud.bigquery.v2.IndexPruningStats.fromObject(object.indexPruningStats[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {google.cloud.bigquery.v2.SearchStatistics} message SearchStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.indexUnusedReasons = []; + object.indexPruningStats = []; + } + if (options.defaults) + object.indexUsageMode = options.enums === String ? "INDEX_USAGE_MODE_UNSPECIFIED" : 0; + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + object.indexUsageMode = options.enums === String ? $root.google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode[message.indexUsageMode] === undefined ? message.indexUsageMode : $root.google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode[message.indexUsageMode] : message.indexUsageMode; + if (message.indexUnusedReasons && message.indexUnusedReasons.length) { + object.indexUnusedReasons = []; + for (var j = 0; j < message.indexUnusedReasons.length; ++j) + object.indexUnusedReasons[j] = $root.google.cloud.bigquery.v2.IndexUnusedReason.toObject(message.indexUnusedReasons[j], options, q + 1); + } + if (message.indexPruningStats && message.indexPruningStats.length) { + object.indexPruningStats = []; + for (var j = 0; j < message.indexPruningStats.length; ++j) + object.indexPruningStats[j] = $root.google.cloud.bigquery.v2.IndexPruningStats.toObject(message.indexPruningStats[j], options, q + 1); + } + return object; + }; + + /** + * Converts this SearchStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @instance + * @returns {Object.} JSON object + */ + SearchStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SearchStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SearchStatistics"; + }; + + /** + * IndexUsageMode enum. + * @name google.cloud.bigquery.v2.SearchStatistics.IndexUsageMode + * @enum {number} + * @property {number} INDEX_USAGE_MODE_UNSPECIFIED=0 INDEX_USAGE_MODE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} PARTIALLY_USED=2 PARTIALLY_USED value + * @property {number} FULLY_USED=4 FULLY_USED value + */ + SearchStatistics.IndexUsageMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INDEX_USAGE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "PARTIALLY_USED"] = 2; + values[valuesById[4] = "FULLY_USED"] = 4; + return values; + })(); + + return SearchStatistics; + })(); + + v2.VectorSearchStatistics = (function() { + + /** + * Properties of a VectorSearchStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IVectorSearchStatistics + * @property {google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode|null} [indexUsageMode] VectorSearchStatistics indexUsageMode + * @property {Array.|null} [indexUnusedReasons] VectorSearchStatistics indexUnusedReasons + * @property {Array.|null} [storedColumnsUsages] VectorSearchStatistics storedColumnsUsages + */ + + /** + * Constructs a new VectorSearchStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a VectorSearchStatistics. + * @implements IVectorSearchStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IVectorSearchStatistics=} [properties] Properties to set + */ + function VectorSearchStatistics(properties) { + this.indexUnusedReasons = []; + this.storedColumnsUsages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VectorSearchStatistics indexUsageMode. + * @member {google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode} indexUsageMode + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @instance + */ + VectorSearchStatistics.prototype.indexUsageMode = 0; + + /** + * VectorSearchStatistics indexUnusedReasons. + * @member {Array.} indexUnusedReasons + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @instance + */ + VectorSearchStatistics.prototype.indexUnusedReasons = $util.emptyArray; + + /** + * VectorSearchStatistics storedColumnsUsages. + * @member {Array.} storedColumnsUsages + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @instance + */ + VectorSearchStatistics.prototype.storedColumnsUsages = $util.emptyArray; + + /** + * Creates a new VectorSearchStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {google.cloud.bigquery.v2.IVectorSearchStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.VectorSearchStatistics} VectorSearchStatistics instance + */ + VectorSearchStatistics.create = function create(properties) { + return new VectorSearchStatistics(properties); + }; + + /** + * Encodes the specified VectorSearchStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.VectorSearchStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {google.cloud.bigquery.v2.IVectorSearchStatistics} message VectorSearchStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VectorSearchStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.indexUsageMode); + if (message.indexUnusedReasons != null && message.indexUnusedReasons.length) + for (var i = 0; i < message.indexUnusedReasons.length; ++i) + $root.google.cloud.bigquery.v2.IndexUnusedReason.encode(message.indexUnusedReasons[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.storedColumnsUsages != null && message.storedColumnsUsages.length) + for (var i = 0; i < message.storedColumnsUsages.length; ++i) + $root.google.cloud.bigquery.v2.StoredColumnsUsage.encode(message.storedColumnsUsages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified VectorSearchStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.VectorSearchStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {google.cloud.bigquery.v2.IVectorSearchStatistics} message VectorSearchStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VectorSearchStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a VectorSearchStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.VectorSearchStatistics} VectorSearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VectorSearchStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.VectorSearchStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.indexUsageMode = reader.int32(); + break; + } + case 2: { + if (!(message.indexUnusedReasons && message.indexUnusedReasons.length)) + message.indexUnusedReasons = []; + message.indexUnusedReasons.push($root.google.cloud.bigquery.v2.IndexUnusedReason.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.storedColumnsUsages && message.storedColumnsUsages.length)) + message.storedColumnsUsages = []; + message.storedColumnsUsages.push($root.google.cloud.bigquery.v2.StoredColumnsUsage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VectorSearchStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.VectorSearchStatistics} VectorSearchStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VectorSearchStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VectorSearchStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VectorSearchStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + switch (message.indexUsageMode) { + default: + return "indexUsageMode: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.indexUnusedReasons != null && Object.hasOwnProperty.call(message, "indexUnusedReasons")) { + if (!Array.isArray(message.indexUnusedReasons)) + return "indexUnusedReasons: array expected"; + for (var i = 0; i < message.indexUnusedReasons.length; ++i) { + var error = $root.google.cloud.bigquery.v2.IndexUnusedReason.verify(message.indexUnusedReasons[i], long + 1); + if (error) + return "indexUnusedReasons." + error; + } + } + if (message.storedColumnsUsages != null && Object.hasOwnProperty.call(message, "storedColumnsUsages")) { + if (!Array.isArray(message.storedColumnsUsages)) + return "storedColumnsUsages: array expected"; + for (var i = 0; i < message.storedColumnsUsages.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StoredColumnsUsage.verify(message.storedColumnsUsages[i], long + 1); + if (error) + return "storedColumnsUsages." + error; + } + } + return null; + }; + + /** + * Creates a VectorSearchStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.VectorSearchStatistics} VectorSearchStatistics + */ + VectorSearchStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.VectorSearchStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.VectorSearchStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.VectorSearchStatistics(); + switch (object.indexUsageMode) { + default: + if (typeof object.indexUsageMode === "number") { + message.indexUsageMode = object.indexUsageMode; + break; + } + break; + case "INDEX_USAGE_MODE_UNSPECIFIED": + case 0: + message.indexUsageMode = 0; + break; + case "UNUSED": + case 1: + message.indexUsageMode = 1; + break; + case "PARTIALLY_USED": + case 2: + message.indexUsageMode = 2; + break; + case "FULLY_USED": + case 4: + message.indexUsageMode = 4; + break; + } + if (object.indexUnusedReasons) { + if (!Array.isArray(object.indexUnusedReasons)) + throw TypeError(".google.cloud.bigquery.v2.VectorSearchStatistics.indexUnusedReasons: array expected"); + message.indexUnusedReasons = []; + for (var i = 0; i < object.indexUnusedReasons.length; ++i) { + if (!$util.isObject(object.indexUnusedReasons[i])) + throw TypeError(".google.cloud.bigquery.v2.VectorSearchStatistics.indexUnusedReasons: object expected"); + message.indexUnusedReasons[i] = $root.google.cloud.bigquery.v2.IndexUnusedReason.fromObject(object.indexUnusedReasons[i], long + 1); + } + } + if (object.storedColumnsUsages) { + if (!Array.isArray(object.storedColumnsUsages)) + throw TypeError(".google.cloud.bigquery.v2.VectorSearchStatistics.storedColumnsUsages: array expected"); + message.storedColumnsUsages = []; + for (var i = 0; i < object.storedColumnsUsages.length; ++i) { + if (!$util.isObject(object.storedColumnsUsages[i])) + throw TypeError(".google.cloud.bigquery.v2.VectorSearchStatistics.storedColumnsUsages: object expected"); + message.storedColumnsUsages[i] = $root.google.cloud.bigquery.v2.StoredColumnsUsage.fromObject(object.storedColumnsUsages[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a VectorSearchStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {google.cloud.bigquery.v2.VectorSearchStatistics} message VectorSearchStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VectorSearchStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.indexUnusedReasons = []; + object.storedColumnsUsages = []; + } + if (options.defaults) + object.indexUsageMode = options.enums === String ? "INDEX_USAGE_MODE_UNSPECIFIED" : 0; + if (message.indexUsageMode != null && Object.hasOwnProperty.call(message, "indexUsageMode")) + object.indexUsageMode = options.enums === String ? $root.google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode[message.indexUsageMode] === undefined ? message.indexUsageMode : $root.google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode[message.indexUsageMode] : message.indexUsageMode; + if (message.indexUnusedReasons && message.indexUnusedReasons.length) { + object.indexUnusedReasons = []; + for (var j = 0; j < message.indexUnusedReasons.length; ++j) + object.indexUnusedReasons[j] = $root.google.cloud.bigquery.v2.IndexUnusedReason.toObject(message.indexUnusedReasons[j], options, q + 1); + } + if (message.storedColumnsUsages && message.storedColumnsUsages.length) { + object.storedColumnsUsages = []; + for (var j = 0; j < message.storedColumnsUsages.length; ++j) + object.storedColumnsUsages[j] = $root.google.cloud.bigquery.v2.StoredColumnsUsage.toObject(message.storedColumnsUsages[j], options, q + 1); + } + return object; + }; + + /** + * Converts this VectorSearchStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @instance + * @returns {Object.} JSON object + */ + VectorSearchStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VectorSearchStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.VectorSearchStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VectorSearchStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.VectorSearchStatistics"; + }; + + /** + * IndexUsageMode enum. + * @name google.cloud.bigquery.v2.VectorSearchStatistics.IndexUsageMode + * @enum {number} + * @property {number} INDEX_USAGE_MODE_UNSPECIFIED=0 INDEX_USAGE_MODE_UNSPECIFIED value + * @property {number} UNUSED=1 UNUSED value + * @property {number} PARTIALLY_USED=2 PARTIALLY_USED value + * @property {number} FULLY_USED=4 FULLY_USED value + */ + VectorSearchStatistics.IndexUsageMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INDEX_USAGE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNUSED"] = 1; + values[valuesById[2] = "PARTIALLY_USED"] = 2; + values[valuesById[4] = "FULLY_USED"] = 4; + return values; + })(); + + return VectorSearchStatistics; + })(); + + v2.QueryInfo = (function() { + + /** + * Properties of a QueryInfo. + * @memberof google.cloud.bigquery.v2 + * @interface IQueryInfo + * @property {google.protobuf.IStruct|null} [optimizationDetails] QueryInfo optimizationDetails + */ + + /** + * Constructs a new QueryInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a QueryInfo. + * @implements IQueryInfo + * @constructor + * @param {google.cloud.bigquery.v2.IQueryInfo=} [properties] Properties to set + */ + function QueryInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInfo optimizationDetails. + * @member {google.protobuf.IStruct|null|undefined} optimizationDetails + * @memberof google.cloud.bigquery.v2.QueryInfo + * @instance + */ + QueryInfo.prototype.optimizationDetails = null; + + /** + * Creates a new QueryInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {google.cloud.bigquery.v2.IQueryInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.QueryInfo} QueryInfo instance + */ + QueryInfo.create = function create(properties) { + return new QueryInfo(properties); + }; + + /** + * Encodes the specified QueryInfo message. Does not implicitly {@link google.cloud.bigquery.v2.QueryInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {google.cloud.bigquery.v2.IQueryInfo} message QueryInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.optimizationDetails != null && Object.hasOwnProperty.call(message, "optimizationDetails")) + $root.google.protobuf.Struct.encode(message.optimizationDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.QueryInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {google.cloud.bigquery.v2.IQueryInfo} message QueryInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a QueryInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.QueryInfo} QueryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.QueryInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.optimizationDetails = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.QueryInfo} QueryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.optimizationDetails != null && Object.hasOwnProperty.call(message, "optimizationDetails")) { + var error = $root.google.protobuf.Struct.verify(message.optimizationDetails, long + 1); + if (error) + return "optimizationDetails." + error; + } + return null; + }; + + /** + * Creates a QueryInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.QueryInfo} QueryInfo + */ + QueryInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.QueryInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.QueryInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.QueryInfo(); + if (object.optimizationDetails != null) { + if (!$util.isObject(object.optimizationDetails)) + throw TypeError(".google.cloud.bigquery.v2.QueryInfo.optimizationDetails: object expected"); + message.optimizationDetails = $root.google.protobuf.Struct.fromObject(object.optimizationDetails, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a QueryInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {google.cloud.bigquery.v2.QueryInfo} message QueryInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.optimizationDetails = null; + if (message.optimizationDetails != null && Object.hasOwnProperty.call(message, "optimizationDetails")) + object.optimizationDetails = $root.google.protobuf.Struct.toObject(message.optimizationDetails, options, q + 1); + return object; + }; + + /** + * Converts this QueryInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.QueryInfo + * @instance + * @returns {Object.} JSON object + */ + QueryInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.QueryInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.QueryInfo"; + }; + + return QueryInfo; + })(); + + v2.LoadQueryStatistics = (function() { + + /** + * Properties of a LoadQueryStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface ILoadQueryStatistics + * @property {google.protobuf.IInt64Value|null} [inputFiles] LoadQueryStatistics inputFiles + * @property {google.protobuf.IInt64Value|null} [inputFileBytes] LoadQueryStatistics inputFileBytes + * @property {google.protobuf.IInt64Value|null} [outputRows] LoadQueryStatistics outputRows + * @property {google.protobuf.IInt64Value|null} [outputBytes] LoadQueryStatistics outputBytes + * @property {google.protobuf.IInt64Value|null} [badRecords] LoadQueryStatistics badRecords + */ + + /** + * Constructs a new LoadQueryStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a LoadQueryStatistics. + * @implements ILoadQueryStatistics + * @constructor + * @param {google.cloud.bigquery.v2.ILoadQueryStatistics=} [properties] Properties to set + */ + function LoadQueryStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadQueryStatistics inputFiles. + * @member {google.protobuf.IInt64Value|null|undefined} inputFiles + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + */ + LoadQueryStatistics.prototype.inputFiles = null; + + /** + * LoadQueryStatistics inputFileBytes. + * @member {google.protobuf.IInt64Value|null|undefined} inputFileBytes + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + */ + LoadQueryStatistics.prototype.inputFileBytes = null; + + /** + * LoadQueryStatistics outputRows. + * @member {google.protobuf.IInt64Value|null|undefined} outputRows + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + */ + LoadQueryStatistics.prototype.outputRows = null; + + /** + * LoadQueryStatistics outputBytes. + * @member {google.protobuf.IInt64Value|null|undefined} outputBytes + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + */ + LoadQueryStatistics.prototype.outputBytes = null; + + /** + * LoadQueryStatistics badRecords. + * @member {google.protobuf.IInt64Value|null|undefined} badRecords + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + */ + LoadQueryStatistics.prototype.badRecords = null; + + /** + * Creates a new LoadQueryStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {google.cloud.bigquery.v2.ILoadQueryStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.LoadQueryStatistics} LoadQueryStatistics instance + */ + LoadQueryStatistics.create = function create(properties) { + return new LoadQueryStatistics(properties); + }; + + /** + * Encodes the specified LoadQueryStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.LoadQueryStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {google.cloud.bigquery.v2.ILoadQueryStatistics} message LoadQueryStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadQueryStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) + $root.google.protobuf.Int64Value.encode(message.inputFiles, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) + $root.google.protobuf.Int64Value.encode(message.inputFileBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + $root.google.protobuf.Int64Value.encode(message.outputRows, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) + $root.google.protobuf.Int64Value.encode(message.outputBytes, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) + $root.google.protobuf.Int64Value.encode(message.badRecords, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoadQueryStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LoadQueryStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {google.cloud.bigquery.v2.ILoadQueryStatistics} message LoadQueryStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadQueryStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LoadQueryStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.LoadQueryStatistics} LoadQueryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadQueryStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.LoadQueryStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputFiles = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.inputFileBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.badRecords = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoadQueryStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.LoadQueryStatistics} LoadQueryStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadQueryStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadQueryStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadQueryStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) { + var error = $root.google.protobuf.Int64Value.verify(message.inputFiles, long + 1); + if (error) + return "inputFiles." + error; + } + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.inputFileBytes, long + 1); + if (error) + return "inputFileBytes." + error; + } + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.outputRows, long + 1); + if (error) + return "outputRows." + error; + } + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.outputBytes, long + 1); + if (error) + return "outputBytes." + error; + } + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) { + var error = $root.google.protobuf.Int64Value.verify(message.badRecords, long + 1); + if (error) + return "badRecords." + error; + } + return null; + }; + + /** + * Creates a LoadQueryStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.LoadQueryStatistics} LoadQueryStatistics + */ + LoadQueryStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.LoadQueryStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.LoadQueryStatistics(); + if (object.inputFiles != null) { + if (!$util.isObject(object.inputFiles)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics.inputFiles: object expected"); + message.inputFiles = $root.google.protobuf.Int64Value.fromObject(object.inputFiles, long + 1); + } + if (object.inputFileBytes != null) { + if (!$util.isObject(object.inputFileBytes)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics.inputFileBytes: object expected"); + message.inputFileBytes = $root.google.protobuf.Int64Value.fromObject(object.inputFileBytes, long + 1); + } + if (object.outputRows != null) { + if (!$util.isObject(object.outputRows)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics.outputRows: object expected"); + message.outputRows = $root.google.protobuf.Int64Value.fromObject(object.outputRows, long + 1); + } + if (object.outputBytes != null) { + if (!$util.isObject(object.outputBytes)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics.outputBytes: object expected"); + message.outputBytes = $root.google.protobuf.Int64Value.fromObject(object.outputBytes, long + 1); + } + if (object.badRecords != null) { + if (!$util.isObject(object.badRecords)) + throw TypeError(".google.cloud.bigquery.v2.LoadQueryStatistics.badRecords: object expected"); + message.badRecords = $root.google.protobuf.Int64Value.fromObject(object.badRecords, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LoadQueryStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {google.cloud.bigquery.v2.LoadQueryStatistics} message LoadQueryStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadQueryStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.inputFiles = null; + object.inputFileBytes = null; + object.outputRows = null; + object.outputBytes = null; + object.badRecords = null; + } + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) + object.inputFiles = $root.google.protobuf.Int64Value.toObject(message.inputFiles, options, q + 1); + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) + object.inputFileBytes = $root.google.protobuf.Int64Value.toObject(message.inputFileBytes, options, q + 1); + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + object.outputRows = $root.google.protobuf.Int64Value.toObject(message.outputRows, options, q + 1); + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) + object.outputBytes = $root.google.protobuf.Int64Value.toObject(message.outputBytes, options, q + 1); + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) + object.badRecords = $root.google.protobuf.Int64Value.toObject(message.badRecords, options, q + 1); + return object; + }; + + /** + * Converts this LoadQueryStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @instance + * @returns {Object.} JSON object + */ + LoadQueryStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadQueryStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.LoadQueryStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadQueryStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.LoadQueryStatistics"; + }; + + return LoadQueryStatistics; + })(); + + v2.IncrementalResultStats = (function() { + + /** + * Properties of an IncrementalResultStats. + * @memberof google.cloud.bigquery.v2 + * @interface IIncrementalResultStats + * @property {google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason|null} [disabledReason] IncrementalResultStats disabledReason + * @property {string|null} [disabledReasonDetails] IncrementalResultStats disabledReasonDetails + * @property {google.protobuf.ITimestamp|null} [resultSetLastReplaceTime] IncrementalResultStats resultSetLastReplaceTime + * @property {google.protobuf.ITimestamp|null} [resultSetLastModifyTime] IncrementalResultStats resultSetLastModifyTime + * @property {google.protobuf.ITimestamp|null} [firstIncrementalRowTime] IncrementalResultStats firstIncrementalRowTime + * @property {google.protobuf.ITimestamp|null} [lastIncrementalRowTime] IncrementalResultStats lastIncrementalRowTime + * @property {number|Long|null} [incrementalRowCount] IncrementalResultStats incrementalRowCount + */ + + /** + * Constructs a new IncrementalResultStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an IncrementalResultStats. + * @implements IIncrementalResultStats + * @constructor + * @param {google.cloud.bigquery.v2.IIncrementalResultStats=} [properties] Properties to set + */ + function IncrementalResultStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IncrementalResultStats disabledReason. + * @member {google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason} disabledReason + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.disabledReason = 0; + + /** + * IncrementalResultStats disabledReasonDetails. + * @member {string} disabledReasonDetails + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.disabledReasonDetails = ""; + + /** + * IncrementalResultStats resultSetLastReplaceTime. + * @member {google.protobuf.ITimestamp|null|undefined} resultSetLastReplaceTime + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.resultSetLastReplaceTime = null; + + /** + * IncrementalResultStats resultSetLastModifyTime. + * @member {google.protobuf.ITimestamp|null|undefined} resultSetLastModifyTime + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.resultSetLastModifyTime = null; + + /** + * IncrementalResultStats firstIncrementalRowTime. + * @member {google.protobuf.ITimestamp|null|undefined} firstIncrementalRowTime + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.firstIncrementalRowTime = null; + + /** + * IncrementalResultStats lastIncrementalRowTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastIncrementalRowTime + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.lastIncrementalRowTime = null; + + /** + * IncrementalResultStats incrementalRowCount. + * @member {number|Long|null|undefined} incrementalRowCount + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + */ + IncrementalResultStats.prototype.incrementalRowCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(IncrementalResultStats.prototype, "_incrementalRowCount", { + get: $util.oneOfGetter($oneOfFields = ["incrementalRowCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IncrementalResultStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {google.cloud.bigquery.v2.IIncrementalResultStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.IncrementalResultStats} IncrementalResultStats instance + */ + IncrementalResultStats.create = function create(properties) { + return new IncrementalResultStats(properties); + }; + + /** + * Encodes the specified IncrementalResultStats message. Does not implicitly {@link google.cloud.bigquery.v2.IncrementalResultStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {google.cloud.bigquery.v2.IIncrementalResultStats} message IncrementalResultStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalResultStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.disabledReason != null && Object.hasOwnProperty.call(message, "disabledReason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.disabledReason); + if (message.resultSetLastReplaceTime != null && Object.hasOwnProperty.call(message, "resultSetLastReplaceTime")) + $root.google.protobuf.Timestamp.encode(message.resultSetLastReplaceTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.resultSetLastModifyTime != null && Object.hasOwnProperty.call(message, "resultSetLastModifyTime")) + $root.google.protobuf.Timestamp.encode(message.resultSetLastModifyTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.disabledReasonDetails != null && Object.hasOwnProperty.call(message, "disabledReasonDetails")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.disabledReasonDetails); + if (message.firstIncrementalRowTime != null && Object.hasOwnProperty.call(message, "firstIncrementalRowTime")) + $root.google.protobuf.Timestamp.encode(message.firstIncrementalRowTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.lastIncrementalRowTime != null && Object.hasOwnProperty.call(message, "lastIncrementalRowTime")) + $root.google.protobuf.Timestamp.encode(message.lastIncrementalRowTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.incrementalRowCount != null && Object.hasOwnProperty.call(message, "incrementalRowCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.incrementalRowCount); + return writer; + }; + + /** + * Encodes the specified IncrementalResultStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.IncrementalResultStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {google.cloud.bigquery.v2.IIncrementalResultStats} message IncrementalResultStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IncrementalResultStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IncrementalResultStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.IncrementalResultStats} IncrementalResultStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalResultStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.IncrementalResultStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.disabledReason = reader.int32(); + break; + } + case 4: { + message.disabledReasonDetails = reader.string(); + break; + } + case 2: { + message.resultSetLastReplaceTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.resultSetLastModifyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.firstIncrementalRowTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.lastIncrementalRowTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.incrementalRowCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IncrementalResultStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.IncrementalResultStats} IncrementalResultStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IncrementalResultStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IncrementalResultStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IncrementalResultStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.disabledReason != null && Object.hasOwnProperty.call(message, "disabledReason")) + switch (message.disabledReason) { + default: + return "disabledReason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.disabledReasonDetails != null && Object.hasOwnProperty.call(message, "disabledReasonDetails")) + if (!$util.isString(message.disabledReasonDetails)) + return "disabledReasonDetails: string expected"; + if (message.resultSetLastReplaceTime != null && Object.hasOwnProperty.call(message, "resultSetLastReplaceTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.resultSetLastReplaceTime, long + 1); + if (error) + return "resultSetLastReplaceTime." + error; + } + if (message.resultSetLastModifyTime != null && Object.hasOwnProperty.call(message, "resultSetLastModifyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.resultSetLastModifyTime, long + 1); + if (error) + return "resultSetLastModifyTime." + error; + } + if (message.firstIncrementalRowTime != null && Object.hasOwnProperty.call(message, "firstIncrementalRowTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.firstIncrementalRowTime, long + 1); + if (error) + return "firstIncrementalRowTime." + error; + } + if (message.lastIncrementalRowTime != null && Object.hasOwnProperty.call(message, "lastIncrementalRowTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastIncrementalRowTime, long + 1); + if (error) + return "lastIncrementalRowTime." + error; + } + if (message.incrementalRowCount != null && Object.hasOwnProperty.call(message, "incrementalRowCount")) { + properties._incrementalRowCount = 1; + if (!$util.isInteger(message.incrementalRowCount) && !(message.incrementalRowCount && $util.isInteger(message.incrementalRowCount.low) && $util.isInteger(message.incrementalRowCount.high))) + return "incrementalRowCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates an IncrementalResultStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.IncrementalResultStats} IncrementalResultStats + */ + IncrementalResultStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.IncrementalResultStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.IncrementalResultStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.IncrementalResultStats(); + switch (object.disabledReason) { + default: + if (typeof object.disabledReason === "number") { + message.disabledReason = object.disabledReason; + break; + } + break; + case "DISABLED_REASON_UNSPECIFIED": + case 0: + message.disabledReason = 0; + break; + case "OTHER": + case 1: + message.disabledReason = 1; + break; + case "UNSUPPORTED_OPERATOR": + case 2: + message.disabledReason = 2; + break; + } + if (object.disabledReasonDetails != null) + message.disabledReasonDetails = String(object.disabledReasonDetails); + if (object.resultSetLastReplaceTime != null) { + if (!$util.isObject(object.resultSetLastReplaceTime)) + throw TypeError(".google.cloud.bigquery.v2.IncrementalResultStats.resultSetLastReplaceTime: object expected"); + message.resultSetLastReplaceTime = $root.google.protobuf.Timestamp.fromObject(object.resultSetLastReplaceTime, long + 1); + } + if (object.resultSetLastModifyTime != null) { + if (!$util.isObject(object.resultSetLastModifyTime)) + throw TypeError(".google.cloud.bigquery.v2.IncrementalResultStats.resultSetLastModifyTime: object expected"); + message.resultSetLastModifyTime = $root.google.protobuf.Timestamp.fromObject(object.resultSetLastModifyTime, long + 1); + } + if (object.firstIncrementalRowTime != null) { + if (!$util.isObject(object.firstIncrementalRowTime)) + throw TypeError(".google.cloud.bigquery.v2.IncrementalResultStats.firstIncrementalRowTime: object expected"); + message.firstIncrementalRowTime = $root.google.protobuf.Timestamp.fromObject(object.firstIncrementalRowTime, long + 1); + } + if (object.lastIncrementalRowTime != null) { + if (!$util.isObject(object.lastIncrementalRowTime)) + throw TypeError(".google.cloud.bigquery.v2.IncrementalResultStats.lastIncrementalRowTime: object expected"); + message.lastIncrementalRowTime = $root.google.protobuf.Timestamp.fromObject(object.lastIncrementalRowTime, long + 1); + } + if (object.incrementalRowCount != null) + if ($util.Long) + message.incrementalRowCount = $util.Long.fromValue(object.incrementalRowCount, false); + else if (typeof object.incrementalRowCount === "string") + message.incrementalRowCount = parseInt(object.incrementalRowCount, 10); + else if (typeof object.incrementalRowCount === "number") + message.incrementalRowCount = object.incrementalRowCount; + else if (typeof object.incrementalRowCount === "object") + message.incrementalRowCount = new $util.LongBits(object.incrementalRowCount.low >>> 0, object.incrementalRowCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an IncrementalResultStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {google.cloud.bigquery.v2.IncrementalResultStats} message IncrementalResultStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IncrementalResultStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.disabledReason = options.enums === String ? "DISABLED_REASON_UNSPECIFIED" : 0; + object.resultSetLastReplaceTime = null; + object.resultSetLastModifyTime = null; + object.disabledReasonDetails = ""; + object.firstIncrementalRowTime = null; + object.lastIncrementalRowTime = null; + } + if (message.disabledReason != null && Object.hasOwnProperty.call(message, "disabledReason")) + object.disabledReason = options.enums === String ? $root.google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason[message.disabledReason] === undefined ? message.disabledReason : $root.google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason[message.disabledReason] : message.disabledReason; + if (message.resultSetLastReplaceTime != null && Object.hasOwnProperty.call(message, "resultSetLastReplaceTime")) + object.resultSetLastReplaceTime = $root.google.protobuf.Timestamp.toObject(message.resultSetLastReplaceTime, options, q + 1); + if (message.resultSetLastModifyTime != null && Object.hasOwnProperty.call(message, "resultSetLastModifyTime")) + object.resultSetLastModifyTime = $root.google.protobuf.Timestamp.toObject(message.resultSetLastModifyTime, options, q + 1); + if (message.disabledReasonDetails != null && Object.hasOwnProperty.call(message, "disabledReasonDetails")) + object.disabledReasonDetails = message.disabledReasonDetails; + if (message.firstIncrementalRowTime != null && Object.hasOwnProperty.call(message, "firstIncrementalRowTime")) + object.firstIncrementalRowTime = $root.google.protobuf.Timestamp.toObject(message.firstIncrementalRowTime, options, q + 1); + if (message.lastIncrementalRowTime != null && Object.hasOwnProperty.call(message, "lastIncrementalRowTime")) + object.lastIncrementalRowTime = $root.google.protobuf.Timestamp.toObject(message.lastIncrementalRowTime, options, q + 1); + if (message.incrementalRowCount != null && Object.hasOwnProperty.call(message, "incrementalRowCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.incrementalRowCount = typeof message.incrementalRowCount === "number" ? BigInt(message.incrementalRowCount) : $util.Long.fromBits(message.incrementalRowCount.low >>> 0, message.incrementalRowCount.high >>> 0, false).toBigInt(); + else if (typeof message.incrementalRowCount === "number") + object.incrementalRowCount = options.longs === String ? String(message.incrementalRowCount) : message.incrementalRowCount; + else + object.incrementalRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.incrementalRowCount) : options.longs === Number ? new $util.LongBits(message.incrementalRowCount.low >>> 0, message.incrementalRowCount.high >>> 0).toNumber() : message.incrementalRowCount; + if (options.oneofs) + object._incrementalRowCount = "incrementalRowCount"; + } + return object; + }; + + /** + * Converts this IncrementalResultStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @instance + * @returns {Object.} JSON object + */ + IncrementalResultStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IncrementalResultStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.IncrementalResultStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IncrementalResultStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.IncrementalResultStats"; + }; + + /** + * DisabledReason enum. + * @name google.cloud.bigquery.v2.IncrementalResultStats.DisabledReason + * @enum {number} + * @property {number} DISABLED_REASON_UNSPECIFIED=0 DISABLED_REASON_UNSPECIFIED value + * @property {number} OTHER=1 OTHER value + * @property {number} UNSUPPORTED_OPERATOR=2 UNSUPPORTED_OPERATOR value + */ + IncrementalResultStats.DisabledReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISABLED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "OTHER"] = 1; + values[valuesById[2] = "UNSUPPORTED_OPERATOR"] = 2; + return values; + })(); + + return IncrementalResultStats; + })(); + + v2.JobStatistics2 = (function() { + + /** + * Properties of a JobStatistics2. + * @memberof google.cloud.bigquery.v2 + * @interface IJobStatistics2 + * @property {Array.|null} [queryPlan] JobStatistics2 queryPlan + * @property {google.protobuf.IInt64Value|null} [estimatedBytesProcessed] JobStatistics2 estimatedBytesProcessed + * @property {Array.|null} [timeline] JobStatistics2 timeline + * @property {google.protobuf.IInt64Value|null} [totalPartitionsProcessed] JobStatistics2 totalPartitionsProcessed + * @property {google.protobuf.IInt64Value|null} [totalBytesProcessed] JobStatistics2 totalBytesProcessed + * @property {string|null} [totalBytesProcessedAccuracy] JobStatistics2 totalBytesProcessedAccuracy + * @property {google.protobuf.IInt64Value|null} [totalBytesBilled] JobStatistics2 totalBytesBilled + * @property {google.protobuf.IInt32Value|null} [billingTier] JobStatistics2 billingTier + * @property {google.protobuf.IInt64Value|null} [totalSlotMs] JobStatistics2 totalSlotMs + * @property {number|Long|null} [totalServicesSkuSlotMs] JobStatistics2 totalServicesSkuSlotMs + * @property {google.protobuf.IBoolValue|null} [cacheHit] JobStatistics2 cacheHit + * @property {Array.|null} [referencedTables] JobStatistics2 referencedTables + * @property {Array.|null} [referencedRoutines] JobStatistics2 referencedRoutines + * @property {Array.|null} [referencedPropertyGraphs] JobStatistics2 referencedPropertyGraphs + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] JobStatistics2 schema + * @property {google.protobuf.IInt64Value|null} [numDmlAffectedRows] JobStatistics2 numDmlAffectedRows + * @property {google.cloud.bigquery.v2.IDmlStats|null} [dmlStats] JobStatistics2 dmlStats + * @property {Array.|null} [undeclaredQueryParameters] JobStatistics2 undeclaredQueryParameters + * @property {string|null} [statementType] JobStatistics2 statementType + * @property {string|null} [ddlOperationPerformed] JobStatistics2 ddlOperationPerformed + * @property {google.cloud.bigquery.v2.ITableReference|null} [ddlTargetTable] JobStatistics2 ddlTargetTable + * @property {google.cloud.bigquery.v2.ITableReference|null} [ddlDestinationTable] JobStatistics2 ddlDestinationTable + * @property {google.cloud.bigquery.v2.IRowAccessPolicyReference|null} [ddlTargetRowAccessPolicy] JobStatistics2 ddlTargetRowAccessPolicy + * @property {google.protobuf.IInt64Value|null} [ddlAffectedRowAccessPolicyCount] JobStatistics2 ddlAffectedRowAccessPolicyCount + * @property {google.cloud.bigquery.v2.IRoutineReference|null} [ddlTargetRoutine] JobStatistics2 ddlTargetRoutine + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [ddlTargetDataset] JobStatistics2 ddlTargetDataset + * @property {google.cloud.bigquery.v2.IMlStatistics|null} [mlStatistics] JobStatistics2 mlStatistics + * @property {google.cloud.bigquery.v2.IExportDataStatistics|null} [exportDataStatistics] JobStatistics2 exportDataStatistics + * @property {Array.|null} [externalServiceCosts] JobStatistics2 externalServiceCosts + * @property {google.cloud.bigquery.v2.IBiEngineStatistics|null} [biEngineStatistics] JobStatistics2 biEngineStatistics + * @property {google.cloud.bigquery.v2.ILoadQueryStatistics|null} [loadQueryStatistics] JobStatistics2 loadQueryStatistics + * @property {google.cloud.bigquery.v2.ITableReference|null} [dclTargetTable] JobStatistics2 dclTargetTable + * @property {google.cloud.bigquery.v2.ITableReference|null} [dclTargetView] JobStatistics2 dclTargetView + * @property {google.cloud.bigquery.v2.IDatasetReference|null} [dclTargetDataset] JobStatistics2 dclTargetDataset + * @property {google.cloud.bigquery.v2.ISearchStatistics|null} [searchStatistics] JobStatistics2 searchStatistics + * @property {google.cloud.bigquery.v2.IVectorSearchStatistics|null} [vectorSearchStatistics] JobStatistics2 vectorSearchStatistics + * @property {google.cloud.bigquery.v2.IPerformanceInsights|null} [performanceInsights] JobStatistics2 performanceInsights + * @property {google.cloud.bigquery.v2.IQueryInfo|null} [queryInfo] JobStatistics2 queryInfo + * @property {google.cloud.bigquery.v2.ISparkStatistics|null} [sparkStatistics] JobStatistics2 sparkStatistics + * @property {google.protobuf.IInt64Value|null} [transferredBytes] JobStatistics2 transferredBytes + * @property {google.cloud.bigquery.v2.IMaterializedViewStatistics|null} [materializedViewStatistics] JobStatistics2 materializedViewStatistics + * @property {google.cloud.bigquery.v2.IMetadataCacheStatistics|null} [metadataCacheStatistics] JobStatistics2 metadataCacheStatistics + * @property {google.cloud.bigquery.v2.IIncrementalResultStats|null} [incrementalResultStats] JobStatistics2 incrementalResultStats + * @property {google.cloud.bigquery.v2.IGenAiStats|null} [genAiStats] JobStatistics2 genAiStats + */ + + /** + * Constructs a new JobStatistics2. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobStatistics2. + * @implements IJobStatistics2 + * @constructor + * @param {google.cloud.bigquery.v2.IJobStatistics2=} [properties] Properties to set + */ + function JobStatistics2(properties) { + this.queryPlan = []; + this.timeline = []; + this.referencedTables = []; + this.referencedRoutines = []; + this.referencedPropertyGraphs = []; + this.undeclaredQueryParameters = []; + this.externalServiceCosts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatistics2 queryPlan. + * @member {Array.} queryPlan + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.queryPlan = $util.emptyArray; + + /** + * JobStatistics2 estimatedBytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} estimatedBytesProcessed + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.estimatedBytesProcessed = null; + + /** + * JobStatistics2 timeline. + * @member {Array.} timeline + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.timeline = $util.emptyArray; + + /** + * JobStatistics2 totalPartitionsProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} totalPartitionsProcessed + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalPartitionsProcessed = null; + + /** + * JobStatistics2 totalBytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} totalBytesProcessed + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalBytesProcessed = null; + + /** + * JobStatistics2 totalBytesProcessedAccuracy. + * @member {string} totalBytesProcessedAccuracy + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalBytesProcessedAccuracy = ""; + + /** + * JobStatistics2 totalBytesBilled. + * @member {google.protobuf.IInt64Value|null|undefined} totalBytesBilled + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalBytesBilled = null; + + /** + * JobStatistics2 billingTier. + * @member {google.protobuf.IInt32Value|null|undefined} billingTier + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.billingTier = null; + + /** + * JobStatistics2 totalSlotMs. + * @member {google.protobuf.IInt64Value|null|undefined} totalSlotMs + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalSlotMs = null; + + /** + * JobStatistics2 totalServicesSkuSlotMs. + * @member {number|Long|null|undefined} totalServicesSkuSlotMs + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.totalServicesSkuSlotMs = null; + + /** + * JobStatistics2 cacheHit. + * @member {google.protobuf.IBoolValue|null|undefined} cacheHit + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.cacheHit = null; + + /** + * JobStatistics2 referencedTables. + * @member {Array.} referencedTables + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.referencedTables = $util.emptyArray; + + /** + * JobStatistics2 referencedRoutines. + * @member {Array.} referencedRoutines + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.referencedRoutines = $util.emptyArray; + + /** + * JobStatistics2 referencedPropertyGraphs. + * @member {Array.} referencedPropertyGraphs + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.referencedPropertyGraphs = $util.emptyArray; + + /** + * JobStatistics2 schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.schema = null; + + /** + * JobStatistics2 numDmlAffectedRows. + * @member {google.protobuf.IInt64Value|null|undefined} numDmlAffectedRows + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.numDmlAffectedRows = null; + + /** + * JobStatistics2 dmlStats. + * @member {google.cloud.bigquery.v2.IDmlStats|null|undefined} dmlStats + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.dmlStats = null; + + /** + * JobStatistics2 undeclaredQueryParameters. + * @member {Array.} undeclaredQueryParameters + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.undeclaredQueryParameters = $util.emptyArray; + + /** + * JobStatistics2 statementType. + * @member {string} statementType + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.statementType = ""; + + /** + * JobStatistics2 ddlOperationPerformed. + * @member {string} ddlOperationPerformed + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlOperationPerformed = ""; + + /** + * JobStatistics2 ddlTargetTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} ddlTargetTable + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlTargetTable = null; + + /** + * JobStatistics2 ddlDestinationTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} ddlDestinationTable + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlDestinationTable = null; + + /** + * JobStatistics2 ddlTargetRowAccessPolicy. + * @member {google.cloud.bigquery.v2.IRowAccessPolicyReference|null|undefined} ddlTargetRowAccessPolicy + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlTargetRowAccessPolicy = null; + + /** + * JobStatistics2 ddlAffectedRowAccessPolicyCount. + * @member {google.protobuf.IInt64Value|null|undefined} ddlAffectedRowAccessPolicyCount + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlAffectedRowAccessPolicyCount = null; + + /** + * JobStatistics2 ddlTargetRoutine. + * @member {google.cloud.bigquery.v2.IRoutineReference|null|undefined} ddlTargetRoutine + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlTargetRoutine = null; + + /** + * JobStatistics2 ddlTargetDataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} ddlTargetDataset + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.ddlTargetDataset = null; + + /** + * JobStatistics2 mlStatistics. + * @member {google.cloud.bigquery.v2.IMlStatistics|null|undefined} mlStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.mlStatistics = null; + + /** + * JobStatistics2 exportDataStatistics. + * @member {google.cloud.bigquery.v2.IExportDataStatistics|null|undefined} exportDataStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.exportDataStatistics = null; + + /** + * JobStatistics2 externalServiceCosts. + * @member {Array.} externalServiceCosts + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.externalServiceCosts = $util.emptyArray; + + /** + * JobStatistics2 biEngineStatistics. + * @member {google.cloud.bigquery.v2.IBiEngineStatistics|null|undefined} biEngineStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.biEngineStatistics = null; + + /** + * JobStatistics2 loadQueryStatistics. + * @member {google.cloud.bigquery.v2.ILoadQueryStatistics|null|undefined} loadQueryStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.loadQueryStatistics = null; + + /** + * JobStatistics2 dclTargetTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} dclTargetTable + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.dclTargetTable = null; + + /** + * JobStatistics2 dclTargetView. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} dclTargetView + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.dclTargetView = null; + + /** + * JobStatistics2 dclTargetDataset. + * @member {google.cloud.bigquery.v2.IDatasetReference|null|undefined} dclTargetDataset + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.dclTargetDataset = null; + + /** + * JobStatistics2 searchStatistics. + * @member {google.cloud.bigquery.v2.ISearchStatistics|null|undefined} searchStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.searchStatistics = null; + + /** + * JobStatistics2 vectorSearchStatistics. + * @member {google.cloud.bigquery.v2.IVectorSearchStatistics|null|undefined} vectorSearchStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.vectorSearchStatistics = null; + + /** + * JobStatistics2 performanceInsights. + * @member {google.cloud.bigquery.v2.IPerformanceInsights|null|undefined} performanceInsights + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.performanceInsights = null; + + /** + * JobStatistics2 queryInfo. + * @member {google.cloud.bigquery.v2.IQueryInfo|null|undefined} queryInfo + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.queryInfo = null; + + /** + * JobStatistics2 sparkStatistics. + * @member {google.cloud.bigquery.v2.ISparkStatistics|null|undefined} sparkStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.sparkStatistics = null; + + /** + * JobStatistics2 transferredBytes. + * @member {google.protobuf.IInt64Value|null|undefined} transferredBytes + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.transferredBytes = null; + + /** + * JobStatistics2 materializedViewStatistics. + * @member {google.cloud.bigquery.v2.IMaterializedViewStatistics|null|undefined} materializedViewStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.materializedViewStatistics = null; + + /** + * JobStatistics2 metadataCacheStatistics. + * @member {google.cloud.bigquery.v2.IMetadataCacheStatistics|null|undefined} metadataCacheStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.metadataCacheStatistics = null; + + /** + * JobStatistics2 incrementalResultStats. + * @member {google.cloud.bigquery.v2.IIncrementalResultStats|null|undefined} incrementalResultStats + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.incrementalResultStats = null; + + /** + * JobStatistics2 genAiStats. + * @member {google.cloud.bigquery.v2.IGenAiStats|null|undefined} genAiStats + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + */ + JobStatistics2.prototype.genAiStats = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JobStatistics2.prototype, "_totalServicesSkuSlotMs", { + get: $util.oneOfGetter($oneOfFields = ["totalServicesSkuSlotMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JobStatistics2 instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics2=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatistics2} JobStatistics2 instance + */ + JobStatistics2.create = function create(properties) { + return new JobStatistics2(properties); + }; + + /** + * Encodes the specified JobStatistics2 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics2.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics2} message JobStatistics2 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics2.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.queryPlan != null && message.queryPlan.length) + for (var i = 0; i < message.queryPlan.length; ++i) + $root.google.cloud.bigquery.v2.ExplainQueryStage.encode(message.queryPlan[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.estimatedBytesProcessed != null && Object.hasOwnProperty.call(message, "estimatedBytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.estimatedBytesProcessed, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.timeline != null && message.timeline.length) + for (var i = 0; i < message.timeline.length; ++i) + $root.google.cloud.bigquery.v2.QueryTimelineSample.encode(message.timeline[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.totalPartitionsProcessed != null && Object.hasOwnProperty.call(message, "totalPartitionsProcessed")) + $root.google.protobuf.Int64Value.encode(message.totalPartitionsProcessed, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.totalBytesProcessed, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) + $root.google.protobuf.Int64Value.encode(message.totalBytesBilled, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.billingTier != null && Object.hasOwnProperty.call(message, "billingTier")) + $root.google.protobuf.Int32Value.encode(message.billingTier, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + $root.google.protobuf.Int64Value.encode(message.totalSlotMs, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + $root.google.protobuf.BoolValue.encode(message.cacheHit, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.referencedTables != null && message.referencedTables.length) + for (var i = 0; i < message.referencedTables.length; ++i) + $root.google.cloud.bigquery.v2.TableReference.encode(message.referencedTables[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + $root.google.protobuf.Int64Value.encode(message.numDmlAffectedRows, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.undeclaredQueryParameters != null && message.undeclaredQueryParameters.length) + for (var i = 0; i < message.undeclaredQueryParameters.length; ++i) + $root.google.cloud.bigquery.v2.QueryParameter.encode(message.undeclaredQueryParameters[i], writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.statementType != null && Object.hasOwnProperty.call(message, "statementType")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.statementType); + if (message.ddlOperationPerformed != null && Object.hasOwnProperty.call(message, "ddlOperationPerformed")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ddlOperationPerformed); + if (message.ddlTargetTable != null && Object.hasOwnProperty.call(message, "ddlTargetTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.ddlTargetTable, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.totalBytesProcessedAccuracy != null && Object.hasOwnProperty.call(message, "totalBytesProcessedAccuracy")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.totalBytesProcessedAccuracy); + if (message.ddlTargetRoutine != null && Object.hasOwnProperty.call(message, "ddlTargetRoutine")) + $root.google.cloud.bigquery.v2.RoutineReference.encode(message.ddlTargetRoutine, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.mlStatistics != null && Object.hasOwnProperty.call(message, "mlStatistics")) + $root.google.cloud.bigquery.v2.MlStatistics.encode(message.mlStatistics, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.referencedRoutines != null && message.referencedRoutines.length) + for (var i = 0; i < message.referencedRoutines.length; ++i) + $root.google.cloud.bigquery.v2.RoutineReference.encode(message.referencedRoutines[i], writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.exportDataStatistics != null && Object.hasOwnProperty.call(message, "exportDataStatistics")) + $root.google.cloud.bigquery.v2.ExportDataStatistics.encode(message.exportDataStatistics, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.ddlTargetRowAccessPolicy != null && Object.hasOwnProperty.call(message, "ddlTargetRowAccessPolicy")) + $root.google.cloud.bigquery.v2.RowAccessPolicyReference.encode(message.ddlTargetRowAccessPolicy, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.ddlAffectedRowAccessPolicyCount != null && Object.hasOwnProperty.call(message, "ddlAffectedRowAccessPolicyCount")) + $root.google.protobuf.Int64Value.encode(message.ddlAffectedRowAccessPolicyCount, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.externalServiceCosts != null && message.externalServiceCosts.length) + for (var i = 0; i < message.externalServiceCosts.length; ++i) + $root.google.cloud.bigquery.v2.ExternalServiceCost.encode(message.externalServiceCosts[i], writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); + if (message.biEngineStatistics != null && Object.hasOwnProperty.call(message, "biEngineStatistics")) + $root.google.cloud.bigquery.v2.BiEngineStatistics.encode(message.biEngineStatistics, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.ddlTargetDataset != null && Object.hasOwnProperty.call(message, "ddlTargetDataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.ddlTargetDataset, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); + if (message.ddlDestinationTable != null && Object.hasOwnProperty.call(message, "ddlDestinationTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.ddlDestinationTable, writer.uint32(/* id 31, wireType 2 =*/250).fork(), q + 1).ldelim(); + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) + $root.google.cloud.bigquery.v2.DmlStats.encode(message.dmlStats, writer.uint32(/* id 32, wireType 2 =*/258).fork(), q + 1).ldelim(); + if (message.loadQueryStatistics != null && Object.hasOwnProperty.call(message, "loadQueryStatistics")) + $root.google.cloud.bigquery.v2.LoadQueryStatistics.encode(message.loadQueryStatistics, writer.uint32(/* id 33, wireType 2 =*/266).fork(), q + 1).ldelim(); + if (message.dclTargetTable != null && Object.hasOwnProperty.call(message, "dclTargetTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.dclTargetTable, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + if (message.dclTargetView != null && Object.hasOwnProperty.call(message, "dclTargetView")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.dclTargetView, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); + if (message.dclTargetDataset != null && Object.hasOwnProperty.call(message, "dclTargetDataset")) + $root.google.cloud.bigquery.v2.DatasetReference.encode(message.dclTargetDataset, writer.uint32(/* id 36, wireType 2 =*/290).fork(), q + 1).ldelim(); + if (message.searchStatistics != null && Object.hasOwnProperty.call(message, "searchStatistics")) + $root.google.cloud.bigquery.v2.SearchStatistics.encode(message.searchStatistics, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); + if (message.performanceInsights != null && Object.hasOwnProperty.call(message, "performanceInsights")) + $root.google.cloud.bigquery.v2.PerformanceInsights.encode(message.performanceInsights, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); + if (message.queryInfo != null && Object.hasOwnProperty.call(message, "queryInfo")) + $root.google.cloud.bigquery.v2.QueryInfo.encode(message.queryInfo, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); + if (message.sparkStatistics != null && Object.hasOwnProperty.call(message, "sparkStatistics")) + $root.google.cloud.bigquery.v2.SparkStatistics.encode(message.sparkStatistics, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); + if (message.transferredBytes != null && Object.hasOwnProperty.call(message, "transferredBytes")) + $root.google.protobuf.Int64Value.encode(message.transferredBytes, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); + if (message.materializedViewStatistics != null && Object.hasOwnProperty.call(message, "materializedViewStatistics")) + $root.google.cloud.bigquery.v2.MaterializedViewStatistics.encode(message.materializedViewStatistics, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); + if (message.metadataCacheStatistics != null && Object.hasOwnProperty.call(message, "metadataCacheStatistics")) + $root.google.cloud.bigquery.v2.MetadataCacheStatistics.encode(message.metadataCacheStatistics, writer.uint32(/* id 43, wireType 2 =*/346).fork(), q + 1).ldelim(); + if (message.vectorSearchStatistics != null && Object.hasOwnProperty.call(message, "vectorSearchStatistics")) + $root.google.cloud.bigquery.v2.VectorSearchStatistics.encode(message.vectorSearchStatistics, writer.uint32(/* id 44, wireType 2 =*/354).fork(), q + 1).ldelim(); + if (message.referencedPropertyGraphs != null && message.referencedPropertyGraphs.length) + for (var i = 0; i < message.referencedPropertyGraphs.length; ++i) + $root.google.cloud.bigquery.v2.PropertyGraphReference.encode(message.referencedPropertyGraphs[i], writer.uint32(/* id 49, wireType 2 =*/394).fork(), q + 1).ldelim(); + if (message.totalServicesSkuSlotMs != null && Object.hasOwnProperty.call(message, "totalServicesSkuSlotMs")) + writer.uint32(/* id 52, wireType 0 =*/416).int64(message.totalServicesSkuSlotMs); + if (message.incrementalResultStats != null && Object.hasOwnProperty.call(message, "incrementalResultStats")) + $root.google.cloud.bigquery.v2.IncrementalResultStats.encode(message.incrementalResultStats, writer.uint32(/* id 53, wireType 2 =*/426).fork(), q + 1).ldelim(); + if (message.genAiStats != null && Object.hasOwnProperty.call(message, "genAiStats")) + $root.google.cloud.bigquery.v2.GenAiStats.encode(message.genAiStats, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatistics2 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics2.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics2} message JobStatistics2 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics2.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobStatistics2 message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatistics2} JobStatistics2 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics2.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatistics2(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.queryPlan && message.queryPlan.length)) + message.queryPlan = []; + message.queryPlan.push($root.google.cloud.bigquery.v2.ExplainQueryStage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.estimatedBytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.timeline && message.timeline.length)) + message.timeline = []; + message.timeline.push($root.google.cloud.bigquery.v2.QueryTimelineSample.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.totalPartitionsProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.totalBytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.totalBytesProcessedAccuracy = reader.string(); + break; + } + case 6: { + message.totalBytesBilled = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.billingTier = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.totalSlotMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 52: { + message.totalServicesSkuSlotMs = reader.int64(); + break; + } + case 9: { + message.cacheHit = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + if (!(message.referencedTables && message.referencedTables.length)) + message.referencedTables = []; + message.referencedTables.push($root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 24: { + if (!(message.referencedRoutines && message.referencedRoutines.length)) + message.referencedRoutines = []; + message.referencedRoutines.push($root.google.cloud.bigquery.v2.RoutineReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 49: { + if (!(message.referencedPropertyGraphs && message.referencedPropertyGraphs.length)) + message.referencedPropertyGraphs = []; + message.referencedPropertyGraphs.push($root.google.cloud.bigquery.v2.PropertyGraphReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 32: { + message.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + if (!(message.undeclaredQueryParameters && message.undeclaredQueryParameters.length)) + message.undeclaredQueryParameters = []; + message.undeclaredQueryParameters.push($root.google.cloud.bigquery.v2.QueryParameter.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 14: { + message.statementType = reader.string(); + break; + } + case 15: { + message.ddlOperationPerformed = reader.string(); + break; + } + case 16: { + message.ddlTargetTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.ddlDestinationTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.ddlTargetRowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.ddlAffectedRowAccessPolicyCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.ddlTargetRoutine = $root.google.cloud.bigquery.v2.RoutineReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.ddlTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.mlStatistics = $root.google.cloud.bigquery.v2.MlStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.exportDataStatistics = $root.google.cloud.bigquery.v2.ExportDataStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + if (!(message.externalServiceCosts && message.externalServiceCosts.length)) + message.externalServiceCosts = []; + message.externalServiceCosts.push($root.google.cloud.bigquery.v2.ExternalServiceCost.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 29: { + message.biEngineStatistics = $root.google.cloud.bigquery.v2.BiEngineStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.loadQueryStatistics = $root.google.cloud.bigquery.v2.LoadQueryStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 34: { + message.dclTargetTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 35: { + message.dclTargetView = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 36: { + message.dclTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + message.searchStatistics = $root.google.cloud.bigquery.v2.SearchStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 44: { + message.vectorSearchStatistics = $root.google.cloud.bigquery.v2.VectorSearchStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.performanceInsights = $root.google.cloud.bigquery.v2.PerformanceInsights.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 39: { + message.queryInfo = $root.google.cloud.bigquery.v2.QueryInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 40: { + message.sparkStatistics = $root.google.cloud.bigquery.v2.SparkStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 41: { + message.transferredBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.materializedViewStatistics = $root.google.cloud.bigquery.v2.MaterializedViewStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 43: { + message.metadataCacheStatistics = $root.google.cloud.bigquery.v2.MetadataCacheStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 53: { + message.incrementalResultStats = $root.google.cloud.bigquery.v2.IncrementalResultStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 54: { + message.genAiStats = $root.google.cloud.bigquery.v2.GenAiStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatistics2 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatistics2} JobStatistics2 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics2.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatistics2 message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatistics2.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) { + if (!Array.isArray(message.queryPlan)) + return "queryPlan: array expected"; + for (var i = 0; i < message.queryPlan.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ExplainQueryStage.verify(message.queryPlan[i], long + 1); + if (error) + return "queryPlan." + error; + } + } + if (message.estimatedBytesProcessed != null && Object.hasOwnProperty.call(message, "estimatedBytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.estimatedBytesProcessed, long + 1); + if (error) + return "estimatedBytesProcessed." + error; + } + if (message.timeline != null && Object.hasOwnProperty.call(message, "timeline")) { + if (!Array.isArray(message.timeline)) + return "timeline: array expected"; + for (var i = 0; i < message.timeline.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryTimelineSample.verify(message.timeline[i], long + 1); + if (error) + return "timeline." + error; + } + } + if (message.totalPartitionsProcessed != null && Object.hasOwnProperty.call(message, "totalPartitionsProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalPartitionsProcessed, long + 1); + if (error) + return "totalPartitionsProcessed." + error; + } + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalBytesProcessed, long + 1); + if (error) + return "totalBytesProcessed." + error; + } + if (message.totalBytesProcessedAccuracy != null && Object.hasOwnProperty.call(message, "totalBytesProcessedAccuracy")) + if (!$util.isString(message.totalBytesProcessedAccuracy)) + return "totalBytesProcessedAccuracy: string expected"; + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalBytesBilled, long + 1); + if (error) + return "totalBytesBilled." + error; + } + if (message.billingTier != null && Object.hasOwnProperty.call(message, "billingTier")) { + var error = $root.google.protobuf.Int32Value.verify(message.billingTier, long + 1); + if (error) + return "billingTier." + error; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalSlotMs, long + 1); + if (error) + return "totalSlotMs." + error; + } + if (message.totalServicesSkuSlotMs != null && Object.hasOwnProperty.call(message, "totalServicesSkuSlotMs")) { + properties._totalServicesSkuSlotMs = 1; + if (!$util.isInteger(message.totalServicesSkuSlotMs) && !(message.totalServicesSkuSlotMs && $util.isInteger(message.totalServicesSkuSlotMs.low) && $util.isInteger(message.totalServicesSkuSlotMs.high))) + return "totalServicesSkuSlotMs: integer|Long expected"; + } + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) { + var error = $root.google.protobuf.BoolValue.verify(message.cacheHit, long + 1); + if (error) + return "cacheHit." + error; + } + if (message.referencedTables != null && Object.hasOwnProperty.call(message, "referencedTables")) { + if (!Array.isArray(message.referencedTables)) + return "referencedTables: array expected"; + for (var i = 0; i < message.referencedTables.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.referencedTables[i], long + 1); + if (error) + return "referencedTables." + error; + } + } + if (message.referencedRoutines != null && Object.hasOwnProperty.call(message, "referencedRoutines")) { + if (!Array.isArray(message.referencedRoutines)) + return "referencedRoutines: array expected"; + for (var i = 0; i < message.referencedRoutines.length; ++i) { + var error = $root.google.cloud.bigquery.v2.RoutineReference.verify(message.referencedRoutines[i], long + 1); + if (error) + return "referencedRoutines." + error; + } + } + if (message.referencedPropertyGraphs != null && Object.hasOwnProperty.call(message, "referencedPropertyGraphs")) { + if (!Array.isArray(message.referencedPropertyGraphs)) + return "referencedPropertyGraphs: array expected"; + for (var i = 0; i < message.referencedPropertyGraphs.length; ++i) { + var error = $root.google.cloud.bigquery.v2.PropertyGraphReference.verify(message.referencedPropertyGraphs[i], long + 1); + if (error) + return "referencedPropertyGraphs." + error; + } + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.numDmlAffectedRows, long + 1); + if (error) + return "numDmlAffectedRows." + error; + } + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) { + var error = $root.google.cloud.bigquery.v2.DmlStats.verify(message.dmlStats, long + 1); + if (error) + return "dmlStats." + error; + } + if (message.undeclaredQueryParameters != null && Object.hasOwnProperty.call(message, "undeclaredQueryParameters")) { + if (!Array.isArray(message.undeclaredQueryParameters)) + return "undeclaredQueryParameters: array expected"; + for (var i = 0; i < message.undeclaredQueryParameters.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryParameter.verify(message.undeclaredQueryParameters[i], long + 1); + if (error) + return "undeclaredQueryParameters." + error; + } + } + if (message.statementType != null && Object.hasOwnProperty.call(message, "statementType")) + if (!$util.isString(message.statementType)) + return "statementType: string expected"; + if (message.ddlOperationPerformed != null && Object.hasOwnProperty.call(message, "ddlOperationPerformed")) + if (!$util.isString(message.ddlOperationPerformed)) + return "ddlOperationPerformed: string expected"; + if (message.ddlTargetTable != null && Object.hasOwnProperty.call(message, "ddlTargetTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.ddlTargetTable, long + 1); + if (error) + return "ddlTargetTable." + error; + } + if (message.ddlDestinationTable != null && Object.hasOwnProperty.call(message, "ddlDestinationTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.ddlDestinationTable, long + 1); + if (error) + return "ddlDestinationTable." + error; + } + if (message.ddlTargetRowAccessPolicy != null && Object.hasOwnProperty.call(message, "ddlTargetRowAccessPolicy")) { + var error = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.verify(message.ddlTargetRowAccessPolicy, long + 1); + if (error) + return "ddlTargetRowAccessPolicy." + error; + } + if (message.ddlAffectedRowAccessPolicyCount != null && Object.hasOwnProperty.call(message, "ddlAffectedRowAccessPolicyCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.ddlAffectedRowAccessPolicyCount, long + 1); + if (error) + return "ddlAffectedRowAccessPolicyCount." + error; + } + if (message.ddlTargetRoutine != null && Object.hasOwnProperty.call(message, "ddlTargetRoutine")) { + var error = $root.google.cloud.bigquery.v2.RoutineReference.verify(message.ddlTargetRoutine, long + 1); + if (error) + return "ddlTargetRoutine." + error; + } + if (message.ddlTargetDataset != null && Object.hasOwnProperty.call(message, "ddlTargetDataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.ddlTargetDataset, long + 1); + if (error) + return "ddlTargetDataset." + error; + } + if (message.mlStatistics != null && Object.hasOwnProperty.call(message, "mlStatistics")) { + var error = $root.google.cloud.bigquery.v2.MlStatistics.verify(message.mlStatistics, long + 1); + if (error) + return "mlStatistics." + error; + } + if (message.exportDataStatistics != null && Object.hasOwnProperty.call(message, "exportDataStatistics")) { + var error = $root.google.cloud.bigquery.v2.ExportDataStatistics.verify(message.exportDataStatistics, long + 1); + if (error) + return "exportDataStatistics." + error; + } + if (message.externalServiceCosts != null && Object.hasOwnProperty.call(message, "externalServiceCosts")) { + if (!Array.isArray(message.externalServiceCosts)) + return "externalServiceCosts: array expected"; + for (var i = 0; i < message.externalServiceCosts.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ExternalServiceCost.verify(message.externalServiceCosts[i], long + 1); + if (error) + return "externalServiceCosts." + error; + } + } + if (message.biEngineStatistics != null && Object.hasOwnProperty.call(message, "biEngineStatistics")) { + var error = $root.google.cloud.bigquery.v2.BiEngineStatistics.verify(message.biEngineStatistics, long + 1); + if (error) + return "biEngineStatistics." + error; + } + if (message.loadQueryStatistics != null && Object.hasOwnProperty.call(message, "loadQueryStatistics")) { + var error = $root.google.cloud.bigquery.v2.LoadQueryStatistics.verify(message.loadQueryStatistics, long + 1); + if (error) + return "loadQueryStatistics." + error; + } + if (message.dclTargetTable != null && Object.hasOwnProperty.call(message, "dclTargetTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.dclTargetTable, long + 1); + if (error) + return "dclTargetTable." + error; + } + if (message.dclTargetView != null && Object.hasOwnProperty.call(message, "dclTargetView")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.dclTargetView, long + 1); + if (error) + return "dclTargetView." + error; + } + if (message.dclTargetDataset != null && Object.hasOwnProperty.call(message, "dclTargetDataset")) { + var error = $root.google.cloud.bigquery.v2.DatasetReference.verify(message.dclTargetDataset, long + 1); + if (error) + return "dclTargetDataset." + error; + } + if (message.searchStatistics != null && Object.hasOwnProperty.call(message, "searchStatistics")) { + var error = $root.google.cloud.bigquery.v2.SearchStatistics.verify(message.searchStatistics, long + 1); + if (error) + return "searchStatistics." + error; + } + if (message.vectorSearchStatistics != null && Object.hasOwnProperty.call(message, "vectorSearchStatistics")) { + var error = $root.google.cloud.bigquery.v2.VectorSearchStatistics.verify(message.vectorSearchStatistics, long + 1); + if (error) + return "vectorSearchStatistics." + error; + } + if (message.performanceInsights != null && Object.hasOwnProperty.call(message, "performanceInsights")) { + var error = $root.google.cloud.bigquery.v2.PerformanceInsights.verify(message.performanceInsights, long + 1); + if (error) + return "performanceInsights." + error; + } + if (message.queryInfo != null && Object.hasOwnProperty.call(message, "queryInfo")) { + var error = $root.google.cloud.bigquery.v2.QueryInfo.verify(message.queryInfo, long + 1); + if (error) + return "queryInfo." + error; + } + if (message.sparkStatistics != null && Object.hasOwnProperty.call(message, "sparkStatistics")) { + var error = $root.google.cloud.bigquery.v2.SparkStatistics.verify(message.sparkStatistics, long + 1); + if (error) + return "sparkStatistics." + error; + } + if (message.transferredBytes != null && Object.hasOwnProperty.call(message, "transferredBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.transferredBytes, long + 1); + if (error) + return "transferredBytes." + error; + } + if (message.materializedViewStatistics != null && Object.hasOwnProperty.call(message, "materializedViewStatistics")) { + var error = $root.google.cloud.bigquery.v2.MaterializedViewStatistics.verify(message.materializedViewStatistics, long + 1); + if (error) + return "materializedViewStatistics." + error; + } + if (message.metadataCacheStatistics != null && Object.hasOwnProperty.call(message, "metadataCacheStatistics")) { + var error = $root.google.cloud.bigquery.v2.MetadataCacheStatistics.verify(message.metadataCacheStatistics, long + 1); + if (error) + return "metadataCacheStatistics." + error; + } + if (message.incrementalResultStats != null && Object.hasOwnProperty.call(message, "incrementalResultStats")) { + var error = $root.google.cloud.bigquery.v2.IncrementalResultStats.verify(message.incrementalResultStats, long + 1); + if (error) + return "incrementalResultStats." + error; + } + if (message.genAiStats != null && Object.hasOwnProperty.call(message, "genAiStats")) { + var error = $root.google.cloud.bigquery.v2.GenAiStats.verify(message.genAiStats, long + 1); + if (error) + return "genAiStats." + error; + } + return null; + }; + + /** + * Creates a JobStatistics2 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatistics2} JobStatistics2 + */ + JobStatistics2.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatistics2) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatistics2(); + if (object.queryPlan) { + if (!Array.isArray(object.queryPlan)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.queryPlan: array expected"); + message.queryPlan = []; + for (var i = 0; i < object.queryPlan.length; ++i) { + if (!$util.isObject(object.queryPlan[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.queryPlan: object expected"); + message.queryPlan[i] = $root.google.cloud.bigquery.v2.ExplainQueryStage.fromObject(object.queryPlan[i], long + 1); + } + } + if (object.estimatedBytesProcessed != null) { + if (!$util.isObject(object.estimatedBytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.estimatedBytesProcessed: object expected"); + message.estimatedBytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.estimatedBytesProcessed, long + 1); + } + if (object.timeline) { + if (!Array.isArray(object.timeline)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.timeline: array expected"); + message.timeline = []; + for (var i = 0; i < object.timeline.length; ++i) { + if (!$util.isObject(object.timeline[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.timeline: object expected"); + message.timeline[i] = $root.google.cloud.bigquery.v2.QueryTimelineSample.fromObject(object.timeline[i], long + 1); + } + } + if (object.totalPartitionsProcessed != null) { + if (!$util.isObject(object.totalPartitionsProcessed)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.totalPartitionsProcessed: object expected"); + message.totalPartitionsProcessed = $root.google.protobuf.Int64Value.fromObject(object.totalPartitionsProcessed, long + 1); + } + if (object.totalBytesProcessed != null) { + if (!$util.isObject(object.totalBytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.totalBytesProcessed: object expected"); + message.totalBytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.totalBytesProcessed, long + 1); + } + if (object.totalBytesProcessedAccuracy != null) + message.totalBytesProcessedAccuracy = String(object.totalBytesProcessedAccuracy); + if (object.totalBytesBilled != null) { + if (!$util.isObject(object.totalBytesBilled)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.totalBytesBilled: object expected"); + message.totalBytesBilled = $root.google.protobuf.Int64Value.fromObject(object.totalBytesBilled, long + 1); + } + if (object.billingTier != null) { + if (!$util.isObject(object.billingTier)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.billingTier: object expected"); + message.billingTier = $root.google.protobuf.Int32Value.fromObject(object.billingTier, long + 1); + } + if (object.totalSlotMs != null) { + if (!$util.isObject(object.totalSlotMs)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.totalSlotMs: object expected"); + message.totalSlotMs = $root.google.protobuf.Int64Value.fromObject(object.totalSlotMs, long + 1); + } + if (object.totalServicesSkuSlotMs != null) + if ($util.Long) + message.totalServicesSkuSlotMs = $util.Long.fromValue(object.totalServicesSkuSlotMs, false); + else if (typeof object.totalServicesSkuSlotMs === "string") + message.totalServicesSkuSlotMs = parseInt(object.totalServicesSkuSlotMs, 10); + else if (typeof object.totalServicesSkuSlotMs === "number") + message.totalServicesSkuSlotMs = object.totalServicesSkuSlotMs; + else if (typeof object.totalServicesSkuSlotMs === "object") + message.totalServicesSkuSlotMs = new $util.LongBits(object.totalServicesSkuSlotMs.low >>> 0, object.totalServicesSkuSlotMs.high >>> 0).toNumber(); + if (object.cacheHit != null) { + if (!$util.isObject(object.cacheHit)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.cacheHit: object expected"); + message.cacheHit = $root.google.protobuf.BoolValue.fromObject(object.cacheHit, long + 1); + } + if (object.referencedTables) { + if (!Array.isArray(object.referencedTables)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedTables: array expected"); + message.referencedTables = []; + for (var i = 0; i < object.referencedTables.length; ++i) { + if (!$util.isObject(object.referencedTables[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedTables: object expected"); + message.referencedTables[i] = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.referencedTables[i], long + 1); + } + } + if (object.referencedRoutines) { + if (!Array.isArray(object.referencedRoutines)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedRoutines: array expected"); + message.referencedRoutines = []; + for (var i = 0; i < object.referencedRoutines.length; ++i) { + if (!$util.isObject(object.referencedRoutines[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedRoutines: object expected"); + message.referencedRoutines[i] = $root.google.cloud.bigquery.v2.RoutineReference.fromObject(object.referencedRoutines[i], long + 1); + } + } + if (object.referencedPropertyGraphs) { + if (!Array.isArray(object.referencedPropertyGraphs)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedPropertyGraphs: array expected"); + message.referencedPropertyGraphs = []; + for (var i = 0; i < object.referencedPropertyGraphs.length; ++i) { + if (!$util.isObject(object.referencedPropertyGraphs[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.referencedPropertyGraphs: object expected"); + message.referencedPropertyGraphs[i] = $root.google.cloud.bigquery.v2.PropertyGraphReference.fromObject(object.referencedPropertyGraphs[i], long + 1); + } + } + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.numDmlAffectedRows != null) { + if (!$util.isObject(object.numDmlAffectedRows)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.numDmlAffectedRows: object expected"); + message.numDmlAffectedRows = $root.google.protobuf.Int64Value.fromObject(object.numDmlAffectedRows, long + 1); + } + if (object.dmlStats != null) { + if (!$util.isObject(object.dmlStats)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.dmlStats: object expected"); + message.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.fromObject(object.dmlStats, long + 1); + } + if (object.undeclaredQueryParameters) { + if (!Array.isArray(object.undeclaredQueryParameters)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.undeclaredQueryParameters: array expected"); + message.undeclaredQueryParameters = []; + for (var i = 0; i < object.undeclaredQueryParameters.length; ++i) { + if (!$util.isObject(object.undeclaredQueryParameters[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.undeclaredQueryParameters: object expected"); + message.undeclaredQueryParameters[i] = $root.google.cloud.bigquery.v2.QueryParameter.fromObject(object.undeclaredQueryParameters[i], long + 1); + } + } + if (object.statementType != null) + message.statementType = String(object.statementType); + if (object.ddlOperationPerformed != null) + message.ddlOperationPerformed = String(object.ddlOperationPerformed); + if (object.ddlTargetTable != null) { + if (!$util.isObject(object.ddlTargetTable)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlTargetTable: object expected"); + message.ddlTargetTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.ddlTargetTable, long + 1); + } + if (object.ddlDestinationTable != null) { + if (!$util.isObject(object.ddlDestinationTable)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlDestinationTable: object expected"); + message.ddlDestinationTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.ddlDestinationTable, long + 1); + } + if (object.ddlTargetRowAccessPolicy != null) { + if (!$util.isObject(object.ddlTargetRowAccessPolicy)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlTargetRowAccessPolicy: object expected"); + message.ddlTargetRowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.fromObject(object.ddlTargetRowAccessPolicy, long + 1); + } + if (object.ddlAffectedRowAccessPolicyCount != null) { + if (!$util.isObject(object.ddlAffectedRowAccessPolicyCount)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlAffectedRowAccessPolicyCount: object expected"); + message.ddlAffectedRowAccessPolicyCount = $root.google.protobuf.Int64Value.fromObject(object.ddlAffectedRowAccessPolicyCount, long + 1); + } + if (object.ddlTargetRoutine != null) { + if (!$util.isObject(object.ddlTargetRoutine)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlTargetRoutine: object expected"); + message.ddlTargetRoutine = $root.google.cloud.bigquery.v2.RoutineReference.fromObject(object.ddlTargetRoutine, long + 1); + } + if (object.ddlTargetDataset != null) { + if (!$util.isObject(object.ddlTargetDataset)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.ddlTargetDataset: object expected"); + message.ddlTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.ddlTargetDataset, long + 1); + } + if (object.mlStatistics != null) { + if (!$util.isObject(object.mlStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.mlStatistics: object expected"); + message.mlStatistics = $root.google.cloud.bigquery.v2.MlStatistics.fromObject(object.mlStatistics, long + 1); + } + if (object.exportDataStatistics != null) { + if (!$util.isObject(object.exportDataStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.exportDataStatistics: object expected"); + message.exportDataStatistics = $root.google.cloud.bigquery.v2.ExportDataStatistics.fromObject(object.exportDataStatistics, long + 1); + } + if (object.externalServiceCosts) { + if (!Array.isArray(object.externalServiceCosts)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.externalServiceCosts: array expected"); + message.externalServiceCosts = []; + for (var i = 0; i < object.externalServiceCosts.length; ++i) { + if (!$util.isObject(object.externalServiceCosts[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.externalServiceCosts: object expected"); + message.externalServiceCosts[i] = $root.google.cloud.bigquery.v2.ExternalServiceCost.fromObject(object.externalServiceCosts[i], long + 1); + } + } + if (object.biEngineStatistics != null) { + if (!$util.isObject(object.biEngineStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.biEngineStatistics: object expected"); + message.biEngineStatistics = $root.google.cloud.bigquery.v2.BiEngineStatistics.fromObject(object.biEngineStatistics, long + 1); + } + if (object.loadQueryStatistics != null) { + if (!$util.isObject(object.loadQueryStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.loadQueryStatistics: object expected"); + message.loadQueryStatistics = $root.google.cloud.bigquery.v2.LoadQueryStatistics.fromObject(object.loadQueryStatistics, long + 1); + } + if (object.dclTargetTable != null) { + if (!$util.isObject(object.dclTargetTable)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.dclTargetTable: object expected"); + message.dclTargetTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.dclTargetTable, long + 1); + } + if (object.dclTargetView != null) { + if (!$util.isObject(object.dclTargetView)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.dclTargetView: object expected"); + message.dclTargetView = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.dclTargetView, long + 1); + } + if (object.dclTargetDataset != null) { + if (!$util.isObject(object.dclTargetDataset)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.dclTargetDataset: object expected"); + message.dclTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.fromObject(object.dclTargetDataset, long + 1); + } + if (object.searchStatistics != null) { + if (!$util.isObject(object.searchStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.searchStatistics: object expected"); + message.searchStatistics = $root.google.cloud.bigquery.v2.SearchStatistics.fromObject(object.searchStatistics, long + 1); + } + if (object.vectorSearchStatistics != null) { + if (!$util.isObject(object.vectorSearchStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.vectorSearchStatistics: object expected"); + message.vectorSearchStatistics = $root.google.cloud.bigquery.v2.VectorSearchStatistics.fromObject(object.vectorSearchStatistics, long + 1); + } + if (object.performanceInsights != null) { + if (!$util.isObject(object.performanceInsights)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.performanceInsights: object expected"); + message.performanceInsights = $root.google.cloud.bigquery.v2.PerformanceInsights.fromObject(object.performanceInsights, long + 1); + } + if (object.queryInfo != null) { + if (!$util.isObject(object.queryInfo)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.queryInfo: object expected"); + message.queryInfo = $root.google.cloud.bigquery.v2.QueryInfo.fromObject(object.queryInfo, long + 1); + } + if (object.sparkStatistics != null) { + if (!$util.isObject(object.sparkStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.sparkStatistics: object expected"); + message.sparkStatistics = $root.google.cloud.bigquery.v2.SparkStatistics.fromObject(object.sparkStatistics, long + 1); + } + if (object.transferredBytes != null) { + if (!$util.isObject(object.transferredBytes)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.transferredBytes: object expected"); + message.transferredBytes = $root.google.protobuf.Int64Value.fromObject(object.transferredBytes, long + 1); + } + if (object.materializedViewStatistics != null) { + if (!$util.isObject(object.materializedViewStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.materializedViewStatistics: object expected"); + message.materializedViewStatistics = $root.google.cloud.bigquery.v2.MaterializedViewStatistics.fromObject(object.materializedViewStatistics, long + 1); + } + if (object.metadataCacheStatistics != null) { + if (!$util.isObject(object.metadataCacheStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.metadataCacheStatistics: object expected"); + message.metadataCacheStatistics = $root.google.cloud.bigquery.v2.MetadataCacheStatistics.fromObject(object.metadataCacheStatistics, long + 1); + } + if (object.incrementalResultStats != null) { + if (!$util.isObject(object.incrementalResultStats)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.incrementalResultStats: object expected"); + message.incrementalResultStats = $root.google.cloud.bigquery.v2.IncrementalResultStats.fromObject(object.incrementalResultStats, long + 1); + } + if (object.genAiStats != null) { + if (!$util.isObject(object.genAiStats)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics2.genAiStats: object expected"); + message.genAiStats = $root.google.cloud.bigquery.v2.GenAiStats.fromObject(object.genAiStats, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JobStatistics2 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {google.cloud.bigquery.v2.JobStatistics2} message JobStatistics2 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatistics2.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.queryPlan = []; + object.timeline = []; + object.referencedTables = []; + object.undeclaredQueryParameters = []; + object.referencedRoutines = []; + object.externalServiceCosts = []; + object.referencedPropertyGraphs = []; + } + if (options.defaults) { + object.estimatedBytesProcessed = null; + object.totalPartitionsProcessed = null; + object.totalBytesProcessed = null; + object.totalBytesBilled = null; + object.billingTier = null; + object.totalSlotMs = null; + object.cacheHit = null; + object.schema = null; + object.numDmlAffectedRows = null; + object.statementType = ""; + object.ddlOperationPerformed = ""; + object.ddlTargetTable = null; + object.totalBytesProcessedAccuracy = ""; + object.ddlTargetRoutine = null; + object.mlStatistics = null; + object.exportDataStatistics = null; + object.ddlTargetRowAccessPolicy = null; + object.ddlAffectedRowAccessPolicyCount = null; + object.biEngineStatistics = null; + object.ddlTargetDataset = null; + object.ddlDestinationTable = null; + object.dmlStats = null; + object.loadQueryStatistics = null; + object.dclTargetTable = null; + object.dclTargetView = null; + object.dclTargetDataset = null; + object.searchStatistics = null; + object.performanceInsights = null; + object.queryInfo = null; + object.sparkStatistics = null; + object.transferredBytes = null; + object.materializedViewStatistics = null; + object.metadataCacheStatistics = null; + object.vectorSearchStatistics = null; + object.incrementalResultStats = null; + object.genAiStats = null; + } + if (message.queryPlan && message.queryPlan.length) { + object.queryPlan = []; + for (var j = 0; j < message.queryPlan.length; ++j) + object.queryPlan[j] = $root.google.cloud.bigquery.v2.ExplainQueryStage.toObject(message.queryPlan[j], options, q + 1); + } + if (message.estimatedBytesProcessed != null && Object.hasOwnProperty.call(message, "estimatedBytesProcessed")) + object.estimatedBytesProcessed = $root.google.protobuf.Int64Value.toObject(message.estimatedBytesProcessed, options, q + 1); + if (message.timeline && message.timeline.length) { + object.timeline = []; + for (var j = 0; j < message.timeline.length; ++j) + object.timeline[j] = $root.google.cloud.bigquery.v2.QueryTimelineSample.toObject(message.timeline[j], options, q + 1); + } + if (message.totalPartitionsProcessed != null && Object.hasOwnProperty.call(message, "totalPartitionsProcessed")) + object.totalPartitionsProcessed = $root.google.protobuf.Int64Value.toObject(message.totalPartitionsProcessed, options, q + 1); + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + object.totalBytesProcessed = $root.google.protobuf.Int64Value.toObject(message.totalBytesProcessed, options, q + 1); + if (message.totalBytesBilled != null && Object.hasOwnProperty.call(message, "totalBytesBilled")) + object.totalBytesBilled = $root.google.protobuf.Int64Value.toObject(message.totalBytesBilled, options, q + 1); + if (message.billingTier != null && Object.hasOwnProperty.call(message, "billingTier")) + object.billingTier = $root.google.protobuf.Int32Value.toObject(message.billingTier, options, q + 1); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + object.totalSlotMs = $root.google.protobuf.Int64Value.toObject(message.totalSlotMs, options, q + 1); + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + object.cacheHit = $root.google.protobuf.BoolValue.toObject(message.cacheHit, options, q + 1); + if (message.referencedTables && message.referencedTables.length) { + object.referencedTables = []; + for (var j = 0; j < message.referencedTables.length; ++j) + object.referencedTables[j] = $root.google.cloud.bigquery.v2.TableReference.toObject(message.referencedTables[j], options, q + 1); + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.numDmlAffectedRows != null && Object.hasOwnProperty.call(message, "numDmlAffectedRows")) + object.numDmlAffectedRows = $root.google.protobuf.Int64Value.toObject(message.numDmlAffectedRows, options, q + 1); + if (message.undeclaredQueryParameters && message.undeclaredQueryParameters.length) { + object.undeclaredQueryParameters = []; + for (var j = 0; j < message.undeclaredQueryParameters.length; ++j) + object.undeclaredQueryParameters[j] = $root.google.cloud.bigquery.v2.QueryParameter.toObject(message.undeclaredQueryParameters[j], options, q + 1); + } + if (message.statementType != null && Object.hasOwnProperty.call(message, "statementType")) + object.statementType = message.statementType; + if (message.ddlOperationPerformed != null && Object.hasOwnProperty.call(message, "ddlOperationPerformed")) + object.ddlOperationPerformed = message.ddlOperationPerformed; + if (message.ddlTargetTable != null && Object.hasOwnProperty.call(message, "ddlTargetTable")) + object.ddlTargetTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.ddlTargetTable, options, q + 1); + if (message.totalBytesProcessedAccuracy != null && Object.hasOwnProperty.call(message, "totalBytesProcessedAccuracy")) + object.totalBytesProcessedAccuracy = message.totalBytesProcessedAccuracy; + if (message.ddlTargetRoutine != null && Object.hasOwnProperty.call(message, "ddlTargetRoutine")) + object.ddlTargetRoutine = $root.google.cloud.bigquery.v2.RoutineReference.toObject(message.ddlTargetRoutine, options, q + 1); + if (message.mlStatistics != null && Object.hasOwnProperty.call(message, "mlStatistics")) + object.mlStatistics = $root.google.cloud.bigquery.v2.MlStatistics.toObject(message.mlStatistics, options, q + 1); + if (message.referencedRoutines && message.referencedRoutines.length) { + object.referencedRoutines = []; + for (var j = 0; j < message.referencedRoutines.length; ++j) + object.referencedRoutines[j] = $root.google.cloud.bigquery.v2.RoutineReference.toObject(message.referencedRoutines[j], options, q + 1); + } + if (message.exportDataStatistics != null && Object.hasOwnProperty.call(message, "exportDataStatistics")) + object.exportDataStatistics = $root.google.cloud.bigquery.v2.ExportDataStatistics.toObject(message.exportDataStatistics, options, q + 1); + if (message.ddlTargetRowAccessPolicy != null && Object.hasOwnProperty.call(message, "ddlTargetRowAccessPolicy")) + object.ddlTargetRowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.toObject(message.ddlTargetRowAccessPolicy, options, q + 1); + if (message.ddlAffectedRowAccessPolicyCount != null && Object.hasOwnProperty.call(message, "ddlAffectedRowAccessPolicyCount")) + object.ddlAffectedRowAccessPolicyCount = $root.google.protobuf.Int64Value.toObject(message.ddlAffectedRowAccessPolicyCount, options, q + 1); + if (message.externalServiceCosts && message.externalServiceCosts.length) { + object.externalServiceCosts = []; + for (var j = 0; j < message.externalServiceCosts.length; ++j) + object.externalServiceCosts[j] = $root.google.cloud.bigquery.v2.ExternalServiceCost.toObject(message.externalServiceCosts[j], options, q + 1); + } + if (message.biEngineStatistics != null && Object.hasOwnProperty.call(message, "biEngineStatistics")) + object.biEngineStatistics = $root.google.cloud.bigquery.v2.BiEngineStatistics.toObject(message.biEngineStatistics, options, q + 1); + if (message.ddlTargetDataset != null && Object.hasOwnProperty.call(message, "ddlTargetDataset")) + object.ddlTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.ddlTargetDataset, options, q + 1); + if (message.ddlDestinationTable != null && Object.hasOwnProperty.call(message, "ddlDestinationTable")) + object.ddlDestinationTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.ddlDestinationTable, options, q + 1); + if (message.dmlStats != null && Object.hasOwnProperty.call(message, "dmlStats")) + object.dmlStats = $root.google.cloud.bigquery.v2.DmlStats.toObject(message.dmlStats, options, q + 1); + if (message.loadQueryStatistics != null && Object.hasOwnProperty.call(message, "loadQueryStatistics")) + object.loadQueryStatistics = $root.google.cloud.bigquery.v2.LoadQueryStatistics.toObject(message.loadQueryStatistics, options, q + 1); + if (message.dclTargetTable != null && Object.hasOwnProperty.call(message, "dclTargetTable")) + object.dclTargetTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.dclTargetTable, options, q + 1); + if (message.dclTargetView != null && Object.hasOwnProperty.call(message, "dclTargetView")) + object.dclTargetView = $root.google.cloud.bigquery.v2.TableReference.toObject(message.dclTargetView, options, q + 1); + if (message.dclTargetDataset != null && Object.hasOwnProperty.call(message, "dclTargetDataset")) + object.dclTargetDataset = $root.google.cloud.bigquery.v2.DatasetReference.toObject(message.dclTargetDataset, options, q + 1); + if (message.searchStatistics != null && Object.hasOwnProperty.call(message, "searchStatistics")) + object.searchStatistics = $root.google.cloud.bigquery.v2.SearchStatistics.toObject(message.searchStatistics, options, q + 1); + if (message.performanceInsights != null && Object.hasOwnProperty.call(message, "performanceInsights")) + object.performanceInsights = $root.google.cloud.bigquery.v2.PerformanceInsights.toObject(message.performanceInsights, options, q + 1); + if (message.queryInfo != null && Object.hasOwnProperty.call(message, "queryInfo")) + object.queryInfo = $root.google.cloud.bigquery.v2.QueryInfo.toObject(message.queryInfo, options, q + 1); + if (message.sparkStatistics != null && Object.hasOwnProperty.call(message, "sparkStatistics")) + object.sparkStatistics = $root.google.cloud.bigquery.v2.SparkStatistics.toObject(message.sparkStatistics, options, q + 1); + if (message.transferredBytes != null && Object.hasOwnProperty.call(message, "transferredBytes")) + object.transferredBytes = $root.google.protobuf.Int64Value.toObject(message.transferredBytes, options, q + 1); + if (message.materializedViewStatistics != null && Object.hasOwnProperty.call(message, "materializedViewStatistics")) + object.materializedViewStatistics = $root.google.cloud.bigquery.v2.MaterializedViewStatistics.toObject(message.materializedViewStatistics, options, q + 1); + if (message.metadataCacheStatistics != null && Object.hasOwnProperty.call(message, "metadataCacheStatistics")) + object.metadataCacheStatistics = $root.google.cloud.bigquery.v2.MetadataCacheStatistics.toObject(message.metadataCacheStatistics, options, q + 1); + if (message.vectorSearchStatistics != null && Object.hasOwnProperty.call(message, "vectorSearchStatistics")) + object.vectorSearchStatistics = $root.google.cloud.bigquery.v2.VectorSearchStatistics.toObject(message.vectorSearchStatistics, options, q + 1); + if (message.referencedPropertyGraphs && message.referencedPropertyGraphs.length) { + object.referencedPropertyGraphs = []; + for (var j = 0; j < message.referencedPropertyGraphs.length; ++j) + object.referencedPropertyGraphs[j] = $root.google.cloud.bigquery.v2.PropertyGraphReference.toObject(message.referencedPropertyGraphs[j], options, q + 1); + } + if (message.totalServicesSkuSlotMs != null && Object.hasOwnProperty.call(message, "totalServicesSkuSlotMs")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.totalServicesSkuSlotMs = typeof message.totalServicesSkuSlotMs === "number" ? BigInt(message.totalServicesSkuSlotMs) : $util.Long.fromBits(message.totalServicesSkuSlotMs.low >>> 0, message.totalServicesSkuSlotMs.high >>> 0, false).toBigInt(); + else if (typeof message.totalServicesSkuSlotMs === "number") + object.totalServicesSkuSlotMs = options.longs === String ? String(message.totalServicesSkuSlotMs) : message.totalServicesSkuSlotMs; + else + object.totalServicesSkuSlotMs = options.longs === String ? $util.Long.prototype.toString.call(message.totalServicesSkuSlotMs) : options.longs === Number ? new $util.LongBits(message.totalServicesSkuSlotMs.low >>> 0, message.totalServicesSkuSlotMs.high >>> 0).toNumber() : message.totalServicesSkuSlotMs; + if (options.oneofs) + object._totalServicesSkuSlotMs = "totalServicesSkuSlotMs"; + } + if (message.incrementalResultStats != null && Object.hasOwnProperty.call(message, "incrementalResultStats")) + object.incrementalResultStats = $root.google.cloud.bigquery.v2.IncrementalResultStats.toObject(message.incrementalResultStats, options, q + 1); + if (message.genAiStats != null && Object.hasOwnProperty.call(message, "genAiStats")) + object.genAiStats = $root.google.cloud.bigquery.v2.GenAiStats.toObject(message.genAiStats, options, q + 1); + return object; + }; + + /** + * Converts this JobStatistics2 to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @instance + * @returns {Object.} JSON object + */ + JobStatistics2.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatistics2 + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatistics2 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatistics2.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatistics2"; + }; + + return JobStatistics2; + })(); + + v2.JobStatistics3 = (function() { + + /** + * Properties of a JobStatistics3. + * @memberof google.cloud.bigquery.v2 + * @interface IJobStatistics3 + * @property {google.protobuf.IInt64Value|null} [inputFiles] JobStatistics3 inputFiles + * @property {google.protobuf.IInt64Value|null} [inputFileBytes] JobStatistics3 inputFileBytes + * @property {google.protobuf.IInt64Value|null} [outputRows] JobStatistics3 outputRows + * @property {google.protobuf.IInt64Value|null} [outputBytes] JobStatistics3 outputBytes + * @property {google.protobuf.IInt64Value|null} [badRecords] JobStatistics3 badRecords + * @property {Array.|null} [timeline] JobStatistics3 timeline + */ + + /** + * Constructs a new JobStatistics3. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobStatistics3. + * @implements IJobStatistics3 + * @constructor + * @param {google.cloud.bigquery.v2.IJobStatistics3=} [properties] Properties to set + */ + function JobStatistics3(properties) { + this.timeline = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatistics3 inputFiles. + * @member {google.protobuf.IInt64Value|null|undefined} inputFiles + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.inputFiles = null; + + /** + * JobStatistics3 inputFileBytes. + * @member {google.protobuf.IInt64Value|null|undefined} inputFileBytes + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.inputFileBytes = null; + + /** + * JobStatistics3 outputRows. + * @member {google.protobuf.IInt64Value|null|undefined} outputRows + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.outputRows = null; + + /** + * JobStatistics3 outputBytes. + * @member {google.protobuf.IInt64Value|null|undefined} outputBytes + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.outputBytes = null; + + /** + * JobStatistics3 badRecords. + * @member {google.protobuf.IInt64Value|null|undefined} badRecords + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.badRecords = null; + + /** + * JobStatistics3 timeline. + * @member {Array.} timeline + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + */ + JobStatistics3.prototype.timeline = $util.emptyArray; + + /** + * Creates a new JobStatistics3 instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics3=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatistics3} JobStatistics3 instance + */ + JobStatistics3.create = function create(properties) { + return new JobStatistics3(properties); + }; + + /** + * Encodes the specified JobStatistics3 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics3.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics3} message JobStatistics3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics3.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) + $root.google.protobuf.Int64Value.encode(message.inputFiles, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) + $root.google.protobuf.Int64Value.encode(message.inputFileBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + $root.google.protobuf.Int64Value.encode(message.outputRows, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) + $root.google.protobuf.Int64Value.encode(message.outputBytes, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) + $root.google.protobuf.Int64Value.encode(message.badRecords, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.timeline != null && message.timeline.length) + for (var i = 0; i < message.timeline.length; ++i) + $root.google.cloud.bigquery.v2.QueryTimelineSample.encode(message.timeline[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatistics3 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics3.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics3} message JobStatistics3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics3.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobStatistics3 message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatistics3} JobStatistics3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics3.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatistics3(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputFiles = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.inputFileBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.outputRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.outputBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.badRecords = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + if (!(message.timeline && message.timeline.length)) + message.timeline = []; + message.timeline.push($root.google.cloud.bigquery.v2.QueryTimelineSample.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatistics3 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatistics3} JobStatistics3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics3.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatistics3 message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatistics3.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) { + var error = $root.google.protobuf.Int64Value.verify(message.inputFiles, long + 1); + if (error) + return "inputFiles." + error; + } + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.inputFileBytes, long + 1); + if (error) + return "inputFileBytes." + error; + } + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.outputRows, long + 1); + if (error) + return "outputRows." + error; + } + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.outputBytes, long + 1); + if (error) + return "outputBytes." + error; + } + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) { + var error = $root.google.protobuf.Int64Value.verify(message.badRecords, long + 1); + if (error) + return "badRecords." + error; + } + if (message.timeline != null && Object.hasOwnProperty.call(message, "timeline")) { + if (!Array.isArray(message.timeline)) + return "timeline: array expected"; + for (var i = 0; i < message.timeline.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryTimelineSample.verify(message.timeline[i], long + 1); + if (error) + return "timeline." + error; + } + } + return null; + }; + + /** + * Creates a JobStatistics3 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatistics3} JobStatistics3 + */ + JobStatistics3.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatistics3) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatistics3(); + if (object.inputFiles != null) { + if (!$util.isObject(object.inputFiles)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.inputFiles: object expected"); + message.inputFiles = $root.google.protobuf.Int64Value.fromObject(object.inputFiles, long + 1); + } + if (object.inputFileBytes != null) { + if (!$util.isObject(object.inputFileBytes)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.inputFileBytes: object expected"); + message.inputFileBytes = $root.google.protobuf.Int64Value.fromObject(object.inputFileBytes, long + 1); + } + if (object.outputRows != null) { + if (!$util.isObject(object.outputRows)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.outputRows: object expected"); + message.outputRows = $root.google.protobuf.Int64Value.fromObject(object.outputRows, long + 1); + } + if (object.outputBytes != null) { + if (!$util.isObject(object.outputBytes)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.outputBytes: object expected"); + message.outputBytes = $root.google.protobuf.Int64Value.fromObject(object.outputBytes, long + 1); + } + if (object.badRecords != null) { + if (!$util.isObject(object.badRecords)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.badRecords: object expected"); + message.badRecords = $root.google.protobuf.Int64Value.fromObject(object.badRecords, long + 1); + } + if (object.timeline) { + if (!Array.isArray(object.timeline)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.timeline: array expected"); + message.timeline = []; + for (var i = 0; i < object.timeline.length; ++i) { + if (!$util.isObject(object.timeline[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics3.timeline: object expected"); + message.timeline[i] = $root.google.cloud.bigquery.v2.QueryTimelineSample.fromObject(object.timeline[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a JobStatistics3 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {google.cloud.bigquery.v2.JobStatistics3} message JobStatistics3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatistics3.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.timeline = []; + if (options.defaults) { + object.inputFiles = null; + object.inputFileBytes = null; + object.outputRows = null; + object.outputBytes = null; + object.badRecords = null; + } + if (message.inputFiles != null && Object.hasOwnProperty.call(message, "inputFiles")) + object.inputFiles = $root.google.protobuf.Int64Value.toObject(message.inputFiles, options, q + 1); + if (message.inputFileBytes != null && Object.hasOwnProperty.call(message, "inputFileBytes")) + object.inputFileBytes = $root.google.protobuf.Int64Value.toObject(message.inputFileBytes, options, q + 1); + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + object.outputRows = $root.google.protobuf.Int64Value.toObject(message.outputRows, options, q + 1); + if (message.outputBytes != null && Object.hasOwnProperty.call(message, "outputBytes")) + object.outputBytes = $root.google.protobuf.Int64Value.toObject(message.outputBytes, options, q + 1); + if (message.badRecords != null && Object.hasOwnProperty.call(message, "badRecords")) + object.badRecords = $root.google.protobuf.Int64Value.toObject(message.badRecords, options, q + 1); + if (message.timeline && message.timeline.length) { + object.timeline = []; + for (var j = 0; j < message.timeline.length; ++j) + object.timeline[j] = $root.google.cloud.bigquery.v2.QueryTimelineSample.toObject(message.timeline[j], options, q + 1); + } + return object; + }; + + /** + * Converts this JobStatistics3 to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @instance + * @returns {Object.} JSON object + */ + JobStatistics3.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatistics3 + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatistics3 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatistics3.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatistics3"; + }; + + return JobStatistics3; + })(); + + v2.JobStatistics4 = (function() { + + /** + * Properties of a JobStatistics4. + * @memberof google.cloud.bigquery.v2 + * @interface IJobStatistics4 + * @property {Array.|null} [destinationUriFileCounts] JobStatistics4 destinationUriFileCounts + * @property {google.protobuf.IInt64Value|null} [inputBytes] JobStatistics4 inputBytes + * @property {Array.|null} [timeline] JobStatistics4 timeline + */ + + /** + * Constructs a new JobStatistics4. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobStatistics4. + * @implements IJobStatistics4 + * @constructor + * @param {google.cloud.bigquery.v2.IJobStatistics4=} [properties] Properties to set + */ + function JobStatistics4(properties) { + this.destinationUriFileCounts = []; + this.timeline = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatistics4 destinationUriFileCounts. + * @member {Array.} destinationUriFileCounts + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @instance + */ + JobStatistics4.prototype.destinationUriFileCounts = $util.emptyArray; + + /** + * JobStatistics4 inputBytes. + * @member {google.protobuf.IInt64Value|null|undefined} inputBytes + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @instance + */ + JobStatistics4.prototype.inputBytes = null; + + /** + * JobStatistics4 timeline. + * @member {Array.} timeline + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @instance + */ + JobStatistics4.prototype.timeline = $util.emptyArray; + + /** + * Creates a new JobStatistics4 instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics4=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatistics4} JobStatistics4 instance + */ + JobStatistics4.create = function create(properties) { + return new JobStatistics4(properties); + }; + + /** + * Encodes the specified JobStatistics4 message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics4.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics4} message JobStatistics4 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics4.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.destinationUriFileCounts != null && message.destinationUriFileCounts.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.destinationUriFileCounts.length; ++i) + writer.int64(message.destinationUriFileCounts[i]); + writer.ldelim(); + } + if (message.inputBytes != null && Object.hasOwnProperty.call(message, "inputBytes")) + $root.google.protobuf.Int64Value.encode(message.inputBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.timeline != null && message.timeline.length) + for (var i = 0; i < message.timeline.length; ++i) + $root.google.cloud.bigquery.v2.QueryTimelineSample.encode(message.timeline[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatistics4 message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics4.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics4} message JobStatistics4 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics4.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobStatistics4 message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatistics4} JobStatistics4 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics4.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatistics4(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.destinationUriFileCounts && message.destinationUriFileCounts.length)) + message.destinationUriFileCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinationUriFileCounts.push(reader.int64()); + } else + message.destinationUriFileCounts.push(reader.int64()); + break; + } + case 2: { + message.inputBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.timeline && message.timeline.length)) + message.timeline = []; + message.timeline.push($root.google.cloud.bigquery.v2.QueryTimelineSample.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatistics4 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatistics4} JobStatistics4 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics4.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatistics4 message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatistics4.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.destinationUriFileCounts != null && Object.hasOwnProperty.call(message, "destinationUriFileCounts")) { + if (!Array.isArray(message.destinationUriFileCounts)) + return "destinationUriFileCounts: array expected"; + for (var i = 0; i < message.destinationUriFileCounts.length; ++i) + if (!$util.isInteger(message.destinationUriFileCounts[i]) && !(message.destinationUriFileCounts[i] && $util.isInteger(message.destinationUriFileCounts[i].low) && $util.isInteger(message.destinationUriFileCounts[i].high))) + return "destinationUriFileCounts: integer|Long[] expected"; + } + if (message.inputBytes != null && Object.hasOwnProperty.call(message, "inputBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.inputBytes, long + 1); + if (error) + return "inputBytes." + error; + } + if (message.timeline != null && Object.hasOwnProperty.call(message, "timeline")) { + if (!Array.isArray(message.timeline)) + return "timeline: array expected"; + for (var i = 0; i < message.timeline.length; ++i) { + var error = $root.google.cloud.bigquery.v2.QueryTimelineSample.verify(message.timeline[i], long + 1); + if (error) + return "timeline." + error; + } + } + return null; + }; + + /** + * Creates a JobStatistics4 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatistics4} JobStatistics4 + */ + JobStatistics4.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatistics4) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics4: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatistics4(); + if (object.destinationUriFileCounts) { + if (!Array.isArray(object.destinationUriFileCounts)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics4.destinationUriFileCounts: array expected"); + message.destinationUriFileCounts = []; + for (var i = 0; i < object.destinationUriFileCounts.length; ++i) + if ($util.Long) + message.destinationUriFileCounts[i] = $util.Long.fromValue(object.destinationUriFileCounts[i], false); + else if (typeof object.destinationUriFileCounts[i] === "string") + message.destinationUriFileCounts[i] = parseInt(object.destinationUriFileCounts[i], 10); + else if (typeof object.destinationUriFileCounts[i] === "number") + message.destinationUriFileCounts[i] = object.destinationUriFileCounts[i]; + else if (typeof object.destinationUriFileCounts[i] === "object") + message.destinationUriFileCounts[i] = new $util.LongBits(object.destinationUriFileCounts[i].low >>> 0, object.destinationUriFileCounts[i].high >>> 0).toNumber(); + } + if (object.inputBytes != null) { + if (!$util.isObject(object.inputBytes)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics4.inputBytes: object expected"); + message.inputBytes = $root.google.protobuf.Int64Value.fromObject(object.inputBytes, long + 1); + } + if (object.timeline) { + if (!Array.isArray(object.timeline)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics4.timeline: array expected"); + message.timeline = []; + for (var i = 0; i < object.timeline.length; ++i) { + if (!$util.isObject(object.timeline[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics4.timeline: object expected"); + message.timeline[i] = $root.google.cloud.bigquery.v2.QueryTimelineSample.fromObject(object.timeline[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a JobStatistics4 message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {google.cloud.bigquery.v2.JobStatistics4} message JobStatistics4 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatistics4.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.destinationUriFileCounts = []; + object.timeline = []; + } + if (options.defaults) + object.inputBytes = null; + if (message.destinationUriFileCounts && message.destinationUriFileCounts.length) { + object.destinationUriFileCounts = []; + for (var j = 0; j < message.destinationUriFileCounts.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.destinationUriFileCounts[j] = typeof message.destinationUriFileCounts[j] === "number" ? BigInt(message.destinationUriFileCounts[j]) : $util.Long.fromBits(message.destinationUriFileCounts[j].low >>> 0, message.destinationUriFileCounts[j].high >>> 0, false).toBigInt(); + else if (typeof message.destinationUriFileCounts[j] === "number") + object.destinationUriFileCounts[j] = options.longs === String ? String(message.destinationUriFileCounts[j]) : message.destinationUriFileCounts[j]; + else + object.destinationUriFileCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.destinationUriFileCounts[j]) : options.longs === Number ? new $util.LongBits(message.destinationUriFileCounts[j].low >>> 0, message.destinationUriFileCounts[j].high >>> 0).toNumber() : message.destinationUriFileCounts[j]; + } + if (message.inputBytes != null && Object.hasOwnProperty.call(message, "inputBytes")) + object.inputBytes = $root.google.protobuf.Int64Value.toObject(message.inputBytes, options, q + 1); + if (message.timeline && message.timeline.length) { + object.timeline = []; + for (var j = 0; j < message.timeline.length; ++j) + object.timeline[j] = $root.google.cloud.bigquery.v2.QueryTimelineSample.toObject(message.timeline[j], options, q + 1); + } + return object; + }; + + /** + * Converts this JobStatistics4 to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @instance + * @returns {Object.} JSON object + */ + JobStatistics4.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatistics4 + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatistics4 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatistics4.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatistics4"; + }; + + return JobStatistics4; + })(); + + v2.CopyJobStatistics = (function() { + + /** + * Properties of a CopyJobStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface ICopyJobStatistics + * @property {google.protobuf.IInt64Value|null} [copiedRows] CopyJobStatistics copiedRows + * @property {google.protobuf.IInt64Value|null} [copiedLogicalBytes] CopyJobStatistics copiedLogicalBytes + */ + + /** + * Constructs a new CopyJobStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a CopyJobStatistics. + * @implements ICopyJobStatistics + * @constructor + * @param {google.cloud.bigquery.v2.ICopyJobStatistics=} [properties] Properties to set + */ + function CopyJobStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyJobStatistics copiedRows. + * @member {google.protobuf.IInt64Value|null|undefined} copiedRows + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @instance + */ + CopyJobStatistics.prototype.copiedRows = null; + + /** + * CopyJobStatistics copiedLogicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} copiedLogicalBytes + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @instance + */ + CopyJobStatistics.prototype.copiedLogicalBytes = null; + + /** + * Creates a new CopyJobStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {google.cloud.bigquery.v2.ICopyJobStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.CopyJobStatistics} CopyJobStatistics instance + */ + CopyJobStatistics.create = function create(properties) { + return new CopyJobStatistics(properties); + }; + + /** + * Encodes the specified CopyJobStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.CopyJobStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {google.cloud.bigquery.v2.ICopyJobStatistics} message CopyJobStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyJobStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.copiedRows != null && Object.hasOwnProperty.call(message, "copiedRows")) + $root.google.protobuf.Int64Value.encode(message.copiedRows, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.copiedLogicalBytes != null && Object.hasOwnProperty.call(message, "copiedLogicalBytes")) + $root.google.protobuf.Int64Value.encode(message.copiedLogicalBytes, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyJobStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CopyJobStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {google.cloud.bigquery.v2.ICopyJobStatistics} message CopyJobStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyJobStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CopyJobStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.CopyJobStatistics} CopyJobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyJobStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.CopyJobStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.copiedRows = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.copiedLogicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CopyJobStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.CopyJobStatistics} CopyJobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyJobStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyJobStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyJobStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.copiedRows != null && Object.hasOwnProperty.call(message, "copiedRows")) { + var error = $root.google.protobuf.Int64Value.verify(message.copiedRows, long + 1); + if (error) + return "copiedRows." + error; + } + if (message.copiedLogicalBytes != null && Object.hasOwnProperty.call(message, "copiedLogicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.copiedLogicalBytes, long + 1); + if (error) + return "copiedLogicalBytes." + error; + } + return null; + }; + + /** + * Creates a CopyJobStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.CopyJobStatistics} CopyJobStatistics + */ + CopyJobStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.CopyJobStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.CopyJobStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.CopyJobStatistics(); + if (object.copiedRows != null) { + if (!$util.isObject(object.copiedRows)) + throw TypeError(".google.cloud.bigquery.v2.CopyJobStatistics.copiedRows: object expected"); + message.copiedRows = $root.google.protobuf.Int64Value.fromObject(object.copiedRows, long + 1); + } + if (object.copiedLogicalBytes != null) { + if (!$util.isObject(object.copiedLogicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.CopyJobStatistics.copiedLogicalBytes: object expected"); + message.copiedLogicalBytes = $root.google.protobuf.Int64Value.fromObject(object.copiedLogicalBytes, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CopyJobStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {google.cloud.bigquery.v2.CopyJobStatistics} message CopyJobStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyJobStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.copiedRows = null; + object.copiedLogicalBytes = null; + } + if (message.copiedRows != null && Object.hasOwnProperty.call(message, "copiedRows")) + object.copiedRows = $root.google.protobuf.Int64Value.toObject(message.copiedRows, options, q + 1); + if (message.copiedLogicalBytes != null && Object.hasOwnProperty.call(message, "copiedLogicalBytes")) + object.copiedLogicalBytes = $root.google.protobuf.Int64Value.toObject(message.copiedLogicalBytes, options, q + 1); + return object; + }; + + /** + * Converts this CopyJobStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @instance + * @returns {Object.} JSON object + */ + CopyJobStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyJobStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.CopyJobStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyJobStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.CopyJobStatistics"; + }; + + return CopyJobStatistics; + })(); + + v2.MlStatistics = (function() { + + /** + * Properties of a MlStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IMlStatistics + * @property {number|Long|null} [maxIterations] MlStatistics maxIterations + * @property {Array.|null} [iterationResults] MlStatistics iterationResults + * @property {google.cloud.bigquery.v2.Model.ModelType|null} [modelType] MlStatistics modelType + * @property {google.cloud.bigquery.v2.MlStatistics.TrainingType|null} [trainingType] MlStatistics trainingType + * @property {Array.|null} [hparamTrials] MlStatistics hparamTrials + */ + + /** + * Constructs a new MlStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MlStatistics. + * @implements IMlStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IMlStatistics=} [properties] Properties to set + */ + function MlStatistics(properties) { + this.iterationResults = []; + this.hparamTrials = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MlStatistics maxIterations. + * @member {number|Long} maxIterations + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + */ + MlStatistics.prototype.maxIterations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MlStatistics iterationResults. + * @member {Array.} iterationResults + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + */ + MlStatistics.prototype.iterationResults = $util.emptyArray; + + /** + * MlStatistics modelType. + * @member {google.cloud.bigquery.v2.Model.ModelType} modelType + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + */ + MlStatistics.prototype.modelType = 0; + + /** + * MlStatistics trainingType. + * @member {google.cloud.bigquery.v2.MlStatistics.TrainingType} trainingType + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + */ + MlStatistics.prototype.trainingType = 0; + + /** + * MlStatistics hparamTrials. + * @member {Array.} hparamTrials + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + */ + MlStatistics.prototype.hparamTrials = $util.emptyArray; + + /** + * Creates a new MlStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {google.cloud.bigquery.v2.IMlStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MlStatistics} MlStatistics instance + */ + MlStatistics.create = function create(properties) { + return new MlStatistics(properties); + }; + + /** + * Encodes the specified MlStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MlStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {google.cloud.bigquery.v2.IMlStatistics} message MlStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MlStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxIterations); + if (message.iterationResults != null && message.iterationResults.length) + for (var i = 0; i < message.iterationResults.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.encode(message.iterationResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.modelType); + if (message.trainingType != null && Object.hasOwnProperty.call(message, "trainingType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.trainingType); + if (message.hparamTrials != null && message.hparamTrials.length) + for (var i = 0; i < message.hparamTrials.length; ++i) + $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.encode(message.hparamTrials[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MlStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MlStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {google.cloud.bigquery.v2.IMlStatistics} message MlStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MlStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MlStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MlStatistics} MlStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MlStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MlStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxIterations = reader.int64(); + break; + } + case 2: { + if (!(message.iterationResults && message.iterationResults.length)) + message.iterationResults = []; + message.iterationResults.push($root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.modelType = reader.int32(); + break; + } + case 4: { + message.trainingType = reader.int32(); + break; + } + case 5: { + if (!(message.hparamTrials && message.hparamTrials.length)) + message.hparamTrials = []; + message.hparamTrials.push($root.google.cloud.bigquery.v2.Model.HparamTuningTrial.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MlStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MlStatistics} MlStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MlStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MlStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MlStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + if (!$util.isInteger(message.maxIterations) && !(message.maxIterations && $util.isInteger(message.maxIterations.low) && $util.isInteger(message.maxIterations.high))) + return "maxIterations: integer|Long expected"; + if (message.iterationResults != null && Object.hasOwnProperty.call(message, "iterationResults")) { + if (!Array.isArray(message.iterationResults)) + return "iterationResults: array expected"; + for (var i = 0; i < message.iterationResults.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify(message.iterationResults[i], long + 1); + if (error) + return "iterationResults." + error; + } + } + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 16: + case 17: + case 18: + case 19: + case 23: + case 24: + case 25: + case 26: + case 28: + case 29: + case 37: + break; + } + if (message.trainingType != null && Object.hasOwnProperty.call(message, "trainingType")) + switch (message.trainingType) { + default: + return "trainingType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.hparamTrials != null && Object.hasOwnProperty.call(message, "hparamTrials")) { + if (!Array.isArray(message.hparamTrials)) + return "hparamTrials: array expected"; + for (var i = 0; i < message.hparamTrials.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.verify(message.hparamTrials[i], long + 1); + if (error) + return "hparamTrials." + error; + } + } + return null; + }; + + /** + * Creates a MlStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MlStatistics} MlStatistics + */ + MlStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MlStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MlStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MlStatistics(); + if (object.maxIterations != null) + if ($util.Long) + message.maxIterations = $util.Long.fromValue(object.maxIterations, false); + else if (typeof object.maxIterations === "string") + message.maxIterations = parseInt(object.maxIterations, 10); + else if (typeof object.maxIterations === "number") + message.maxIterations = object.maxIterations; + else if (typeof object.maxIterations === "object") + message.maxIterations = new $util.LongBits(object.maxIterations.low >>> 0, object.maxIterations.high >>> 0).toNumber(); + if (object.iterationResults) { + if (!Array.isArray(object.iterationResults)) + throw TypeError(".google.cloud.bigquery.v2.MlStatistics.iterationResults: array expected"); + message.iterationResults = []; + for (var i = 0; i < object.iterationResults.length; ++i) { + if (!$util.isObject(object.iterationResults[i])) + throw TypeError(".google.cloud.bigquery.v2.MlStatistics.iterationResults: object expected"); + message.iterationResults[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.fromObject(object.iterationResults[i], long + 1); + } + } + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "LINEAR_REGRESSION": + case 1: + message.modelType = 1; + break; + case "LOGISTIC_REGRESSION": + case 2: + message.modelType = 2; + break; + case "KMEANS": + case 3: + message.modelType = 3; + break; + case "MATRIX_FACTORIZATION": + case 4: + message.modelType = 4; + break; + case "DNN_CLASSIFIER": + case 5: + message.modelType = 5; + break; + case "TENSORFLOW": + case 6: + message.modelType = 6; + break; + case "DNN_REGRESSOR": + case 7: + message.modelType = 7; + break; + case "XGBOOST": + case 8: + message.modelType = 8; + break; + case "BOOSTED_TREE_REGRESSOR": + case 9: + message.modelType = 9; + break; + case "BOOSTED_TREE_CLASSIFIER": + case 10: + message.modelType = 10; + break; + case "ARIMA": + case 11: + message.modelType = 11; + break; + case "AUTOML_REGRESSOR": + case 12: + message.modelType = 12; + break; + case "AUTOML_CLASSIFIER": + case 13: + message.modelType = 13; + break; + case "PCA": + case 14: + message.modelType = 14; + break; + case "DNN_LINEAR_COMBINED_CLASSIFIER": + case 16: + message.modelType = 16; + break; + case "DNN_LINEAR_COMBINED_REGRESSOR": + case 17: + message.modelType = 17; + break; + case "AUTOENCODER": + case 18: + message.modelType = 18; + break; + case "ARIMA_PLUS": + case 19: + message.modelType = 19; + break; + case "ARIMA_PLUS_XREG": + case 23: + message.modelType = 23; + break; + case "RANDOM_FOREST_REGRESSOR": + case 24: + message.modelType = 24; + break; + case "RANDOM_FOREST_CLASSIFIER": + case 25: + message.modelType = 25; + break; + case "TENSORFLOW_LITE": + case 26: + message.modelType = 26; + break; + case "ONNX": + case 28: + message.modelType = 28; + break; + case "TRANSFORM_ONLY": + case 29: + message.modelType = 29; + break; + case "CONTRIBUTION_ANALYSIS": + case 37: + message.modelType = 37; + break; + } + switch (object.trainingType) { + default: + if (typeof object.trainingType === "number") { + message.trainingType = object.trainingType; + break; + } + break; + case "TRAINING_TYPE_UNSPECIFIED": + case 0: + message.trainingType = 0; + break; + case "SINGLE_TRAINING": + case 1: + message.trainingType = 1; + break; + case "HPARAM_TUNING": + case 2: + message.trainingType = 2; + break; + } + if (object.hparamTrials) { + if (!Array.isArray(object.hparamTrials)) + throw TypeError(".google.cloud.bigquery.v2.MlStatistics.hparamTrials: array expected"); + message.hparamTrials = []; + for (var i = 0; i < object.hparamTrials.length; ++i) { + if (!$util.isObject(object.hparamTrials[i])) + throw TypeError(".google.cloud.bigquery.v2.MlStatistics.hparamTrials: object expected"); + message.hparamTrials[i] = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.fromObject(object.hparamTrials[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MlStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {google.cloud.bigquery.v2.MlStatistics} message MlStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MlStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.iterationResults = []; + object.hparamTrials = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxIterations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxIterations = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.trainingType = options.enums === String ? "TRAINING_TYPE_UNSPECIFIED" : 0; + } + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxIterations = typeof message.maxIterations === "number" ? BigInt(message.maxIterations) : $util.Long.fromBits(message.maxIterations.low >>> 0, message.maxIterations.high >>> 0, false).toBigInt(); + else if (typeof message.maxIterations === "number") + object.maxIterations = options.longs === String ? String(message.maxIterations) : message.maxIterations; + else + object.maxIterations = options.longs === String ? $util.Long.prototype.toString.call(message.maxIterations) : options.longs === Number ? new $util.LongBits(message.maxIterations.low >>> 0, message.maxIterations.high >>> 0).toNumber() : message.maxIterations; + if (message.iterationResults && message.iterationResults.length) { + object.iterationResults = []; + for (var j = 0; j < message.iterationResults.length; ++j) + object.iterationResults[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.toObject(message.iterationResults[j], options, q + 1); + } + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + object.modelType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.bigquery.v2.Model.ModelType[message.modelType] : message.modelType; + if (message.trainingType != null && Object.hasOwnProperty.call(message, "trainingType")) + object.trainingType = options.enums === String ? $root.google.cloud.bigquery.v2.MlStatistics.TrainingType[message.trainingType] === undefined ? message.trainingType : $root.google.cloud.bigquery.v2.MlStatistics.TrainingType[message.trainingType] : message.trainingType; + if (message.hparamTrials && message.hparamTrials.length) { + object.hparamTrials = []; + for (var j = 0; j < message.hparamTrials.length; ++j) + object.hparamTrials[j] = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.toObject(message.hparamTrials[j], options, q + 1); + } + return object; + }; + + /** + * Converts this MlStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MlStatistics + * @instance + * @returns {Object.} JSON object + */ + MlStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MlStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MlStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MlStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MlStatistics"; + }; + + /** + * TrainingType enum. + * @name google.cloud.bigquery.v2.MlStatistics.TrainingType + * @enum {number} + * @property {number} TRAINING_TYPE_UNSPECIFIED=0 TRAINING_TYPE_UNSPECIFIED value + * @property {number} SINGLE_TRAINING=1 SINGLE_TRAINING value + * @property {number} HPARAM_TUNING=2 HPARAM_TUNING value + */ + MlStatistics.TrainingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAINING_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SINGLE_TRAINING"] = 1; + values[valuesById[2] = "HPARAM_TUNING"] = 2; + return values; + })(); + + return MlStatistics; + })(); + + v2.ScriptStatistics = (function() { + + /** + * Properties of a ScriptStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IScriptStatistics + * @property {google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind|null} [evaluationKind] ScriptStatistics evaluationKind + * @property {Array.|null} [stackFrames] ScriptStatistics stackFrames + */ + + /** + * Constructs a new ScriptStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ScriptStatistics. + * @implements IScriptStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IScriptStatistics=} [properties] Properties to set + */ + function ScriptStatistics(properties) { + this.stackFrames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScriptStatistics evaluationKind. + * @member {google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind} evaluationKind + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @instance + */ + ScriptStatistics.prototype.evaluationKind = 0; + + /** + * ScriptStatistics stackFrames. + * @member {Array.} stackFrames + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @instance + */ + ScriptStatistics.prototype.stackFrames = $util.emptyArray; + + /** + * Creates a new ScriptStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {google.cloud.bigquery.v2.IScriptStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ScriptStatistics} ScriptStatistics instance + */ + ScriptStatistics.create = function create(properties) { + return new ScriptStatistics(properties); + }; + + /** + * Encodes the specified ScriptStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {google.cloud.bigquery.v2.IScriptStatistics} message ScriptStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.evaluationKind != null && Object.hasOwnProperty.call(message, "evaluationKind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluationKind); + if (message.stackFrames != null && message.stackFrames.length) + for (var i = 0; i < message.stackFrames.length; ++i) + $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.encode(message.stackFrames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScriptStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {google.cloud.bigquery.v2.IScriptStatistics} message ScriptStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ScriptStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ScriptStatistics} ScriptStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ScriptStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationKind = reader.int32(); + break; + } + case 2: { + if (!(message.stackFrames && message.stackFrames.length)) + message.stackFrames = []; + message.stackFrames.push($root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ScriptStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ScriptStatistics} ScriptStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScriptStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScriptStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.evaluationKind != null && Object.hasOwnProperty.call(message, "evaluationKind")) + switch (message.evaluationKind) { + default: + return "evaluationKind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.stackFrames != null && Object.hasOwnProperty.call(message, "stackFrames")) { + if (!Array.isArray(message.stackFrames)) + return "stackFrames: array expected"; + for (var i = 0; i < message.stackFrames.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.verify(message.stackFrames[i], long + 1); + if (error) + return "stackFrames." + error; + } + } + return null; + }; + + /** + * Creates a ScriptStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ScriptStatistics} ScriptStatistics + */ + ScriptStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ScriptStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ScriptStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ScriptStatistics(); + switch (object.evaluationKind) { + default: + if (typeof object.evaluationKind === "number") { + message.evaluationKind = object.evaluationKind; + break; + } + break; + case "EVALUATION_KIND_UNSPECIFIED": + case 0: + message.evaluationKind = 0; + break; + case "STATEMENT": + case 1: + message.evaluationKind = 1; + break; + case "EXPRESSION": + case 2: + message.evaluationKind = 2; + break; + } + if (object.stackFrames) { + if (!Array.isArray(object.stackFrames)) + throw TypeError(".google.cloud.bigquery.v2.ScriptStatistics.stackFrames: array expected"); + message.stackFrames = []; + for (var i = 0; i < object.stackFrames.length; ++i) { + if (!$util.isObject(object.stackFrames[i])) + throw TypeError(".google.cloud.bigquery.v2.ScriptStatistics.stackFrames: object expected"); + message.stackFrames[i] = $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.fromObject(object.stackFrames[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ScriptStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {google.cloud.bigquery.v2.ScriptStatistics} message ScriptStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScriptStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.stackFrames = []; + if (options.defaults) + object.evaluationKind = options.enums === String ? "EVALUATION_KIND_UNSPECIFIED" : 0; + if (message.evaluationKind != null && Object.hasOwnProperty.call(message, "evaluationKind")) + object.evaluationKind = options.enums === String ? $root.google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind[message.evaluationKind] === undefined ? message.evaluationKind : $root.google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind[message.evaluationKind] : message.evaluationKind; + if (message.stackFrames && message.stackFrames.length) { + object.stackFrames = []; + for (var j = 0; j < message.stackFrames.length; ++j) + object.stackFrames[j] = $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.toObject(message.stackFrames[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ScriptStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @instance + * @returns {Object.} JSON object + */ + ScriptStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScriptStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScriptStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ScriptStatistics"; + }; + + /** + * EvaluationKind enum. + * @name google.cloud.bigquery.v2.ScriptStatistics.EvaluationKind + * @enum {number} + * @property {number} EVALUATION_KIND_UNSPECIFIED=0 EVALUATION_KIND_UNSPECIFIED value + * @property {number} STATEMENT=1 STATEMENT value + * @property {number} EXPRESSION=2 EXPRESSION value + */ + ScriptStatistics.EvaluationKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATEMENT"] = 1; + values[valuesById[2] = "EXPRESSION"] = 2; + return values; + })(); + + ScriptStatistics.ScriptStackFrame = (function() { + + /** + * Properties of a ScriptStackFrame. + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @interface IScriptStackFrame + * @property {number|null} [startLine] ScriptStackFrame startLine + * @property {number|null} [startColumn] ScriptStackFrame startColumn + * @property {number|null} [endLine] ScriptStackFrame endLine + * @property {number|null} [endColumn] ScriptStackFrame endColumn + * @property {string|null} [procedureId] ScriptStackFrame procedureId + * @property {string|null} [text] ScriptStackFrame text + */ + + /** + * Constructs a new ScriptStackFrame. + * @memberof google.cloud.bigquery.v2.ScriptStatistics + * @classdesc Represents a ScriptStackFrame. + * @implements IScriptStackFrame + * @constructor + * @param {google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame=} [properties] Properties to set + */ + function ScriptStackFrame(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScriptStackFrame startLine. + * @member {number} startLine + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.startLine = 0; + + /** + * ScriptStackFrame startColumn. + * @member {number} startColumn + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.startColumn = 0; + + /** + * ScriptStackFrame endLine. + * @member {number} endLine + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.endLine = 0; + + /** + * ScriptStackFrame endColumn. + * @member {number} endColumn + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.endColumn = 0; + + /** + * ScriptStackFrame procedureId. + * @member {string} procedureId + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.procedureId = ""; + + /** + * ScriptStackFrame text. + * @member {string} text + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + */ + ScriptStackFrame.prototype.text = ""; + + /** + * Creates a new ScriptStackFrame instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame} ScriptStackFrame instance + */ + ScriptStackFrame.create = function create(properties) { + return new ScriptStackFrame(properties); + }; + + /** + * Encodes the specified ScriptStackFrame message. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame} message ScriptStackFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptStackFrame.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.startLine != null && Object.hasOwnProperty.call(message, "startLine")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startLine); + if (message.startColumn != null && Object.hasOwnProperty.call(message, "startColumn")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startColumn); + if (message.endLine != null && Object.hasOwnProperty.call(message, "endLine")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endLine); + if (message.endColumn != null && Object.hasOwnProperty.call(message, "endColumn")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.endColumn); + if (message.procedureId != null && Object.hasOwnProperty.call(message, "procedureId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.procedureId); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.text); + return writer; + }; + + /** + * Encodes the specified ScriptStackFrame message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {google.cloud.bigquery.v2.ScriptStatistics.IScriptStackFrame} message ScriptStackFrame message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScriptStackFrame.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ScriptStackFrame message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame} ScriptStackFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptStackFrame.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startLine = reader.int32(); + break; + } + case 2: { + message.startColumn = reader.int32(); + break; + } + case 3: { + message.endLine = reader.int32(); + break; + } + case 4: { + message.endColumn = reader.int32(); + break; + } + case 5: { + message.procedureId = reader.string(); + break; + } + case 6: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ScriptStackFrame message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame} ScriptStackFrame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScriptStackFrame.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScriptStackFrame message. + * @function verify + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScriptStackFrame.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.startLine != null && Object.hasOwnProperty.call(message, "startLine")) + if (!$util.isInteger(message.startLine)) + return "startLine: integer expected"; + if (message.startColumn != null && Object.hasOwnProperty.call(message, "startColumn")) + if (!$util.isInteger(message.startColumn)) + return "startColumn: integer expected"; + if (message.endLine != null && Object.hasOwnProperty.call(message, "endLine")) + if (!$util.isInteger(message.endLine)) + return "endLine: integer expected"; + if (message.endColumn != null && Object.hasOwnProperty.call(message, "endColumn")) + if (!$util.isInteger(message.endColumn)) + return "endColumn: integer expected"; + if (message.procedureId != null && Object.hasOwnProperty.call(message, "procedureId")) + if (!$util.isString(message.procedureId)) + return "procedureId: string expected"; + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a ScriptStackFrame message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame} ScriptStackFrame + */ + ScriptStackFrame.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame(); + if (object.startLine != null) + message.startLine = object.startLine | 0; + if (object.startColumn != null) + message.startColumn = object.startColumn | 0; + if (object.endLine != null) + message.endLine = object.endLine | 0; + if (object.endColumn != null) + message.endColumn = object.endColumn | 0; + if (object.procedureId != null) + message.procedureId = String(object.procedureId); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a ScriptStackFrame message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame} message ScriptStackFrame + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScriptStackFrame.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.startLine = 0; + object.startColumn = 0; + object.endLine = 0; + object.endColumn = 0; + object.procedureId = ""; + object.text = ""; + } + if (message.startLine != null && Object.hasOwnProperty.call(message, "startLine")) + object.startLine = message.startLine; + if (message.startColumn != null && Object.hasOwnProperty.call(message, "startColumn")) + object.startColumn = message.startColumn; + if (message.endLine != null && Object.hasOwnProperty.call(message, "endLine")) + object.endLine = message.endLine; + if (message.endColumn != null && Object.hasOwnProperty.call(message, "endColumn")) + object.endColumn = message.endColumn; + if (message.procedureId != null && Object.hasOwnProperty.call(message, "procedureId")) + object.procedureId = message.procedureId; + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + object.text = message.text; + return object; + }; + + /** + * Converts this ScriptStackFrame to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @instance + * @returns {Object.} JSON object + */ + ScriptStackFrame.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScriptStackFrame + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScriptStackFrame.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ScriptStatistics.ScriptStackFrame"; + }; + + return ScriptStackFrame; + })(); + + return ScriptStatistics; + })(); + + v2.RowLevelSecurityStatistics = (function() { + + /** + * Properties of a RowLevelSecurityStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IRowLevelSecurityStatistics + * @property {boolean|null} [rowLevelSecurityApplied] RowLevelSecurityStatistics rowLevelSecurityApplied + */ + + /** + * Constructs a new RowLevelSecurityStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RowLevelSecurityStatistics. + * @implements IRowLevelSecurityStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IRowLevelSecurityStatistics=} [properties] Properties to set + */ + function RowLevelSecurityStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowLevelSecurityStatistics rowLevelSecurityApplied. + * @member {boolean} rowLevelSecurityApplied + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @instance + */ + RowLevelSecurityStatistics.prototype.rowLevelSecurityApplied = false; + + /** + * Creates a new RowLevelSecurityStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {google.cloud.bigquery.v2.IRowLevelSecurityStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RowLevelSecurityStatistics} RowLevelSecurityStatistics instance + */ + RowLevelSecurityStatistics.create = function create(properties) { + return new RowLevelSecurityStatistics(properties); + }; + + /** + * Encodes the specified RowLevelSecurityStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.RowLevelSecurityStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {google.cloud.bigquery.v2.IRowLevelSecurityStatistics} message RowLevelSecurityStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowLevelSecurityStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.rowLevelSecurityApplied != null && Object.hasOwnProperty.call(message, "rowLevelSecurityApplied")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.rowLevelSecurityApplied); + return writer; + }; + + /** + * Encodes the specified RowLevelSecurityStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowLevelSecurityStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {google.cloud.bigquery.v2.IRowLevelSecurityStatistics} message RowLevelSecurityStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowLevelSecurityStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RowLevelSecurityStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RowLevelSecurityStatistics} RowLevelSecurityStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowLevelSecurityStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rowLevelSecurityApplied = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RowLevelSecurityStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RowLevelSecurityStatistics} RowLevelSecurityStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowLevelSecurityStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowLevelSecurityStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowLevelSecurityStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rowLevelSecurityApplied != null && Object.hasOwnProperty.call(message, "rowLevelSecurityApplied")) + if (typeof message.rowLevelSecurityApplied !== "boolean") + return "rowLevelSecurityApplied: boolean expected"; + return null; + }; + + /** + * Creates a RowLevelSecurityStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RowLevelSecurityStatistics} RowLevelSecurityStatistics + */ + RowLevelSecurityStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RowLevelSecurityStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics(); + if (object.rowLevelSecurityApplied != null) + message.rowLevelSecurityApplied = Boolean(object.rowLevelSecurityApplied); + return message; + }; + + /** + * Creates a plain object from a RowLevelSecurityStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {google.cloud.bigquery.v2.RowLevelSecurityStatistics} message RowLevelSecurityStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowLevelSecurityStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.rowLevelSecurityApplied = false; + if (message.rowLevelSecurityApplied != null && Object.hasOwnProperty.call(message, "rowLevelSecurityApplied")) + object.rowLevelSecurityApplied = message.rowLevelSecurityApplied; + return object; + }; + + /** + * Converts this RowLevelSecurityStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @instance + * @returns {Object.} JSON object + */ + RowLevelSecurityStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowLevelSecurityStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RowLevelSecurityStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowLevelSecurityStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RowLevelSecurityStatistics"; + }; + + return RowLevelSecurityStatistics; + })(); + + v2.DataMaskingStatistics = (function() { + + /** + * Properties of a DataMaskingStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IDataMaskingStatistics + * @property {boolean|null} [dataMaskingApplied] DataMaskingStatistics dataMaskingApplied + */ + + /** + * Constructs a new DataMaskingStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DataMaskingStatistics. + * @implements IDataMaskingStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IDataMaskingStatistics=} [properties] Properties to set + */ + function DataMaskingStatistics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataMaskingStatistics dataMaskingApplied. + * @member {boolean} dataMaskingApplied + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @instance + */ + DataMaskingStatistics.prototype.dataMaskingApplied = false; + + /** + * Creates a new DataMaskingStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {google.cloud.bigquery.v2.IDataMaskingStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DataMaskingStatistics} DataMaskingStatistics instance + */ + DataMaskingStatistics.create = function create(properties) { + return new DataMaskingStatistics(properties); + }; + + /** + * Encodes the specified DataMaskingStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.DataMaskingStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {google.cloud.bigquery.v2.IDataMaskingStatistics} message DataMaskingStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMaskingStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.dataMaskingApplied != null && Object.hasOwnProperty.call(message, "dataMaskingApplied")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.dataMaskingApplied); + return writer; + }; + + /** + * Encodes the specified DataMaskingStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DataMaskingStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {google.cloud.bigquery.v2.IDataMaskingStatistics} message DataMaskingStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataMaskingStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataMaskingStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DataMaskingStatistics} DataMaskingStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMaskingStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DataMaskingStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataMaskingApplied = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataMaskingStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DataMaskingStatistics} DataMaskingStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataMaskingStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataMaskingStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataMaskingStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.dataMaskingApplied != null && Object.hasOwnProperty.call(message, "dataMaskingApplied")) + if (typeof message.dataMaskingApplied !== "boolean") + return "dataMaskingApplied: boolean expected"; + return null; + }; + + /** + * Creates a DataMaskingStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DataMaskingStatistics} DataMaskingStatistics + */ + DataMaskingStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DataMaskingStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DataMaskingStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DataMaskingStatistics(); + if (object.dataMaskingApplied != null) + message.dataMaskingApplied = Boolean(object.dataMaskingApplied); + return message; + }; + + /** + * Creates a plain object from a DataMaskingStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {google.cloud.bigquery.v2.DataMaskingStatistics} message DataMaskingStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataMaskingStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.dataMaskingApplied = false; + if (message.dataMaskingApplied != null && Object.hasOwnProperty.call(message, "dataMaskingApplied")) + object.dataMaskingApplied = message.dataMaskingApplied; + return object; + }; + + /** + * Converts this DataMaskingStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @instance + * @returns {Object.} JSON object + */ + DataMaskingStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataMaskingStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DataMaskingStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataMaskingStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DataMaskingStatistics"; + }; + + return DataMaskingStatistics; + })(); + + v2.JobStatistics = (function() { + + /** + * Properties of a JobStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IJobStatistics + * @property {number|Long|null} [creationTime] JobStatistics creationTime + * @property {number|Long|null} [startTime] JobStatistics startTime + * @property {number|Long|null} [endTime] JobStatistics endTime + * @property {google.protobuf.IInt64Value|null} [totalBytesProcessed] JobStatistics totalBytesProcessed + * @property {google.protobuf.IDoubleValue|null} [completionRatio] JobStatistics completionRatio + * @property {Array.|null} [quotaDeferments] JobStatistics quotaDeferments + * @property {google.cloud.bigquery.v2.IJobStatistics2|null} [query] JobStatistics query + * @property {google.cloud.bigquery.v2.IJobStatistics3|null} [load] JobStatistics load + * @property {google.cloud.bigquery.v2.IJobStatistics4|null} [extract] JobStatistics extract + * @property {google.cloud.bigquery.v2.ICopyJobStatistics|null} [copy] JobStatistics copy + * @property {google.protobuf.IInt64Value|null} [totalSlotMs] JobStatistics totalSlotMs + * @property {string|null} [reservationId] JobStatistics reservationId + * @property {number|Long|null} [numChildJobs] JobStatistics numChildJobs + * @property {string|null} [parentJobId] JobStatistics parentJobId + * @property {google.cloud.bigquery.v2.IScriptStatistics|null} [scriptStatistics] JobStatistics scriptStatistics + * @property {google.cloud.bigquery.v2.IRowLevelSecurityStatistics|null} [rowLevelSecurityStatistics] JobStatistics rowLevelSecurityStatistics + * @property {google.cloud.bigquery.v2.IDataMaskingStatistics|null} [dataMaskingStatistics] JobStatistics dataMaskingStatistics + * @property {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo|null} [transactionInfo] JobStatistics transactionInfo + * @property {google.cloud.bigquery.v2.ISessionInfo|null} [sessionInfo] JobStatistics sessionInfo + * @property {number|Long|null} [finalExecutionDurationMs] JobStatistics finalExecutionDurationMs + * @property {google.cloud.bigquery.v2.ReservationEdition|null} [edition] JobStatistics edition + * @property {Array.|null} [reservationGroupPath] JobStatistics reservationGroupPath + */ + + /** + * Constructs a new JobStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobStatistics. + * @implements IJobStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IJobStatistics=} [properties] Properties to set + */ + function JobStatistics(properties) { + this.quotaDeferments = []; + this.reservationGroupPath = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatistics creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * JobStatistics startTime. + * @member {number|Long} startTime + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.startTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * JobStatistics endTime. + * @member {number|Long} endTime + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * JobStatistics totalBytesProcessed. + * @member {google.protobuf.IInt64Value|null|undefined} totalBytesProcessed + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.totalBytesProcessed = null; + + /** + * JobStatistics completionRatio. + * @member {google.protobuf.IDoubleValue|null|undefined} completionRatio + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.completionRatio = null; + + /** + * JobStatistics quotaDeferments. + * @member {Array.} quotaDeferments + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.quotaDeferments = $util.emptyArray; + + /** + * JobStatistics query. + * @member {google.cloud.bigquery.v2.IJobStatistics2|null|undefined} query + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.query = null; + + /** + * JobStatistics load. + * @member {google.cloud.bigquery.v2.IJobStatistics3|null|undefined} load + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.load = null; + + /** + * JobStatistics extract. + * @member {google.cloud.bigquery.v2.IJobStatistics4|null|undefined} extract + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.extract = null; + + /** + * JobStatistics copy. + * @member {google.cloud.bigquery.v2.ICopyJobStatistics|null|undefined} copy + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.copy = null; + + /** + * JobStatistics totalSlotMs. + * @member {google.protobuf.IInt64Value|null|undefined} totalSlotMs + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.totalSlotMs = null; + + /** + * JobStatistics reservationId. + * @member {string} reservationId + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.reservationId = ""; + + /** + * JobStatistics numChildJobs. + * @member {number|Long} numChildJobs + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.numChildJobs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * JobStatistics parentJobId. + * @member {string} parentJobId + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.parentJobId = ""; + + /** + * JobStatistics scriptStatistics. + * @member {google.cloud.bigquery.v2.IScriptStatistics|null|undefined} scriptStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.scriptStatistics = null; + + /** + * JobStatistics rowLevelSecurityStatistics. + * @member {google.cloud.bigquery.v2.IRowLevelSecurityStatistics|null|undefined} rowLevelSecurityStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.rowLevelSecurityStatistics = null; + + /** + * JobStatistics dataMaskingStatistics. + * @member {google.cloud.bigquery.v2.IDataMaskingStatistics|null|undefined} dataMaskingStatistics + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.dataMaskingStatistics = null; + + /** + * JobStatistics transactionInfo. + * @member {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo|null|undefined} transactionInfo + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.transactionInfo = null; + + /** + * JobStatistics sessionInfo. + * @member {google.cloud.bigquery.v2.ISessionInfo|null|undefined} sessionInfo + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.sessionInfo = null; + + /** + * JobStatistics finalExecutionDurationMs. + * @member {number|Long} finalExecutionDurationMs + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.finalExecutionDurationMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * JobStatistics edition. + * @member {google.cloud.bigquery.v2.ReservationEdition} edition + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.edition = 0; + + /** + * JobStatistics reservationGroupPath. + * @member {Array.} reservationGroupPath + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + */ + JobStatistics.prototype.reservationGroupPath = $util.emptyArray; + + /** + * Creates a new JobStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatistics} JobStatistics instance + */ + JobStatistics.create = function create(properties) { + return new JobStatistics(properties); + }; + + /** + * Encodes the specified JobStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics} message JobStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationTime); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.startTime); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.endTime); + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + $root.google.protobuf.Int64Value.encode(message.totalBytesProcessed, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.completionRatio != null && Object.hasOwnProperty.call(message, "completionRatio")) + $root.google.protobuf.DoubleValue.encode(message.completionRatio, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.cloud.bigquery.v2.JobStatistics2.encode(message.query, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.load != null && Object.hasOwnProperty.call(message, "load")) + $root.google.cloud.bigquery.v2.JobStatistics3.encode(message.load, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) + $root.google.cloud.bigquery.v2.JobStatistics4.encode(message.extract, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.quotaDeferments != null && message.quotaDeferments.length) + for (var i = 0; i < message.quotaDeferments.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.quotaDeferments[i]); + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + $root.google.protobuf.Int64Value.encode(message.totalSlotMs, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.numChildJobs != null && Object.hasOwnProperty.call(message, "numChildJobs")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.numChildJobs); + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.parentJobId); + if (message.scriptStatistics != null && Object.hasOwnProperty.call(message, "scriptStatistics")) + $root.google.cloud.bigquery.v2.ScriptStatistics.encode(message.scriptStatistics, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.reservationId != null && Object.hasOwnProperty.call(message, "reservationId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.reservationId); + if (message.rowLevelSecurityStatistics != null && Object.hasOwnProperty.call(message, "rowLevelSecurityStatistics")) + $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics.encode(message.rowLevelSecurityStatistics, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.transactionInfo != null && Object.hasOwnProperty.call(message, "transactionInfo")) + $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo.encode(message.transactionInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + $root.google.cloud.bigquery.v2.SessionInfo.encode(message.sessionInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.dataMaskingStatistics != null && Object.hasOwnProperty.call(message, "dataMaskingStatistics")) + $root.google.cloud.bigquery.v2.DataMaskingStatistics.encode(message.dataMaskingStatistics, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) + $root.google.cloud.bigquery.v2.CopyJobStatistics.encode(message.copy, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.finalExecutionDurationMs != null && Object.hasOwnProperty.call(message, "finalExecutionDurationMs")) + writer.uint32(/* id 22, wireType 0 =*/176).int64(message.finalExecutionDurationMs); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.edition); + if (message.reservationGroupPath != null && message.reservationGroupPath.length) + for (var i = 0; i < message.reservationGroupPath.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.reservationGroupPath[i]); + return writer; + }; + + /** + * Encodes the specified JobStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {google.cloud.bigquery.v2.IJobStatistics} message JobStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatistics} JobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.creationTime = reader.int64(); + break; + } + case 2: { + message.startTime = reader.int64(); + break; + } + case 3: { + message.endTime = reader.int64(); + break; + } + case 4: { + message.totalBytesProcessed = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.completionRatio = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.quotaDeferments && message.quotaDeferments.length)) + message.quotaDeferments = []; + message.quotaDeferments.push(reader.string()); + break; + } + case 6: { + message.query = $root.google.cloud.bigquery.v2.JobStatistics2.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.load = $root.google.cloud.bigquery.v2.JobStatistics3.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.extract = $root.google.cloud.bigquery.v2.JobStatistics4.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.copy = $root.google.cloud.bigquery.v2.CopyJobStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.totalSlotMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.reservationId = reader.string(); + break; + } + case 12: { + message.numChildJobs = reader.int64(); + break; + } + case 13: { + message.parentJobId = reader.string(); + break; + } + case 14: { + message.scriptStatistics = $root.google.cloud.bigquery.v2.ScriptStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.rowLevelSecurityStatistics = $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 20: { + message.dataMaskingStatistics = $root.google.cloud.bigquery.v2.DataMaskingStatistics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.transactionInfo = $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 18: { + message.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.finalExecutionDurationMs = reader.int64(); + break; + } + case 24: { + message.edition = reader.int32(); + break; + } + case 26: { + if (!(message.reservationGroupPath && message.reservationGroupPath.length)) + message.reservationGroupPath = []; + message.reservationGroupPath.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatistics} JobStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalBytesProcessed, long + 1); + if (error) + return "totalBytesProcessed." + error; + } + if (message.completionRatio != null && Object.hasOwnProperty.call(message, "completionRatio")) { + var error = $root.google.protobuf.DoubleValue.verify(message.completionRatio, long + 1); + if (error) + return "completionRatio." + error; + } + if (message.quotaDeferments != null && Object.hasOwnProperty.call(message, "quotaDeferments")) { + if (!Array.isArray(message.quotaDeferments)) + return "quotaDeferments: array expected"; + for (var i = 0; i < message.quotaDeferments.length; ++i) + if (!$util.isString(message.quotaDeferments[i])) + return "quotaDeferments: string[] expected"; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics2.verify(message.query, long + 1); + if (error) + return "query." + error; + } + if (message.load != null && Object.hasOwnProperty.call(message, "load")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics3.verify(message.load, long + 1); + if (error) + return "load." + error; + } + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics4.verify(message.extract, long + 1); + if (error) + return "extract." + error; + } + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) { + var error = $root.google.cloud.bigquery.v2.CopyJobStatistics.verify(message.copy, long + 1); + if (error) + return "copy." + error; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.totalSlotMs, long + 1); + if (error) + return "totalSlotMs." + error; + } + if (message.reservationId != null && Object.hasOwnProperty.call(message, "reservationId")) + if (!$util.isString(message.reservationId)) + return "reservationId: string expected"; + if (message.numChildJobs != null && Object.hasOwnProperty.call(message, "numChildJobs")) + if (!$util.isInteger(message.numChildJobs) && !(message.numChildJobs && $util.isInteger(message.numChildJobs.low) && $util.isInteger(message.numChildJobs.high))) + return "numChildJobs: integer|Long expected"; + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + if (!$util.isString(message.parentJobId)) + return "parentJobId: string expected"; + if (message.scriptStatistics != null && Object.hasOwnProperty.call(message, "scriptStatistics")) { + var error = $root.google.cloud.bigquery.v2.ScriptStatistics.verify(message.scriptStatistics, long + 1); + if (error) + return "scriptStatistics." + error; + } + if (message.rowLevelSecurityStatistics != null && Object.hasOwnProperty.call(message, "rowLevelSecurityStatistics")) { + var error = $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics.verify(message.rowLevelSecurityStatistics, long + 1); + if (error) + return "rowLevelSecurityStatistics." + error; + } + if (message.dataMaskingStatistics != null && Object.hasOwnProperty.call(message, "dataMaskingStatistics")) { + var error = $root.google.cloud.bigquery.v2.DataMaskingStatistics.verify(message.dataMaskingStatistics, long + 1); + if (error) + return "dataMaskingStatistics." + error; + } + if (message.transactionInfo != null && Object.hasOwnProperty.call(message, "transactionInfo")) { + var error = $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo.verify(message.transactionInfo, long + 1); + if (error) + return "transactionInfo." + error; + } + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) { + var error = $root.google.cloud.bigquery.v2.SessionInfo.verify(message.sessionInfo, long + 1); + if (error) + return "sessionInfo." + error; + } + if (message.finalExecutionDurationMs != null && Object.hasOwnProperty.call(message, "finalExecutionDurationMs")) + if (!$util.isInteger(message.finalExecutionDurationMs) && !(message.finalExecutionDurationMs && $util.isInteger(message.finalExecutionDurationMs.low) && $util.isInteger(message.finalExecutionDurationMs.high))) + return "finalExecutionDurationMs: integer|Long expected"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.reservationGroupPath != null && Object.hasOwnProperty.call(message, "reservationGroupPath")) { + if (!Array.isArray(message.reservationGroupPath)) + return "reservationGroupPath: array expected"; + for (var i = 0; i < message.reservationGroupPath.length; ++i) + if (!$util.isString(message.reservationGroupPath[i])) + return "reservationGroupPath: string[] expected"; + } + return null; + }; + + /** + * Creates a JobStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatistics} JobStatistics + */ + JobStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatistics(); + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.startTime != null) + if ($util.Long) + message.startTime = $util.Long.fromValue(object.startTime, false); + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(); + if (object.endTime != null) + if ($util.Long) + message.endTime = $util.Long.fromValue(object.endTime, false); + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + if (object.totalBytesProcessed != null) { + if (!$util.isObject(object.totalBytesProcessed)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.totalBytesProcessed: object expected"); + message.totalBytesProcessed = $root.google.protobuf.Int64Value.fromObject(object.totalBytesProcessed, long + 1); + } + if (object.completionRatio != null) { + if (!$util.isObject(object.completionRatio)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.completionRatio: object expected"); + message.completionRatio = $root.google.protobuf.DoubleValue.fromObject(object.completionRatio, long + 1); + } + if (object.quotaDeferments) { + if (!Array.isArray(object.quotaDeferments)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.quotaDeferments: array expected"); + message.quotaDeferments = []; + for (var i = 0; i < object.quotaDeferments.length; ++i) + message.quotaDeferments[i] = String(object.quotaDeferments[i]); + } + if (object.query != null) { + if (!$util.isObject(object.query)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.query: object expected"); + message.query = $root.google.cloud.bigquery.v2.JobStatistics2.fromObject(object.query, long + 1); + } + if (object.load != null) { + if (!$util.isObject(object.load)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.load: object expected"); + message.load = $root.google.cloud.bigquery.v2.JobStatistics3.fromObject(object.load, long + 1); + } + if (object.extract != null) { + if (!$util.isObject(object.extract)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.extract: object expected"); + message.extract = $root.google.cloud.bigquery.v2.JobStatistics4.fromObject(object.extract, long + 1); + } + if (object.copy != null) { + if (!$util.isObject(object.copy)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.copy: object expected"); + message.copy = $root.google.cloud.bigquery.v2.CopyJobStatistics.fromObject(object.copy, long + 1); + } + if (object.totalSlotMs != null) { + if (!$util.isObject(object.totalSlotMs)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.totalSlotMs: object expected"); + message.totalSlotMs = $root.google.protobuf.Int64Value.fromObject(object.totalSlotMs, long + 1); + } + if (object.reservationId != null) + message.reservationId = String(object.reservationId); + if (object.numChildJobs != null) + if ($util.Long) + message.numChildJobs = $util.Long.fromValue(object.numChildJobs, false); + else if (typeof object.numChildJobs === "string") + message.numChildJobs = parseInt(object.numChildJobs, 10); + else if (typeof object.numChildJobs === "number") + message.numChildJobs = object.numChildJobs; + else if (typeof object.numChildJobs === "object") + message.numChildJobs = new $util.LongBits(object.numChildJobs.low >>> 0, object.numChildJobs.high >>> 0).toNumber(); + if (object.parentJobId != null) + message.parentJobId = String(object.parentJobId); + if (object.scriptStatistics != null) { + if (!$util.isObject(object.scriptStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.scriptStatistics: object expected"); + message.scriptStatistics = $root.google.cloud.bigquery.v2.ScriptStatistics.fromObject(object.scriptStatistics, long + 1); + } + if (object.rowLevelSecurityStatistics != null) { + if (!$util.isObject(object.rowLevelSecurityStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.rowLevelSecurityStatistics: object expected"); + message.rowLevelSecurityStatistics = $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics.fromObject(object.rowLevelSecurityStatistics, long + 1); + } + if (object.dataMaskingStatistics != null) { + if (!$util.isObject(object.dataMaskingStatistics)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.dataMaskingStatistics: object expected"); + message.dataMaskingStatistics = $root.google.cloud.bigquery.v2.DataMaskingStatistics.fromObject(object.dataMaskingStatistics, long + 1); + } + if (object.transactionInfo != null) { + if (!$util.isObject(object.transactionInfo)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.transactionInfo: object expected"); + message.transactionInfo = $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo.fromObject(object.transactionInfo, long + 1); + } + if (object.sessionInfo != null) { + if (!$util.isObject(object.sessionInfo)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.sessionInfo: object expected"); + message.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.fromObject(object.sessionInfo, long + 1); + } + if (object.finalExecutionDurationMs != null) + if ($util.Long) + message.finalExecutionDurationMs = $util.Long.fromValue(object.finalExecutionDurationMs, false); + else if (typeof object.finalExecutionDurationMs === "string") + message.finalExecutionDurationMs = parseInt(object.finalExecutionDurationMs, 10); + else if (typeof object.finalExecutionDurationMs === "number") + message.finalExecutionDurationMs = object.finalExecutionDurationMs; + else if (typeof object.finalExecutionDurationMs === "object") + message.finalExecutionDurationMs = new $util.LongBits(object.finalExecutionDurationMs.low >>> 0, object.finalExecutionDurationMs.high >>> 0).toNumber(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "RESERVATION_EDITION_UNSPECIFIED": + case 0: + message.edition = 0; + break; + case "STANDARD": + case 1: + message.edition = 1; + break; + case "ENTERPRISE": + case 2: + message.edition = 2; + break; + case "ENTERPRISE_PLUS": + case 3: + message.edition = 3; + break; + } + if (object.reservationGroupPath) { + if (!Array.isArray(object.reservationGroupPath)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.reservationGroupPath: array expected"); + message.reservationGroupPath = []; + for (var i = 0; i < object.reservationGroupPath.length; ++i) + message.reservationGroupPath[i] = String(object.reservationGroupPath[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {google.cloud.bigquery.v2.JobStatistics} message JobStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.quotaDeferments = []; + object.reservationGroupPath = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.startTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.endTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.totalBytesProcessed = null; + object.completionRatio = null; + object.query = null; + object.load = null; + object.extract = null; + object.totalSlotMs = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numChildJobs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numChildJobs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.parentJobId = ""; + object.scriptStatistics = null; + object.reservationId = ""; + object.rowLevelSecurityStatistics = null; + object.transactionInfo = null; + object.sessionInfo = null; + object.dataMaskingStatistics = null; + object.copy = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.finalExecutionDurationMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.finalExecutionDurationMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.edition = options.enums === String ? "RESERVATION_EDITION_UNSPECIFIED" : 0; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.startTime = typeof message.startTime === "number" ? BigInt(message.startTime) : $util.Long.fromBits(message.startTime.low >>> 0, message.startTime.high >>> 0, false).toBigInt(); + else if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber() : message.startTime; + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.endTime = typeof message.endTime === "number" ? BigInt(message.endTime) : $util.Long.fromBits(message.endTime.low >>> 0, message.endTime.high >>> 0, false).toBigInt(); + else if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (message.totalBytesProcessed != null && Object.hasOwnProperty.call(message, "totalBytesProcessed")) + object.totalBytesProcessed = $root.google.protobuf.Int64Value.toObject(message.totalBytesProcessed, options, q + 1); + if (message.completionRatio != null && Object.hasOwnProperty.call(message, "completionRatio")) + object.completionRatio = $root.google.protobuf.DoubleValue.toObject(message.completionRatio, options, q + 1); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = $root.google.cloud.bigquery.v2.JobStatistics2.toObject(message.query, options, q + 1); + if (message.load != null && Object.hasOwnProperty.call(message, "load")) + object.load = $root.google.cloud.bigquery.v2.JobStatistics3.toObject(message.load, options, q + 1); + if (message.extract != null && Object.hasOwnProperty.call(message, "extract")) + object.extract = $root.google.cloud.bigquery.v2.JobStatistics4.toObject(message.extract, options, q + 1); + if (message.quotaDeferments && message.quotaDeferments.length) { + object.quotaDeferments = []; + for (var j = 0; j < message.quotaDeferments.length; ++j) + object.quotaDeferments[j] = message.quotaDeferments[j]; + } + if (message.totalSlotMs != null && Object.hasOwnProperty.call(message, "totalSlotMs")) + object.totalSlotMs = $root.google.protobuf.Int64Value.toObject(message.totalSlotMs, options, q + 1); + if (message.numChildJobs != null && Object.hasOwnProperty.call(message, "numChildJobs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numChildJobs = typeof message.numChildJobs === "number" ? BigInt(message.numChildJobs) : $util.Long.fromBits(message.numChildJobs.low >>> 0, message.numChildJobs.high >>> 0, false).toBigInt(); + else if (typeof message.numChildJobs === "number") + object.numChildJobs = options.longs === String ? String(message.numChildJobs) : message.numChildJobs; + else + object.numChildJobs = options.longs === String ? $util.Long.prototype.toString.call(message.numChildJobs) : options.longs === Number ? new $util.LongBits(message.numChildJobs.low >>> 0, message.numChildJobs.high >>> 0).toNumber() : message.numChildJobs; + if (message.parentJobId != null && Object.hasOwnProperty.call(message, "parentJobId")) + object.parentJobId = message.parentJobId; + if (message.scriptStatistics != null && Object.hasOwnProperty.call(message, "scriptStatistics")) + object.scriptStatistics = $root.google.cloud.bigquery.v2.ScriptStatistics.toObject(message.scriptStatistics, options, q + 1); + if (message.reservationId != null && Object.hasOwnProperty.call(message, "reservationId")) + object.reservationId = message.reservationId; + if (message.rowLevelSecurityStatistics != null && Object.hasOwnProperty.call(message, "rowLevelSecurityStatistics")) + object.rowLevelSecurityStatistics = $root.google.cloud.bigquery.v2.RowLevelSecurityStatistics.toObject(message.rowLevelSecurityStatistics, options, q + 1); + if (message.transactionInfo != null && Object.hasOwnProperty.call(message, "transactionInfo")) + object.transactionInfo = $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo.toObject(message.transactionInfo, options, q + 1); + if (message.sessionInfo != null && Object.hasOwnProperty.call(message, "sessionInfo")) + object.sessionInfo = $root.google.cloud.bigquery.v2.SessionInfo.toObject(message.sessionInfo, options, q + 1); + if (message.dataMaskingStatistics != null && Object.hasOwnProperty.call(message, "dataMaskingStatistics")) + object.dataMaskingStatistics = $root.google.cloud.bigquery.v2.DataMaskingStatistics.toObject(message.dataMaskingStatistics, options, q + 1); + if (message.copy != null && Object.hasOwnProperty.call(message, "copy")) + object.copy = $root.google.cloud.bigquery.v2.CopyJobStatistics.toObject(message.copy, options, q + 1); + if (message.finalExecutionDurationMs != null && Object.hasOwnProperty.call(message, "finalExecutionDurationMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.finalExecutionDurationMs = typeof message.finalExecutionDurationMs === "number" ? BigInt(message.finalExecutionDurationMs) : $util.Long.fromBits(message.finalExecutionDurationMs.low >>> 0, message.finalExecutionDurationMs.high >>> 0, false).toBigInt(); + else if (typeof message.finalExecutionDurationMs === "number") + object.finalExecutionDurationMs = options.longs === String ? String(message.finalExecutionDurationMs) : message.finalExecutionDurationMs; + else + object.finalExecutionDurationMs = options.longs === String ? $util.Long.prototype.toString.call(message.finalExecutionDurationMs) : options.longs === Number ? new $util.LongBits(message.finalExecutionDurationMs.low >>> 0, message.finalExecutionDurationMs.high >>> 0).toNumber() : message.finalExecutionDurationMs; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.cloud.bigquery.v2.ReservationEdition[message.edition] === undefined ? message.edition : $root.google.cloud.bigquery.v2.ReservationEdition[message.edition] : message.edition; + if (message.reservationGroupPath && message.reservationGroupPath.length) { + object.reservationGroupPath = []; + for (var j = 0; j < message.reservationGroupPath.length; ++j) + object.reservationGroupPath[j] = message.reservationGroupPath[j]; + } + return object; + }; + + /** + * Converts this JobStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatistics + * @instance + * @returns {Object.} JSON object + */ + JobStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatistics"; + }; + + JobStatistics.TransactionInfo = (function() { + + /** + * Properties of a TransactionInfo. + * @memberof google.cloud.bigquery.v2.JobStatistics + * @interface ITransactionInfo + * @property {string|null} [transactionId] TransactionInfo transactionId + */ + + /** + * Constructs a new TransactionInfo. + * @memberof google.cloud.bigquery.v2.JobStatistics + * @classdesc Represents a TransactionInfo. + * @implements ITransactionInfo + * @constructor + * @param {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo=} [properties] Properties to set + */ + function TransactionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionInfo transactionId. + * @member {string} transactionId + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @instance + */ + TransactionInfo.prototype.transactionId = ""; + + /** + * Creates a new TransactionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatistics.TransactionInfo} TransactionInfo instance + */ + TransactionInfo.create = function create(properties) { + return new TransactionInfo(properties); + }; + + /** + * Encodes the specified TransactionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.TransactionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo} message TransactionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.transactionId); + return writer; + }; + + /** + * Encodes the specified TransactionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatistics.TransactionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {google.cloud.bigquery.v2.JobStatistics.ITransactionInfo} message TransactionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatistics.TransactionInfo} TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.transactionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatistics.TransactionInfo} TransactionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + return null; + }; + + /** + * Creates a TransactionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatistics.TransactionInfo} TransactionInfo + */ + TransactionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatistics.TransactionInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatistics.TransactionInfo(); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + return message; + }; + + /** + * Creates a plain object from a TransactionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {google.cloud.bigquery.v2.JobStatistics.TransactionInfo} message TransactionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.transactionId = ""; + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + object.transactionId = message.transactionId; + return object; + }; + + /** + * Converts this TransactionInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @instance + * @returns {Object.} JSON object + */ + TransactionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatistics.TransactionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatistics.TransactionInfo"; + }; + + return TransactionInfo; + })(); + + return JobStatistics; + })(); + + v2.DmlStats = (function() { + + /** + * Properties of a DmlStats. + * @memberof google.cloud.bigquery.v2 + * @interface IDmlStats + * @property {google.protobuf.IInt64Value|null} [insertedRowCount] DmlStats insertedRowCount + * @property {google.protobuf.IInt64Value|null} [deletedRowCount] DmlStats deletedRowCount + * @property {google.protobuf.IInt64Value|null} [updatedRowCount] DmlStats updatedRowCount + * @property {google.cloud.bigquery.v2.DmlStats.DmlMode|null} [dmlMode] DmlStats dmlMode + * @property {google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason|null} [fineGrainedDmlUnusedReason] DmlStats fineGrainedDmlUnusedReason + */ + + /** + * Constructs a new DmlStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DmlStats. + * @implements IDmlStats + * @constructor + * @param {google.cloud.bigquery.v2.IDmlStats=} [properties] Properties to set + */ + function DmlStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DmlStats insertedRowCount. + * @member {google.protobuf.IInt64Value|null|undefined} insertedRowCount + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + */ + DmlStats.prototype.insertedRowCount = null; + + /** + * DmlStats deletedRowCount. + * @member {google.protobuf.IInt64Value|null|undefined} deletedRowCount + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + */ + DmlStats.prototype.deletedRowCount = null; + + /** + * DmlStats updatedRowCount. + * @member {google.protobuf.IInt64Value|null|undefined} updatedRowCount + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + */ + DmlStats.prototype.updatedRowCount = null; + + /** + * DmlStats dmlMode. + * @member {google.cloud.bigquery.v2.DmlStats.DmlMode} dmlMode + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + */ + DmlStats.prototype.dmlMode = 0; + + /** + * DmlStats fineGrainedDmlUnusedReason. + * @member {google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason} fineGrainedDmlUnusedReason + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + */ + DmlStats.prototype.fineGrainedDmlUnusedReason = 0; + + /** + * Creates a new DmlStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {google.cloud.bigquery.v2.IDmlStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DmlStats} DmlStats instance + */ + DmlStats.create = function create(properties) { + return new DmlStats(properties); + }; + + /** + * Encodes the specified DmlStats message. Does not implicitly {@link google.cloud.bigquery.v2.DmlStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {google.cloud.bigquery.v2.IDmlStats} message DmlStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DmlStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.insertedRowCount != null && Object.hasOwnProperty.call(message, "insertedRowCount")) + $root.google.protobuf.Int64Value.encode(message.insertedRowCount, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.deletedRowCount != null && Object.hasOwnProperty.call(message, "deletedRowCount")) + $root.google.protobuf.Int64Value.encode(message.deletedRowCount, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.updatedRowCount != null && Object.hasOwnProperty.call(message, "updatedRowCount")) + $root.google.protobuf.Int64Value.encode(message.updatedRowCount, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.dmlMode != null && Object.hasOwnProperty.call(message, "dmlMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.dmlMode); + if (message.fineGrainedDmlUnusedReason != null && Object.hasOwnProperty.call(message, "fineGrainedDmlUnusedReason")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.fineGrainedDmlUnusedReason); + return writer; + }; + + /** + * Encodes the specified DmlStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DmlStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {google.cloud.bigquery.v2.IDmlStats} message DmlStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DmlStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DmlStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DmlStats} DmlStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DmlStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DmlStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.insertedRowCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.deletedRowCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updatedRowCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.dmlMode = reader.int32(); + break; + } + case 5: { + message.fineGrainedDmlUnusedReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DmlStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DmlStats} DmlStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DmlStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DmlStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DmlStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.insertedRowCount != null && Object.hasOwnProperty.call(message, "insertedRowCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.insertedRowCount, long + 1); + if (error) + return "insertedRowCount." + error; + } + if (message.deletedRowCount != null && Object.hasOwnProperty.call(message, "deletedRowCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.deletedRowCount, long + 1); + if (error) + return "deletedRowCount." + error; + } + if (message.updatedRowCount != null && Object.hasOwnProperty.call(message, "updatedRowCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.updatedRowCount, long + 1); + if (error) + return "updatedRowCount." + error; + } + if (message.dmlMode != null && Object.hasOwnProperty.call(message, "dmlMode")) + switch (message.dmlMode) { + default: + return "dmlMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.fineGrainedDmlUnusedReason != null && Object.hasOwnProperty.call(message, "fineGrainedDmlUnusedReason")) + switch (message.fineGrainedDmlUnusedReason) { + default: + return "fineGrainedDmlUnusedReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a DmlStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DmlStats} DmlStats + */ + DmlStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DmlStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DmlStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DmlStats(); + if (object.insertedRowCount != null) { + if (!$util.isObject(object.insertedRowCount)) + throw TypeError(".google.cloud.bigquery.v2.DmlStats.insertedRowCount: object expected"); + message.insertedRowCount = $root.google.protobuf.Int64Value.fromObject(object.insertedRowCount, long + 1); + } + if (object.deletedRowCount != null) { + if (!$util.isObject(object.deletedRowCount)) + throw TypeError(".google.cloud.bigquery.v2.DmlStats.deletedRowCount: object expected"); + message.deletedRowCount = $root.google.protobuf.Int64Value.fromObject(object.deletedRowCount, long + 1); + } + if (object.updatedRowCount != null) { + if (!$util.isObject(object.updatedRowCount)) + throw TypeError(".google.cloud.bigquery.v2.DmlStats.updatedRowCount: object expected"); + message.updatedRowCount = $root.google.protobuf.Int64Value.fromObject(object.updatedRowCount, long + 1); + } + switch (object.dmlMode) { + default: + if (typeof object.dmlMode === "number") { + message.dmlMode = object.dmlMode; + break; + } + break; + case "DML_MODE_UNSPECIFIED": + case 0: + message.dmlMode = 0; + break; + case "COARSE_GRAINED_DML": + case 1: + message.dmlMode = 1; + break; + case "FINE_GRAINED_DML": + case 2: + message.dmlMode = 2; + break; + } + switch (object.fineGrainedDmlUnusedReason) { + default: + if (typeof object.fineGrainedDmlUnusedReason === "number") { + message.fineGrainedDmlUnusedReason = object.fineGrainedDmlUnusedReason; + break; + } + break; + case "FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED": + case 0: + message.fineGrainedDmlUnusedReason = 0; + break; + case "MAX_PARTITION_SIZE_EXCEEDED": + case 1: + message.fineGrainedDmlUnusedReason = 1; + break; + case "TABLE_NOT_ENROLLED": + case 2: + message.fineGrainedDmlUnusedReason = 2; + break; + case "DML_IN_MULTI_STATEMENT_TRANSACTION": + case 3: + message.fineGrainedDmlUnusedReason = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a DmlStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {google.cloud.bigquery.v2.DmlStats} message DmlStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DmlStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.insertedRowCount = null; + object.deletedRowCount = null; + object.updatedRowCount = null; + object.dmlMode = options.enums === String ? "DML_MODE_UNSPECIFIED" : 0; + object.fineGrainedDmlUnusedReason = options.enums === String ? "FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED" : 0; + } + if (message.insertedRowCount != null && Object.hasOwnProperty.call(message, "insertedRowCount")) + object.insertedRowCount = $root.google.protobuf.Int64Value.toObject(message.insertedRowCount, options, q + 1); + if (message.deletedRowCount != null && Object.hasOwnProperty.call(message, "deletedRowCount")) + object.deletedRowCount = $root.google.protobuf.Int64Value.toObject(message.deletedRowCount, options, q + 1); + if (message.updatedRowCount != null && Object.hasOwnProperty.call(message, "updatedRowCount")) + object.updatedRowCount = $root.google.protobuf.Int64Value.toObject(message.updatedRowCount, options, q + 1); + if (message.dmlMode != null && Object.hasOwnProperty.call(message, "dmlMode")) + object.dmlMode = options.enums === String ? $root.google.cloud.bigquery.v2.DmlStats.DmlMode[message.dmlMode] === undefined ? message.dmlMode : $root.google.cloud.bigquery.v2.DmlStats.DmlMode[message.dmlMode] : message.dmlMode; + if (message.fineGrainedDmlUnusedReason != null && Object.hasOwnProperty.call(message, "fineGrainedDmlUnusedReason")) + object.fineGrainedDmlUnusedReason = options.enums === String ? $root.google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason[message.fineGrainedDmlUnusedReason] === undefined ? message.fineGrainedDmlUnusedReason : $root.google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason[message.fineGrainedDmlUnusedReason] : message.fineGrainedDmlUnusedReason; + return object; + }; + + /** + * Converts this DmlStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DmlStats + * @instance + * @returns {Object.} JSON object + */ + DmlStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DmlStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DmlStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DmlStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DmlStats"; + }; + + /** + * DmlMode enum. + * @name google.cloud.bigquery.v2.DmlStats.DmlMode + * @enum {number} + * @property {number} DML_MODE_UNSPECIFIED=0 DML_MODE_UNSPECIFIED value + * @property {number} COARSE_GRAINED_DML=1 COARSE_GRAINED_DML value + * @property {number} FINE_GRAINED_DML=2 FINE_GRAINED_DML value + */ + DmlStats.DmlMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DML_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COARSE_GRAINED_DML"] = 1; + values[valuesById[2] = "FINE_GRAINED_DML"] = 2; + return values; + })(); + + /** + * FineGrainedDmlUnusedReason enum. + * @name google.cloud.bigquery.v2.DmlStats.FineGrainedDmlUnusedReason + * @enum {number} + * @property {number} FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED=0 FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED value + * @property {number} MAX_PARTITION_SIZE_EXCEEDED=1 MAX_PARTITION_SIZE_EXCEEDED value + * @property {number} TABLE_NOT_ENROLLED=2 TABLE_NOT_ENROLLED value + * @property {number} DML_IN_MULTI_STATEMENT_TRANSACTION=3 DML_IN_MULTI_STATEMENT_TRANSACTION value + */ + DmlStats.FineGrainedDmlUnusedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "MAX_PARTITION_SIZE_EXCEEDED"] = 1; + values[valuesById[2] = "TABLE_NOT_ENROLLED"] = 2; + values[valuesById[3] = "DML_IN_MULTI_STATEMENT_TRANSACTION"] = 3; + return values; + })(); + + return DmlStats; + })(); + + v2.PerformanceInsights = (function() { + + /** + * Properties of a PerformanceInsights. + * @memberof google.cloud.bigquery.v2 + * @interface IPerformanceInsights + * @property {number|Long|null} [avgPreviousExecutionMs] PerformanceInsights avgPreviousExecutionMs + * @property {Array.|null} [stagePerformanceStandaloneInsights] PerformanceInsights stagePerformanceStandaloneInsights + * @property {Array.|null} [stagePerformanceChangeInsights] PerformanceInsights stagePerformanceChangeInsights + * @property {Array.|null} [tableChangeInsights] PerformanceInsights tableChangeInsights + */ + + /** + * Constructs a new PerformanceInsights. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PerformanceInsights. + * @implements IPerformanceInsights + * @constructor + * @param {google.cloud.bigquery.v2.IPerformanceInsights=} [properties] Properties to set + */ + function PerformanceInsights(properties) { + this.stagePerformanceStandaloneInsights = []; + this.stagePerformanceChangeInsights = []; + this.tableChangeInsights = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PerformanceInsights avgPreviousExecutionMs. + * @member {number|Long} avgPreviousExecutionMs + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @instance + */ + PerformanceInsights.prototype.avgPreviousExecutionMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PerformanceInsights stagePerformanceStandaloneInsights. + * @member {Array.} stagePerformanceStandaloneInsights + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @instance + */ + PerformanceInsights.prototype.stagePerformanceStandaloneInsights = $util.emptyArray; + + /** + * PerformanceInsights stagePerformanceChangeInsights. + * @member {Array.} stagePerformanceChangeInsights + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @instance + */ + PerformanceInsights.prototype.stagePerformanceChangeInsights = $util.emptyArray; + + /** + * PerformanceInsights tableChangeInsights. + * @member {Array.} tableChangeInsights + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @instance + */ + PerformanceInsights.prototype.tableChangeInsights = $util.emptyArray; + + /** + * Creates a new PerformanceInsights instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {google.cloud.bigquery.v2.IPerformanceInsights=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PerformanceInsights} PerformanceInsights instance + */ + PerformanceInsights.create = function create(properties) { + return new PerformanceInsights(properties); + }; + + /** + * Encodes the specified PerformanceInsights message. Does not implicitly {@link google.cloud.bigquery.v2.PerformanceInsights.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {google.cloud.bigquery.v2.IPerformanceInsights} message PerformanceInsights message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerformanceInsights.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.avgPreviousExecutionMs != null && Object.hasOwnProperty.call(message, "avgPreviousExecutionMs")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.avgPreviousExecutionMs); + if (message.stagePerformanceStandaloneInsights != null && message.stagePerformanceStandaloneInsights.length) + for (var i = 0; i < message.stagePerformanceStandaloneInsights.length; ++i) + $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.encode(message.stagePerformanceStandaloneInsights[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.stagePerformanceChangeInsights != null && message.stagePerformanceChangeInsights.length) + for (var i = 0; i < message.stagePerformanceChangeInsights.length; ++i) + $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight.encode(message.stagePerformanceChangeInsights[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.tableChangeInsights != null && message.tableChangeInsights.length) + for (var i = 0; i < message.tableChangeInsights.length; ++i) + $root.google.cloud.bigquery.v2.TableChangeInsight.encode(message.tableChangeInsights[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PerformanceInsights message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PerformanceInsights.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {google.cloud.bigquery.v2.IPerformanceInsights} message PerformanceInsights message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerformanceInsights.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PerformanceInsights message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PerformanceInsights} PerformanceInsights + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerformanceInsights.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PerformanceInsights(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.avgPreviousExecutionMs = reader.int64(); + break; + } + case 2: { + if (!(message.stagePerformanceStandaloneInsights && message.stagePerformanceStandaloneInsights.length)) + message.stagePerformanceStandaloneInsights = []; + message.stagePerformanceStandaloneInsights.push($root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.stagePerformanceChangeInsights && message.stagePerformanceChangeInsights.length)) + message.stagePerformanceChangeInsights = []; + message.stagePerformanceChangeInsights.push($root.google.cloud.bigquery.v2.StagePerformanceChangeInsight.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.tableChangeInsights && message.tableChangeInsights.length)) + message.tableChangeInsights = []; + message.tableChangeInsights.push($root.google.cloud.bigquery.v2.TableChangeInsight.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PerformanceInsights message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PerformanceInsights} PerformanceInsights + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerformanceInsights.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PerformanceInsights message. + * @function verify + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PerformanceInsights.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.avgPreviousExecutionMs != null && Object.hasOwnProperty.call(message, "avgPreviousExecutionMs")) + if (!$util.isInteger(message.avgPreviousExecutionMs) && !(message.avgPreviousExecutionMs && $util.isInteger(message.avgPreviousExecutionMs.low) && $util.isInteger(message.avgPreviousExecutionMs.high))) + return "avgPreviousExecutionMs: integer|Long expected"; + if (message.stagePerformanceStandaloneInsights != null && Object.hasOwnProperty.call(message, "stagePerformanceStandaloneInsights")) { + if (!Array.isArray(message.stagePerformanceStandaloneInsights)) + return "stagePerformanceStandaloneInsights: array expected"; + for (var i = 0; i < message.stagePerformanceStandaloneInsights.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.verify(message.stagePerformanceStandaloneInsights[i], long + 1); + if (error) + return "stagePerformanceStandaloneInsights." + error; + } + } + if (message.stagePerformanceChangeInsights != null && Object.hasOwnProperty.call(message, "stagePerformanceChangeInsights")) { + if (!Array.isArray(message.stagePerformanceChangeInsights)) + return "stagePerformanceChangeInsights: array expected"; + for (var i = 0; i < message.stagePerformanceChangeInsights.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight.verify(message.stagePerformanceChangeInsights[i], long + 1); + if (error) + return "stagePerformanceChangeInsights." + error; + } + } + if (message.tableChangeInsights != null && Object.hasOwnProperty.call(message, "tableChangeInsights")) { + if (!Array.isArray(message.tableChangeInsights)) + return "tableChangeInsights: array expected"; + for (var i = 0; i < message.tableChangeInsights.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableChangeInsight.verify(message.tableChangeInsights[i], long + 1); + if (error) + return "tableChangeInsights." + error; + } + } + return null; + }; + + /** + * Creates a PerformanceInsights message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PerformanceInsights} PerformanceInsights + */ + PerformanceInsights.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PerformanceInsights) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PerformanceInsights(); + if (object.avgPreviousExecutionMs != null) + if ($util.Long) + message.avgPreviousExecutionMs = $util.Long.fromValue(object.avgPreviousExecutionMs, false); + else if (typeof object.avgPreviousExecutionMs === "string") + message.avgPreviousExecutionMs = parseInt(object.avgPreviousExecutionMs, 10); + else if (typeof object.avgPreviousExecutionMs === "number") + message.avgPreviousExecutionMs = object.avgPreviousExecutionMs; + else if (typeof object.avgPreviousExecutionMs === "object") + message.avgPreviousExecutionMs = new $util.LongBits(object.avgPreviousExecutionMs.low >>> 0, object.avgPreviousExecutionMs.high >>> 0).toNumber(); + if (object.stagePerformanceStandaloneInsights) { + if (!Array.isArray(object.stagePerformanceStandaloneInsights)) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.stagePerformanceStandaloneInsights: array expected"); + message.stagePerformanceStandaloneInsights = []; + for (var i = 0; i < object.stagePerformanceStandaloneInsights.length; ++i) { + if (!$util.isObject(object.stagePerformanceStandaloneInsights[i])) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.stagePerformanceStandaloneInsights: object expected"); + message.stagePerformanceStandaloneInsights[i] = $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.fromObject(object.stagePerformanceStandaloneInsights[i], long + 1); + } + } + if (object.stagePerformanceChangeInsights) { + if (!Array.isArray(object.stagePerformanceChangeInsights)) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.stagePerformanceChangeInsights: array expected"); + message.stagePerformanceChangeInsights = []; + for (var i = 0; i < object.stagePerformanceChangeInsights.length; ++i) { + if (!$util.isObject(object.stagePerformanceChangeInsights[i])) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.stagePerformanceChangeInsights: object expected"); + message.stagePerformanceChangeInsights[i] = $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight.fromObject(object.stagePerformanceChangeInsights[i], long + 1); + } + } + if (object.tableChangeInsights) { + if (!Array.isArray(object.tableChangeInsights)) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.tableChangeInsights: array expected"); + message.tableChangeInsights = []; + for (var i = 0; i < object.tableChangeInsights.length; ++i) { + if (!$util.isObject(object.tableChangeInsights[i])) + throw TypeError(".google.cloud.bigquery.v2.PerformanceInsights.tableChangeInsights: object expected"); + message.tableChangeInsights[i] = $root.google.cloud.bigquery.v2.TableChangeInsight.fromObject(object.tableChangeInsights[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a PerformanceInsights message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {google.cloud.bigquery.v2.PerformanceInsights} message PerformanceInsights + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PerformanceInsights.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.stagePerformanceStandaloneInsights = []; + object.stagePerformanceChangeInsights = []; + object.tableChangeInsights = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.avgPreviousExecutionMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.avgPreviousExecutionMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.avgPreviousExecutionMs != null && Object.hasOwnProperty.call(message, "avgPreviousExecutionMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.avgPreviousExecutionMs = typeof message.avgPreviousExecutionMs === "number" ? BigInt(message.avgPreviousExecutionMs) : $util.Long.fromBits(message.avgPreviousExecutionMs.low >>> 0, message.avgPreviousExecutionMs.high >>> 0, false).toBigInt(); + else if (typeof message.avgPreviousExecutionMs === "number") + object.avgPreviousExecutionMs = options.longs === String ? String(message.avgPreviousExecutionMs) : message.avgPreviousExecutionMs; + else + object.avgPreviousExecutionMs = options.longs === String ? $util.Long.prototype.toString.call(message.avgPreviousExecutionMs) : options.longs === Number ? new $util.LongBits(message.avgPreviousExecutionMs.low >>> 0, message.avgPreviousExecutionMs.high >>> 0).toNumber() : message.avgPreviousExecutionMs; + if (message.stagePerformanceStandaloneInsights && message.stagePerformanceStandaloneInsights.length) { + object.stagePerformanceStandaloneInsights = []; + for (var j = 0; j < message.stagePerformanceStandaloneInsights.length; ++j) + object.stagePerformanceStandaloneInsights[j] = $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.toObject(message.stagePerformanceStandaloneInsights[j], options, q + 1); + } + if (message.stagePerformanceChangeInsights && message.stagePerformanceChangeInsights.length) { + object.stagePerformanceChangeInsights = []; + for (var j = 0; j < message.stagePerformanceChangeInsights.length; ++j) + object.stagePerformanceChangeInsights[j] = $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight.toObject(message.stagePerformanceChangeInsights[j], options, q + 1); + } + if (message.tableChangeInsights && message.tableChangeInsights.length) { + object.tableChangeInsights = []; + for (var j = 0; j < message.tableChangeInsights.length; ++j) + object.tableChangeInsights[j] = $root.google.cloud.bigquery.v2.TableChangeInsight.toObject(message.tableChangeInsights[j], options, q + 1); + } + return object; + }; + + /** + * Converts this PerformanceInsights to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @instance + * @returns {Object.} JSON object + */ + PerformanceInsights.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PerformanceInsights + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PerformanceInsights + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PerformanceInsights.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PerformanceInsights"; + }; + + return PerformanceInsights; + })(); + + v2.StagePerformanceChangeInsight = (function() { + + /** + * Properties of a StagePerformanceChangeInsight. + * @memberof google.cloud.bigquery.v2 + * @interface IStagePerformanceChangeInsight + * @property {number|Long|null} [stageId] StagePerformanceChangeInsight stageId + * @property {google.cloud.bigquery.v2.IInputDataChange|null} [inputDataChange] StagePerformanceChangeInsight inputDataChange + */ + + /** + * Constructs a new StagePerformanceChangeInsight. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StagePerformanceChangeInsight. + * @implements IStagePerformanceChangeInsight + * @constructor + * @param {google.cloud.bigquery.v2.IStagePerformanceChangeInsight=} [properties] Properties to set + */ + function StagePerformanceChangeInsight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StagePerformanceChangeInsight stageId. + * @member {number|Long} stageId + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @instance + */ + StagePerformanceChangeInsight.prototype.stageId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StagePerformanceChangeInsight inputDataChange. + * @member {google.cloud.bigquery.v2.IInputDataChange|null|undefined} inputDataChange + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @instance + */ + StagePerformanceChangeInsight.prototype.inputDataChange = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StagePerformanceChangeInsight.prototype, "_inputDataChange", { + get: $util.oneOfGetter($oneOfFields = ["inputDataChange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StagePerformanceChangeInsight instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceChangeInsight=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StagePerformanceChangeInsight} StagePerformanceChangeInsight instance + */ + StagePerformanceChangeInsight.create = function create(properties) { + return new StagePerformanceChangeInsight(properties); + }; + + /** + * Encodes the specified StagePerformanceChangeInsight message. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceChangeInsight.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceChangeInsight} message StagePerformanceChangeInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StagePerformanceChangeInsight.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.stageId); + if (message.inputDataChange != null && Object.hasOwnProperty.call(message, "inputDataChange")) + $root.google.cloud.bigquery.v2.InputDataChange.encode(message.inputDataChange, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StagePerformanceChangeInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceChangeInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceChangeInsight} message StagePerformanceChangeInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StagePerformanceChangeInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StagePerformanceChangeInsight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StagePerformanceChangeInsight} StagePerformanceChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StagePerformanceChangeInsight.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stageId = reader.int64(); + break; + } + case 2: { + message.inputDataChange = $root.google.cloud.bigquery.v2.InputDataChange.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StagePerformanceChangeInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StagePerformanceChangeInsight} StagePerformanceChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StagePerformanceChangeInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StagePerformanceChangeInsight message. + * @function verify + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StagePerformanceChangeInsight.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (!$util.isInteger(message.stageId) && !(message.stageId && $util.isInteger(message.stageId.low) && $util.isInteger(message.stageId.high))) + return "stageId: integer|Long expected"; + if (message.inputDataChange != null && Object.hasOwnProperty.call(message, "inputDataChange")) { + properties._inputDataChange = 1; + { + var error = $root.google.cloud.bigquery.v2.InputDataChange.verify(message.inputDataChange, long + 1); + if (error) + return "inputDataChange." + error; + } + } + return null; + }; + + /** + * Creates a StagePerformanceChangeInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StagePerformanceChangeInsight} StagePerformanceChangeInsight + */ + StagePerformanceChangeInsight.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceChangeInsight: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StagePerformanceChangeInsight(); + if (object.stageId != null) + if ($util.Long) + message.stageId = $util.Long.fromValue(object.stageId, false); + else if (typeof object.stageId === "string") + message.stageId = parseInt(object.stageId, 10); + else if (typeof object.stageId === "number") + message.stageId = object.stageId; + else if (typeof object.stageId === "object") + message.stageId = new $util.LongBits(object.stageId.low >>> 0, object.stageId.high >>> 0).toNumber(); + if (object.inputDataChange != null) { + if (!$util.isObject(object.inputDataChange)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceChangeInsight.inputDataChange: object expected"); + message.inputDataChange = $root.google.cloud.bigquery.v2.InputDataChange.fromObject(object.inputDataChange, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StagePerformanceChangeInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {google.cloud.bigquery.v2.StagePerformanceChangeInsight} message StagePerformanceChangeInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StagePerformanceChangeInsight.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.stageId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.stageId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.stageId = typeof message.stageId === "number" ? BigInt(message.stageId) : $util.Long.fromBits(message.stageId.low >>> 0, message.stageId.high >>> 0, false).toBigInt(); + else if (typeof message.stageId === "number") + object.stageId = options.longs === String ? String(message.stageId) : message.stageId; + else + object.stageId = options.longs === String ? $util.Long.prototype.toString.call(message.stageId) : options.longs === Number ? new $util.LongBits(message.stageId.low >>> 0, message.stageId.high >>> 0).toNumber() : message.stageId; + if (message.inputDataChange != null && Object.hasOwnProperty.call(message, "inputDataChange")) { + object.inputDataChange = $root.google.cloud.bigquery.v2.InputDataChange.toObject(message.inputDataChange, options, q + 1); + if (options.oneofs) + object._inputDataChange = "inputDataChange"; + } + return object; + }; + + /** + * Converts this StagePerformanceChangeInsight to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @instance + * @returns {Object.} JSON object + */ + StagePerformanceChangeInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StagePerformanceChangeInsight + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StagePerformanceChangeInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StagePerformanceChangeInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StagePerformanceChangeInsight"; + }; + + return StagePerformanceChangeInsight; + })(); + + v2.InputDataChange = (function() { + + /** + * Properties of an InputDataChange. + * @memberof google.cloud.bigquery.v2 + * @interface IInputDataChange + * @property {number|null} [recordsReadDiffPercentage] InputDataChange recordsReadDiffPercentage + */ + + /** + * Constructs a new InputDataChange. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an InputDataChange. + * @implements IInputDataChange + * @constructor + * @param {google.cloud.bigquery.v2.IInputDataChange=} [properties] Properties to set + */ + function InputDataChange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputDataChange recordsReadDiffPercentage. + * @member {number} recordsReadDiffPercentage + * @memberof google.cloud.bigquery.v2.InputDataChange + * @instance + */ + InputDataChange.prototype.recordsReadDiffPercentage = 0; + + /** + * Creates a new InputDataChange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {google.cloud.bigquery.v2.IInputDataChange=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.InputDataChange} InputDataChange instance + */ + InputDataChange.create = function create(properties) { + return new InputDataChange(properties); + }; + + /** + * Encodes the specified InputDataChange message. Does not implicitly {@link google.cloud.bigquery.v2.InputDataChange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {google.cloud.bigquery.v2.IInputDataChange} message InputDataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputDataChange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.recordsReadDiffPercentage != null && Object.hasOwnProperty.call(message, "recordsReadDiffPercentage")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.recordsReadDiffPercentage); + return writer; + }; + + /** + * Encodes the specified InputDataChange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InputDataChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {google.cloud.bigquery.v2.IInputDataChange} message InputDataChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputDataChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an InputDataChange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.InputDataChange} InputDataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputDataChange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.InputDataChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recordsReadDiffPercentage = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InputDataChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.InputDataChange} InputDataChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputDataChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputDataChange message. + * @function verify + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputDataChange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.recordsReadDiffPercentage != null && Object.hasOwnProperty.call(message, "recordsReadDiffPercentage")) + if (typeof message.recordsReadDiffPercentage !== "number") + return "recordsReadDiffPercentage: number expected"; + return null; + }; + + /** + * Creates an InputDataChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.InputDataChange} InputDataChange + */ + InputDataChange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.InputDataChange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.InputDataChange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.InputDataChange(); + if (object.recordsReadDiffPercentage != null) + message.recordsReadDiffPercentage = Number(object.recordsReadDiffPercentage); + return message; + }; + + /** + * Creates a plain object from an InputDataChange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {google.cloud.bigquery.v2.InputDataChange} message InputDataChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputDataChange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.recordsReadDiffPercentage = 0; + if (message.recordsReadDiffPercentage != null && Object.hasOwnProperty.call(message, "recordsReadDiffPercentage")) + object.recordsReadDiffPercentage = options.json && !isFinite(message.recordsReadDiffPercentage) ? String(message.recordsReadDiffPercentage) : message.recordsReadDiffPercentage; + return object; + }; + + /** + * Converts this InputDataChange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.InputDataChange + * @instance + * @returns {Object.} JSON object + */ + InputDataChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputDataChange + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.InputDataChange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputDataChange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.InputDataChange"; + }; + + return InputDataChange; + })(); + + v2.StagePerformanceStandaloneInsight = (function() { + + /** + * Properties of a StagePerformanceStandaloneInsight. + * @memberof google.cloud.bigquery.v2 + * @interface IStagePerformanceStandaloneInsight + * @property {number|Long|null} [stageId] StagePerformanceStandaloneInsight stageId + * @property {boolean|null} [slotContention] StagePerformanceStandaloneInsight slotContention + * @property {boolean|null} [insufficientShuffleQuota] StagePerformanceStandaloneInsight insufficientShuffleQuota + * @property {Array.|null} [biEngineReasons] StagePerformanceStandaloneInsight biEngineReasons + * @property {Array.|null} [highCardinalityJoins] StagePerformanceStandaloneInsight highCardinalityJoins + * @property {google.cloud.bigquery.v2.IPartitionSkew|null} [partitionSkew] StagePerformanceStandaloneInsight partitionSkew + */ + + /** + * Constructs a new StagePerformanceStandaloneInsight. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a StagePerformanceStandaloneInsight. + * @implements IStagePerformanceStandaloneInsight + * @constructor + * @param {google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight=} [properties] Properties to set + */ + function StagePerformanceStandaloneInsight(properties) { + this.biEngineReasons = []; + this.highCardinalityJoins = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StagePerformanceStandaloneInsight stageId. + * @member {number|Long} stageId + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.stageId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StagePerformanceStandaloneInsight slotContention. + * @member {boolean|null|undefined} slotContention + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.slotContention = null; + + /** + * StagePerformanceStandaloneInsight insufficientShuffleQuota. + * @member {boolean|null|undefined} insufficientShuffleQuota + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.insufficientShuffleQuota = null; + + /** + * StagePerformanceStandaloneInsight biEngineReasons. + * @member {Array.} biEngineReasons + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.biEngineReasons = $util.emptyArray; + + /** + * StagePerformanceStandaloneInsight highCardinalityJoins. + * @member {Array.} highCardinalityJoins + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.highCardinalityJoins = $util.emptyArray; + + /** + * StagePerformanceStandaloneInsight partitionSkew. + * @member {google.cloud.bigquery.v2.IPartitionSkew|null|undefined} partitionSkew + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + */ + StagePerformanceStandaloneInsight.prototype.partitionSkew = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StagePerformanceStandaloneInsight.prototype, "_slotContention", { + get: $util.oneOfGetter($oneOfFields = ["slotContention"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StagePerformanceStandaloneInsight.prototype, "_insufficientShuffleQuota", { + get: $util.oneOfGetter($oneOfFields = ["insufficientShuffleQuota"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StagePerformanceStandaloneInsight.prototype, "_partitionSkew", { + get: $util.oneOfGetter($oneOfFields = ["partitionSkew"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StagePerformanceStandaloneInsight instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.StagePerformanceStandaloneInsight} StagePerformanceStandaloneInsight instance + */ + StagePerformanceStandaloneInsight.create = function create(properties) { + return new StagePerformanceStandaloneInsight(properties); + }; + + /** + * Encodes the specified StagePerformanceStandaloneInsight message. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight} message StagePerformanceStandaloneInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StagePerformanceStandaloneInsight.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.stageId); + if (message.slotContention != null && Object.hasOwnProperty.call(message, "slotContention")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.slotContention); + if (message.insufficientShuffleQuota != null && Object.hasOwnProperty.call(message, "insufficientShuffleQuota")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.insufficientShuffleQuota); + if (message.biEngineReasons != null && message.biEngineReasons.length) + for (var i = 0; i < message.biEngineReasons.length; ++i) + $root.google.cloud.bigquery.v2.BiEngineReason.encode(message.biEngineReasons[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.highCardinalityJoins != null && message.highCardinalityJoins.length) + for (var i = 0; i < message.highCardinalityJoins.length; ++i) + $root.google.cloud.bigquery.v2.HighCardinalityJoin.encode(message.highCardinalityJoins[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.partitionSkew != null && Object.hasOwnProperty.call(message, "partitionSkew")) + $root.google.cloud.bigquery.v2.PartitionSkew.encode(message.partitionSkew, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified StagePerformanceStandaloneInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {google.cloud.bigquery.v2.IStagePerformanceStandaloneInsight} message StagePerformanceStandaloneInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StagePerformanceStandaloneInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StagePerformanceStandaloneInsight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.StagePerformanceStandaloneInsight} StagePerformanceStandaloneInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StagePerformanceStandaloneInsight.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stageId = reader.int64(); + break; + } + case 2: { + message.slotContention = reader.bool(); + break; + } + case 3: { + message.insufficientShuffleQuota = reader.bool(); + break; + } + case 5: { + if (!(message.biEngineReasons && message.biEngineReasons.length)) + message.biEngineReasons = []; + message.biEngineReasons.push($root.google.cloud.bigquery.v2.BiEngineReason.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.highCardinalityJoins && message.highCardinalityJoins.length)) + message.highCardinalityJoins = []; + message.highCardinalityJoins.push($root.google.cloud.bigquery.v2.HighCardinalityJoin.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.partitionSkew = $root.google.cloud.bigquery.v2.PartitionSkew.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StagePerformanceStandaloneInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.StagePerformanceStandaloneInsight} StagePerformanceStandaloneInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StagePerformanceStandaloneInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StagePerformanceStandaloneInsight message. + * @function verify + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StagePerformanceStandaloneInsight.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (!$util.isInteger(message.stageId) && !(message.stageId && $util.isInteger(message.stageId.low) && $util.isInteger(message.stageId.high))) + return "stageId: integer|Long expected"; + if (message.slotContention != null && Object.hasOwnProperty.call(message, "slotContention")) { + properties._slotContention = 1; + if (typeof message.slotContention !== "boolean") + return "slotContention: boolean expected"; + } + if (message.insufficientShuffleQuota != null && Object.hasOwnProperty.call(message, "insufficientShuffleQuota")) { + properties._insufficientShuffleQuota = 1; + if (typeof message.insufficientShuffleQuota !== "boolean") + return "insufficientShuffleQuota: boolean expected"; + } + if (message.biEngineReasons != null && Object.hasOwnProperty.call(message, "biEngineReasons")) { + if (!Array.isArray(message.biEngineReasons)) + return "biEngineReasons: array expected"; + for (var i = 0; i < message.biEngineReasons.length; ++i) { + var error = $root.google.cloud.bigquery.v2.BiEngineReason.verify(message.biEngineReasons[i], long + 1); + if (error) + return "biEngineReasons." + error; + } + } + if (message.highCardinalityJoins != null && Object.hasOwnProperty.call(message, "highCardinalityJoins")) { + if (!Array.isArray(message.highCardinalityJoins)) + return "highCardinalityJoins: array expected"; + for (var i = 0; i < message.highCardinalityJoins.length; ++i) { + var error = $root.google.cloud.bigquery.v2.HighCardinalityJoin.verify(message.highCardinalityJoins[i], long + 1); + if (error) + return "highCardinalityJoins." + error; + } + } + if (message.partitionSkew != null && Object.hasOwnProperty.call(message, "partitionSkew")) { + properties._partitionSkew = 1; + { + var error = $root.google.cloud.bigquery.v2.PartitionSkew.verify(message.partitionSkew, long + 1); + if (error) + return "partitionSkew." + error; + } + } + return null; + }; + + /** + * Creates a StagePerformanceStandaloneInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.StagePerformanceStandaloneInsight} StagePerformanceStandaloneInsight + */ + StagePerformanceStandaloneInsight.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.StagePerformanceStandaloneInsight(); + if (object.stageId != null) + if ($util.Long) + message.stageId = $util.Long.fromValue(object.stageId, false); + else if (typeof object.stageId === "string") + message.stageId = parseInt(object.stageId, 10); + else if (typeof object.stageId === "number") + message.stageId = object.stageId; + else if (typeof object.stageId === "object") + message.stageId = new $util.LongBits(object.stageId.low >>> 0, object.stageId.high >>> 0).toNumber(); + if (object.slotContention != null) + message.slotContention = Boolean(object.slotContention); + if (object.insufficientShuffleQuota != null) + message.insufficientShuffleQuota = Boolean(object.insufficientShuffleQuota); + if (object.biEngineReasons) { + if (!Array.isArray(object.biEngineReasons)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.biEngineReasons: array expected"); + message.biEngineReasons = []; + for (var i = 0; i < object.biEngineReasons.length; ++i) { + if (!$util.isObject(object.biEngineReasons[i])) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.biEngineReasons: object expected"); + message.biEngineReasons[i] = $root.google.cloud.bigquery.v2.BiEngineReason.fromObject(object.biEngineReasons[i], long + 1); + } + } + if (object.highCardinalityJoins) { + if (!Array.isArray(object.highCardinalityJoins)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.highCardinalityJoins: array expected"); + message.highCardinalityJoins = []; + for (var i = 0; i < object.highCardinalityJoins.length; ++i) { + if (!$util.isObject(object.highCardinalityJoins[i])) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.highCardinalityJoins: object expected"); + message.highCardinalityJoins[i] = $root.google.cloud.bigquery.v2.HighCardinalityJoin.fromObject(object.highCardinalityJoins[i], long + 1); + } + } + if (object.partitionSkew != null) { + if (!$util.isObject(object.partitionSkew)) + throw TypeError(".google.cloud.bigquery.v2.StagePerformanceStandaloneInsight.partitionSkew: object expected"); + message.partitionSkew = $root.google.cloud.bigquery.v2.PartitionSkew.fromObject(object.partitionSkew, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a StagePerformanceStandaloneInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {google.cloud.bigquery.v2.StagePerformanceStandaloneInsight} message StagePerformanceStandaloneInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StagePerformanceStandaloneInsight.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.biEngineReasons = []; + object.highCardinalityJoins = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.stageId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.stageId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.stageId = typeof message.stageId === "number" ? BigInt(message.stageId) : $util.Long.fromBits(message.stageId.low >>> 0, message.stageId.high >>> 0, false).toBigInt(); + else if (typeof message.stageId === "number") + object.stageId = options.longs === String ? String(message.stageId) : message.stageId; + else + object.stageId = options.longs === String ? $util.Long.prototype.toString.call(message.stageId) : options.longs === Number ? new $util.LongBits(message.stageId.low >>> 0, message.stageId.high >>> 0).toNumber() : message.stageId; + if (message.slotContention != null && Object.hasOwnProperty.call(message, "slotContention")) { + object.slotContention = message.slotContention; + if (options.oneofs) + object._slotContention = "slotContention"; + } + if (message.insufficientShuffleQuota != null && Object.hasOwnProperty.call(message, "insufficientShuffleQuota")) { + object.insufficientShuffleQuota = message.insufficientShuffleQuota; + if (options.oneofs) + object._insufficientShuffleQuota = "insufficientShuffleQuota"; + } + if (message.biEngineReasons && message.biEngineReasons.length) { + object.biEngineReasons = []; + for (var j = 0; j < message.biEngineReasons.length; ++j) + object.biEngineReasons[j] = $root.google.cloud.bigquery.v2.BiEngineReason.toObject(message.biEngineReasons[j], options, q + 1); + } + if (message.highCardinalityJoins && message.highCardinalityJoins.length) { + object.highCardinalityJoins = []; + for (var j = 0; j < message.highCardinalityJoins.length; ++j) + object.highCardinalityJoins[j] = $root.google.cloud.bigquery.v2.HighCardinalityJoin.toObject(message.highCardinalityJoins[j], options, q + 1); + } + if (message.partitionSkew != null && Object.hasOwnProperty.call(message, "partitionSkew")) { + object.partitionSkew = $root.google.cloud.bigquery.v2.PartitionSkew.toObject(message.partitionSkew, options, q + 1); + if (options.oneofs) + object._partitionSkew = "partitionSkew"; + } + return object; + }; + + /** + * Converts this StagePerformanceStandaloneInsight to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @instance + * @returns {Object.} JSON object + */ + StagePerformanceStandaloneInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StagePerformanceStandaloneInsight + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.StagePerformanceStandaloneInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StagePerformanceStandaloneInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.StagePerformanceStandaloneInsight"; + }; + + return StagePerformanceStandaloneInsight; + })(); + + v2.HighCardinalityJoin = (function() { + + /** + * Properties of a HighCardinalityJoin. + * @memberof google.cloud.bigquery.v2 + * @interface IHighCardinalityJoin + * @property {number|Long|null} [leftRows] HighCardinalityJoin leftRows + * @property {number|Long|null} [rightRows] HighCardinalityJoin rightRows + * @property {number|Long|null} [outputRows] HighCardinalityJoin outputRows + * @property {number|null} [stepIndex] HighCardinalityJoin stepIndex + */ + + /** + * Constructs a new HighCardinalityJoin. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a HighCardinalityJoin. + * @implements IHighCardinalityJoin + * @constructor + * @param {google.cloud.bigquery.v2.IHighCardinalityJoin=} [properties] Properties to set + */ + function HighCardinalityJoin(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HighCardinalityJoin leftRows. + * @member {number|Long} leftRows + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @instance + */ + HighCardinalityJoin.prototype.leftRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HighCardinalityJoin rightRows. + * @member {number|Long} rightRows + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @instance + */ + HighCardinalityJoin.prototype.rightRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HighCardinalityJoin outputRows. + * @member {number|Long} outputRows + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @instance + */ + HighCardinalityJoin.prototype.outputRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HighCardinalityJoin stepIndex. + * @member {number} stepIndex + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @instance + */ + HighCardinalityJoin.prototype.stepIndex = 0; + + /** + * Creates a new HighCardinalityJoin instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {google.cloud.bigquery.v2.IHighCardinalityJoin=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.HighCardinalityJoin} HighCardinalityJoin instance + */ + HighCardinalityJoin.create = function create(properties) { + return new HighCardinalityJoin(properties); + }; + + /** + * Encodes the specified HighCardinalityJoin message. Does not implicitly {@link google.cloud.bigquery.v2.HighCardinalityJoin.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {google.cloud.bigquery.v2.IHighCardinalityJoin} message HighCardinalityJoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HighCardinalityJoin.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.leftRows != null && Object.hasOwnProperty.call(message, "leftRows")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.leftRows); + if (message.rightRows != null && Object.hasOwnProperty.call(message, "rightRows")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rightRows); + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.outputRows); + if (message.stepIndex != null && Object.hasOwnProperty.call(message, "stepIndex")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stepIndex); + return writer; + }; + + /** + * Encodes the specified HighCardinalityJoin message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.HighCardinalityJoin.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {google.cloud.bigquery.v2.IHighCardinalityJoin} message HighCardinalityJoin message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HighCardinalityJoin.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HighCardinalityJoin message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.HighCardinalityJoin} HighCardinalityJoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HighCardinalityJoin.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.HighCardinalityJoin(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.leftRows = reader.int64(); + break; + } + case 2: { + message.rightRows = reader.int64(); + break; + } + case 3: { + message.outputRows = reader.int64(); + break; + } + case 4: { + message.stepIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HighCardinalityJoin message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.HighCardinalityJoin} HighCardinalityJoin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HighCardinalityJoin.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HighCardinalityJoin message. + * @function verify + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HighCardinalityJoin.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.leftRows != null && Object.hasOwnProperty.call(message, "leftRows")) + if (!$util.isInteger(message.leftRows) && !(message.leftRows && $util.isInteger(message.leftRows.low) && $util.isInteger(message.leftRows.high))) + return "leftRows: integer|Long expected"; + if (message.rightRows != null && Object.hasOwnProperty.call(message, "rightRows")) + if (!$util.isInteger(message.rightRows) && !(message.rightRows && $util.isInteger(message.rightRows.low) && $util.isInteger(message.rightRows.high))) + return "rightRows: integer|Long expected"; + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + if (!$util.isInteger(message.outputRows) && !(message.outputRows && $util.isInteger(message.outputRows.low) && $util.isInteger(message.outputRows.high))) + return "outputRows: integer|Long expected"; + if (message.stepIndex != null && Object.hasOwnProperty.call(message, "stepIndex")) + if (!$util.isInteger(message.stepIndex)) + return "stepIndex: integer expected"; + return null; + }; + + /** + * Creates a HighCardinalityJoin message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.HighCardinalityJoin} HighCardinalityJoin + */ + HighCardinalityJoin.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.HighCardinalityJoin) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.HighCardinalityJoin: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.HighCardinalityJoin(); + if (object.leftRows != null) + if ($util.Long) + message.leftRows = $util.Long.fromValue(object.leftRows, false); + else if (typeof object.leftRows === "string") + message.leftRows = parseInt(object.leftRows, 10); + else if (typeof object.leftRows === "number") + message.leftRows = object.leftRows; + else if (typeof object.leftRows === "object") + message.leftRows = new $util.LongBits(object.leftRows.low >>> 0, object.leftRows.high >>> 0).toNumber(); + if (object.rightRows != null) + if ($util.Long) + message.rightRows = $util.Long.fromValue(object.rightRows, false); + else if (typeof object.rightRows === "string") + message.rightRows = parseInt(object.rightRows, 10); + else if (typeof object.rightRows === "number") + message.rightRows = object.rightRows; + else if (typeof object.rightRows === "object") + message.rightRows = new $util.LongBits(object.rightRows.low >>> 0, object.rightRows.high >>> 0).toNumber(); + if (object.outputRows != null) + if ($util.Long) + message.outputRows = $util.Long.fromValue(object.outputRows, false); + else if (typeof object.outputRows === "string") + message.outputRows = parseInt(object.outputRows, 10); + else if (typeof object.outputRows === "number") + message.outputRows = object.outputRows; + else if (typeof object.outputRows === "object") + message.outputRows = new $util.LongBits(object.outputRows.low >>> 0, object.outputRows.high >>> 0).toNumber(); + if (object.stepIndex != null) + message.stepIndex = object.stepIndex | 0; + return message; + }; + + /** + * Creates a plain object from a HighCardinalityJoin message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {google.cloud.bigquery.v2.HighCardinalityJoin} message HighCardinalityJoin + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HighCardinalityJoin.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.leftRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.leftRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rightRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.rightRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.outputRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.outputRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.stepIndex = 0; + } + if (message.leftRows != null && Object.hasOwnProperty.call(message, "leftRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.leftRows = typeof message.leftRows === "number" ? BigInt(message.leftRows) : $util.Long.fromBits(message.leftRows.low >>> 0, message.leftRows.high >>> 0, false).toBigInt(); + else if (typeof message.leftRows === "number") + object.leftRows = options.longs === String ? String(message.leftRows) : message.leftRows; + else + object.leftRows = options.longs === String ? $util.Long.prototype.toString.call(message.leftRows) : options.longs === Number ? new $util.LongBits(message.leftRows.low >>> 0, message.leftRows.high >>> 0).toNumber() : message.leftRows; + if (message.rightRows != null && Object.hasOwnProperty.call(message, "rightRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.rightRows = typeof message.rightRows === "number" ? BigInt(message.rightRows) : $util.Long.fromBits(message.rightRows.low >>> 0, message.rightRows.high >>> 0, false).toBigInt(); + else if (typeof message.rightRows === "number") + object.rightRows = options.longs === String ? String(message.rightRows) : message.rightRows; + else + object.rightRows = options.longs === String ? $util.Long.prototype.toString.call(message.rightRows) : options.longs === Number ? new $util.LongBits(message.rightRows.low >>> 0, message.rightRows.high >>> 0).toNumber() : message.rightRows; + if (message.outputRows != null && Object.hasOwnProperty.call(message, "outputRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.outputRows = typeof message.outputRows === "number" ? BigInt(message.outputRows) : $util.Long.fromBits(message.outputRows.low >>> 0, message.outputRows.high >>> 0, false).toBigInt(); + else if (typeof message.outputRows === "number") + object.outputRows = options.longs === String ? String(message.outputRows) : message.outputRows; + else + object.outputRows = options.longs === String ? $util.Long.prototype.toString.call(message.outputRows) : options.longs === Number ? new $util.LongBits(message.outputRows.low >>> 0, message.outputRows.high >>> 0).toNumber() : message.outputRows; + if (message.stepIndex != null && Object.hasOwnProperty.call(message, "stepIndex")) + object.stepIndex = message.stepIndex; + return object; + }; + + /** + * Converts this HighCardinalityJoin to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @instance + * @returns {Object.} JSON object + */ + HighCardinalityJoin.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HighCardinalityJoin + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.HighCardinalityJoin + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HighCardinalityJoin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.HighCardinalityJoin"; + }; + + return HighCardinalityJoin; + })(); + + v2.PartitionSkew = (function() { + + /** + * Properties of a PartitionSkew. + * @memberof google.cloud.bigquery.v2 + * @interface IPartitionSkew + * @property {Array.|null} [skewSources] PartitionSkew skewSources + */ + + /** + * Constructs a new PartitionSkew. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PartitionSkew. + * @implements IPartitionSkew + * @constructor + * @param {google.cloud.bigquery.v2.IPartitionSkew=} [properties] Properties to set + */ + function PartitionSkew(properties) { + this.skewSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionSkew skewSources. + * @member {Array.} skewSources + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @instance + */ + PartitionSkew.prototype.skewSources = $util.emptyArray; + + /** + * Creates a new PartitionSkew instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {google.cloud.bigquery.v2.IPartitionSkew=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PartitionSkew} PartitionSkew instance + */ + PartitionSkew.create = function create(properties) { + return new PartitionSkew(properties); + }; + + /** + * Encodes the specified PartitionSkew message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {google.cloud.bigquery.v2.IPartitionSkew} message PartitionSkew message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSkew.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.skewSources != null && message.skewSources.length) + for (var i = 0; i < message.skewSources.length; ++i) + $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource.encode(message.skewSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionSkew message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {google.cloud.bigquery.v2.IPartitionSkew} message PartitionSkew message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSkew.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PartitionSkew message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PartitionSkew} PartitionSkew + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSkew.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PartitionSkew(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.skewSources && message.skewSources.length)) + message.skewSources = []; + message.skewSources.push($root.google.cloud.bigquery.v2.PartitionSkew.SkewSource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionSkew message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PartitionSkew} PartitionSkew + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSkew.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionSkew message. + * @function verify + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionSkew.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.skewSources != null && Object.hasOwnProperty.call(message, "skewSources")) { + if (!Array.isArray(message.skewSources)) + return "skewSources: array expected"; + for (var i = 0; i < message.skewSources.length; ++i) { + var error = $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource.verify(message.skewSources[i], long + 1); + if (error) + return "skewSources." + error; + } + } + return null; + }; + + /** + * Creates a PartitionSkew message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PartitionSkew} PartitionSkew + */ + PartitionSkew.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PartitionSkew) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PartitionSkew: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PartitionSkew(); + if (object.skewSources) { + if (!Array.isArray(object.skewSources)) + throw TypeError(".google.cloud.bigquery.v2.PartitionSkew.skewSources: array expected"); + message.skewSources = []; + for (var i = 0; i < object.skewSources.length; ++i) { + if (!$util.isObject(object.skewSources[i])) + throw TypeError(".google.cloud.bigquery.v2.PartitionSkew.skewSources: object expected"); + message.skewSources[i] = $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource.fromObject(object.skewSources[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a PartitionSkew message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {google.cloud.bigquery.v2.PartitionSkew} message PartitionSkew + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionSkew.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.skewSources = []; + if (message.skewSources && message.skewSources.length) { + object.skewSources = []; + for (var j = 0; j < message.skewSources.length; ++j) + object.skewSources[j] = $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource.toObject(message.skewSources[j], options, q + 1); + } + return object; + }; + + /** + * Converts this PartitionSkew to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @instance + * @returns {Object.} JSON object + */ + PartitionSkew.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionSkew + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionSkew.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PartitionSkew"; + }; + + PartitionSkew.SkewSource = (function() { + + /** + * Properties of a SkewSource. + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @interface ISkewSource + * @property {number|Long|null} [stageId] SkewSource stageId + */ + + /** + * Constructs a new SkewSource. + * @memberof google.cloud.bigquery.v2.PartitionSkew + * @classdesc Represents a SkewSource. + * @implements ISkewSource + * @constructor + * @param {google.cloud.bigquery.v2.PartitionSkew.ISkewSource=} [properties] Properties to set + */ + function SkewSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkewSource stageId. + * @member {number|Long} stageId + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @instance + */ + SkewSource.prototype.stageId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SkewSource instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {google.cloud.bigquery.v2.PartitionSkew.ISkewSource=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PartitionSkew.SkewSource} SkewSource instance + */ + SkewSource.create = function create(properties) { + return new SkewSource(properties); + }; + + /** + * Encodes the specified SkewSource message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.SkewSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {google.cloud.bigquery.v2.PartitionSkew.ISkewSource} message SkewSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkewSource.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.stageId); + return writer; + }; + + /** + * Encodes the specified SkewSource message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionSkew.SkewSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {google.cloud.bigquery.v2.PartitionSkew.ISkewSource} message SkewSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkewSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SkewSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PartitionSkew.SkewSource} SkewSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkewSource.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stageId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SkewSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PartitionSkew.SkewSource} SkewSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkewSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkewSource message. + * @function verify + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkewSource.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (!$util.isInteger(message.stageId) && !(message.stageId && $util.isInteger(message.stageId.low) && $util.isInteger(message.stageId.high))) + return "stageId: integer|Long expected"; + return null; + }; + + /** + * Creates a SkewSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PartitionSkew.SkewSource} SkewSource + */ + SkewSource.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PartitionSkew.SkewSource: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PartitionSkew.SkewSource(); + if (object.stageId != null) + if ($util.Long) + message.stageId = $util.Long.fromValue(object.stageId, false); + else if (typeof object.stageId === "string") + message.stageId = parseInt(object.stageId, 10); + else if (typeof object.stageId === "number") + message.stageId = object.stageId; + else if (typeof object.stageId === "object") + message.stageId = new $util.LongBits(object.stageId.low >>> 0, object.stageId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SkewSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {google.cloud.bigquery.v2.PartitionSkew.SkewSource} message SkewSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkewSource.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.stageId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.stageId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.stageId = typeof message.stageId === "number" ? BigInt(message.stageId) : $util.Long.fromBits(message.stageId.low >>> 0, message.stageId.high >>> 0, false).toBigInt(); + else if (typeof message.stageId === "number") + object.stageId = options.longs === String ? String(message.stageId) : message.stageId; + else + object.stageId = options.longs === String ? $util.Long.prototype.toString.call(message.stageId) : options.longs === Number ? new $util.LongBits(message.stageId.low >>> 0, message.stageId.high >>> 0).toNumber() : message.stageId; + return object; + }; + + /** + * Converts this SkewSource to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @instance + * @returns {Object.} JSON object + */ + SkewSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkewSource + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PartitionSkew.SkewSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkewSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PartitionSkew.SkewSource"; + }; + + return SkewSource; + })(); + + return PartitionSkew; + })(); + + v2.TableChangeInsight = (function() { + + /** + * Properties of a TableChangeInsight. + * @memberof google.cloud.bigquery.v2 + * @interface ITableChangeInsight + * @property {google.cloud.bigquery.v2.ITableReference|null} [tableReference] TableChangeInsight tableReference + * @property {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight|null} [metadataCacheStalenessInsight] TableChangeInsight metadataCacheStalenessInsight + * @property {boolean|null} [metadataCacheNotUsedButUsedPreviously] TableChangeInsight metadataCacheNotUsedButUsedPreviously + */ + + /** + * Constructs a new TableChangeInsight. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableChangeInsight. + * @implements ITableChangeInsight + * @constructor + * @param {google.cloud.bigquery.v2.ITableChangeInsight=} [properties] Properties to set + */ + function TableChangeInsight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableChangeInsight tableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @instance + */ + TableChangeInsight.prototype.tableReference = null; + + /** + * TableChangeInsight metadataCacheStalenessInsight. + * @member {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight|null|undefined} metadataCacheStalenessInsight + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @instance + */ + TableChangeInsight.prototype.metadataCacheStalenessInsight = null; + + /** + * TableChangeInsight metadataCacheNotUsedButUsedPreviously. + * @member {boolean|null|undefined} metadataCacheNotUsedButUsedPreviously + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @instance + */ + TableChangeInsight.prototype.metadataCacheNotUsedButUsedPreviously = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableChangeInsight.prototype, "_metadataCacheStalenessInsight", { + get: $util.oneOfGetter($oneOfFields = ["metadataCacheStalenessInsight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableChangeInsight.prototype, "_metadataCacheNotUsedButUsedPreviously", { + get: $util.oneOfGetter($oneOfFields = ["metadataCacheNotUsedButUsedPreviously"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TableChangeInsight instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {google.cloud.bigquery.v2.ITableChangeInsight=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableChangeInsight} TableChangeInsight instance + */ + TableChangeInsight.create = function create(properties) { + return new TableChangeInsight(properties); + }; + + /** + * Encodes the specified TableChangeInsight message. Does not implicitly {@link google.cloud.bigquery.v2.TableChangeInsight.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {google.cloud.bigquery.v2.ITableChangeInsight} message TableChangeInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableChangeInsight.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.metadataCacheStalenessInsight != null && Object.hasOwnProperty.call(message, "metadataCacheStalenessInsight")) + $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight.encode(message.metadataCacheStalenessInsight, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.metadataCacheNotUsedButUsedPreviously != null && Object.hasOwnProperty.call(message, "metadataCacheNotUsedButUsedPreviously")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.metadataCacheNotUsedButUsedPreviously); + return writer; + }; + + /** + * Encodes the specified TableChangeInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableChangeInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {google.cloud.bigquery.v2.ITableChangeInsight} message TableChangeInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableChangeInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableChangeInsight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableChangeInsight} TableChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableChangeInsight.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableChangeInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.metadataCacheStalenessInsight = $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.metadataCacheNotUsedButUsedPreviously = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableChangeInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableChangeInsight} TableChangeInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableChangeInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableChangeInsight message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableChangeInsight.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.tableReference, long + 1); + if (error) + return "tableReference." + error; + } + if (message.metadataCacheStalenessInsight != null && Object.hasOwnProperty.call(message, "metadataCacheStalenessInsight")) { + properties._metadataCacheStalenessInsight = 1; + { + var error = $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight.verify(message.metadataCacheStalenessInsight, long + 1); + if (error) + return "metadataCacheStalenessInsight." + error; + } + } + if (message.metadataCacheNotUsedButUsedPreviously != null && Object.hasOwnProperty.call(message, "metadataCacheNotUsedButUsedPreviously")) { + properties._metadataCacheNotUsedButUsedPreviously = 1; + if (typeof message.metadataCacheNotUsedButUsedPreviously !== "boolean") + return "metadataCacheNotUsedButUsedPreviously: boolean expected"; + } + return null; + }; + + /** + * Creates a TableChangeInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableChangeInsight} TableChangeInsight + */ + TableChangeInsight.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableChangeInsight) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableChangeInsight: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableChangeInsight(); + if (object.tableReference != null) { + if (!$util.isObject(object.tableReference)) + throw TypeError(".google.cloud.bigquery.v2.TableChangeInsight.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.tableReference, long + 1); + } + if (object.metadataCacheStalenessInsight != null) { + if (!$util.isObject(object.metadataCacheStalenessInsight)) + throw TypeError(".google.cloud.bigquery.v2.TableChangeInsight.metadataCacheStalenessInsight: object expected"); + message.metadataCacheStalenessInsight = $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight.fromObject(object.metadataCacheStalenessInsight, long + 1); + } + if (object.metadataCacheNotUsedButUsedPreviously != null) + message.metadataCacheNotUsedButUsedPreviously = Boolean(object.metadataCacheNotUsedButUsedPreviously); + return message; + }; + + /** + * Creates a plain object from a TableChangeInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {google.cloud.bigquery.v2.TableChangeInsight} message TableChangeInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableChangeInsight.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.tableReference = null; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + object.tableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.tableReference, options, q + 1); + if (message.metadataCacheStalenessInsight != null && Object.hasOwnProperty.call(message, "metadataCacheStalenessInsight")) { + object.metadataCacheStalenessInsight = $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight.toObject(message.metadataCacheStalenessInsight, options, q + 1); + if (options.oneofs) + object._metadataCacheStalenessInsight = "metadataCacheStalenessInsight"; + } + if (message.metadataCacheNotUsedButUsedPreviously != null && Object.hasOwnProperty.call(message, "metadataCacheNotUsedButUsedPreviously")) { + object.metadataCacheNotUsedButUsedPreviously = message.metadataCacheNotUsedButUsedPreviously; + if (options.oneofs) + object._metadataCacheNotUsedButUsedPreviously = "metadataCacheNotUsedButUsedPreviously"; + } + return object; + }; + + /** + * Converts this TableChangeInsight to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @instance + * @returns {Object.} JSON object + */ + TableChangeInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableChangeInsight + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableChangeInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableChangeInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableChangeInsight"; + }; + + return TableChangeInsight; + })(); + + v2.MetadataCacheStalenessInsight = (function() { + + /** + * Properties of a MetadataCacheStalenessInsight. + * @memberof google.cloud.bigquery.v2 + * @interface IMetadataCacheStalenessInsight + * @property {google.protobuf.IDuration|null} [avgPreviousStalenessMs] MetadataCacheStalenessInsight avgPreviousStalenessMs + * @property {number|null} [stalenessPercentageIncrease] MetadataCacheStalenessInsight stalenessPercentageIncrease + */ + + /** + * Constructs a new MetadataCacheStalenessInsight. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MetadataCacheStalenessInsight. + * @implements IMetadataCacheStalenessInsight + * @constructor + * @param {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight=} [properties] Properties to set + */ + function MetadataCacheStalenessInsight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataCacheStalenessInsight avgPreviousStalenessMs. + * @member {google.protobuf.IDuration|null|undefined} avgPreviousStalenessMs + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @instance + */ + MetadataCacheStalenessInsight.prototype.avgPreviousStalenessMs = null; + + /** + * MetadataCacheStalenessInsight stalenessPercentageIncrease. + * @member {number} stalenessPercentageIncrease + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @instance + */ + MetadataCacheStalenessInsight.prototype.stalenessPercentageIncrease = 0; + + /** + * Creates a new MetadataCacheStalenessInsight instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MetadataCacheStalenessInsight} MetadataCacheStalenessInsight instance + */ + MetadataCacheStalenessInsight.create = function create(properties) { + return new MetadataCacheStalenessInsight(properties); + }; + + /** + * Encodes the specified MetadataCacheStalenessInsight message. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStalenessInsight.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight} message MetadataCacheStalenessInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataCacheStalenessInsight.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.avgPreviousStalenessMs != null && Object.hasOwnProperty.call(message, "avgPreviousStalenessMs")) + $root.google.protobuf.Duration.encode(message.avgPreviousStalenessMs, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.stalenessPercentageIncrease != null && Object.hasOwnProperty.call(message, "stalenessPercentageIncrease")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.stalenessPercentageIncrease); + return writer; + }; + + /** + * Encodes the specified MetadataCacheStalenessInsight message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStalenessInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStalenessInsight} message MetadataCacheStalenessInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataCacheStalenessInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MetadataCacheStalenessInsight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MetadataCacheStalenessInsight} MetadataCacheStalenessInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataCacheStalenessInsight.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.avgPreviousStalenessMs = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.stalenessPercentageIncrease = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataCacheStalenessInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MetadataCacheStalenessInsight} MetadataCacheStalenessInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataCacheStalenessInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataCacheStalenessInsight message. + * @function verify + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataCacheStalenessInsight.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.avgPreviousStalenessMs != null && Object.hasOwnProperty.call(message, "avgPreviousStalenessMs")) { + var error = $root.google.protobuf.Duration.verify(message.avgPreviousStalenessMs, long + 1); + if (error) + return "avgPreviousStalenessMs." + error; + } + if (message.stalenessPercentageIncrease != null && Object.hasOwnProperty.call(message, "stalenessPercentageIncrease")) + if (typeof message.stalenessPercentageIncrease !== "number") + return "stalenessPercentageIncrease: number expected"; + return null; + }; + + /** + * Creates a MetadataCacheStalenessInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MetadataCacheStalenessInsight} MetadataCacheStalenessInsight + */ + MetadataCacheStalenessInsight.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MetadataCacheStalenessInsight: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MetadataCacheStalenessInsight(); + if (object.avgPreviousStalenessMs != null) { + if (!$util.isObject(object.avgPreviousStalenessMs)) + throw TypeError(".google.cloud.bigquery.v2.MetadataCacheStalenessInsight.avgPreviousStalenessMs: object expected"); + message.avgPreviousStalenessMs = $root.google.protobuf.Duration.fromObject(object.avgPreviousStalenessMs, long + 1); + } + if (object.stalenessPercentageIncrease != null) + message.stalenessPercentageIncrease = Number(object.stalenessPercentageIncrease); + return message; + }; + + /** + * Creates a plain object from a MetadataCacheStalenessInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {google.cloud.bigquery.v2.MetadataCacheStalenessInsight} message MetadataCacheStalenessInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataCacheStalenessInsight.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.avgPreviousStalenessMs = null; + object.stalenessPercentageIncrease = 0; + } + if (message.avgPreviousStalenessMs != null && Object.hasOwnProperty.call(message, "avgPreviousStalenessMs")) + object.avgPreviousStalenessMs = $root.google.protobuf.Duration.toObject(message.avgPreviousStalenessMs, options, q + 1); + if (message.stalenessPercentageIncrease != null && Object.hasOwnProperty.call(message, "stalenessPercentageIncrease")) + object.stalenessPercentageIncrease = options.json && !isFinite(message.stalenessPercentageIncrease) ? String(message.stalenessPercentageIncrease) : message.stalenessPercentageIncrease; + return object; + }; + + /** + * Converts this MetadataCacheStalenessInsight to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @instance + * @returns {Object.} JSON object + */ + MetadataCacheStalenessInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataCacheStalenessInsight + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MetadataCacheStalenessInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataCacheStalenessInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MetadataCacheStalenessInsight"; + }; + + return MetadataCacheStalenessInsight; + })(); + + v2.SparkStatistics = (function() { + + /** + * Properties of a SparkStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface ISparkStatistics + * @property {string|null} [sparkJobId] SparkStatistics sparkJobId + * @property {string|null} [sparkJobLocation] SparkStatistics sparkJobLocation + * @property {Object.|null} [endpoints] SparkStatistics endpoints + * @property {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo|null} [loggingInfo] SparkStatistics loggingInfo + * @property {string|null} [kmsKeyName] SparkStatistics kmsKeyName + * @property {string|null} [gcsStagingBucket] SparkStatistics gcsStagingBucket + */ + + /** + * Constructs a new SparkStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SparkStatistics. + * @implements ISparkStatistics + * @constructor + * @param {google.cloud.bigquery.v2.ISparkStatistics=} [properties] Properties to set + */ + function SparkStatistics(properties) { + this.endpoints = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkStatistics sparkJobId. + * @member {string|null|undefined} sparkJobId + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.sparkJobId = null; + + /** + * SparkStatistics sparkJobLocation. + * @member {string|null|undefined} sparkJobLocation + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.sparkJobLocation = null; + + /** + * SparkStatistics endpoints. + * @member {Object.} endpoints + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.endpoints = $util.emptyObject; + + /** + * SparkStatistics loggingInfo. + * @member {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo|null|undefined} loggingInfo + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.loggingInfo = null; + + /** + * SparkStatistics kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.kmsKeyName = null; + + /** + * SparkStatistics gcsStagingBucket. + * @member {string|null|undefined} gcsStagingBucket + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + */ + SparkStatistics.prototype.gcsStagingBucket = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SparkStatistics.prototype, "_sparkJobId", { + get: $util.oneOfGetter($oneOfFields = ["sparkJobId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SparkStatistics.prototype, "_sparkJobLocation", { + get: $util.oneOfGetter($oneOfFields = ["sparkJobLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SparkStatistics.prototype, "_loggingInfo", { + get: $util.oneOfGetter($oneOfFields = ["loggingInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SparkStatistics.prototype, "_kmsKeyName", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SparkStatistics.prototype, "_gcsStagingBucket", { + get: $util.oneOfGetter($oneOfFields = ["gcsStagingBucket"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SparkStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {google.cloud.bigquery.v2.ISparkStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SparkStatistics} SparkStatistics instance + */ + SparkStatistics.create = function create(properties) { + return new SparkStatistics(properties); + }; + + /** + * Encodes the specified SparkStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {google.cloud.bigquery.v2.ISparkStatistics} message SparkStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sparkJobId != null && Object.hasOwnProperty.call(message, "sparkJobId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sparkJobId); + if (message.sparkJobLocation != null && Object.hasOwnProperty.call(message, "sparkJobLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sparkJobLocation); + if (message.endpoints != null && Object.hasOwnProperty.call(message, "endpoints")) + for (var keys = Object.keys(message.endpoints), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.endpoints[keys[i]]).ldelim(); + if (message.loggingInfo != null && Object.hasOwnProperty.call(message, "loggingInfo")) + $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.encode(message.loggingInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName); + if (message.gcsStagingBucket != null && Object.hasOwnProperty.call(message, "gcsStagingBucket")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.gcsStagingBucket); + return writer; + }; + + /** + * Encodes the specified SparkStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {google.cloud.bigquery.v2.ISparkStatistics} message SparkStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SparkStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SparkStatistics} SparkStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SparkStatistics(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sparkJobId = reader.string(); + break; + } + case 2: { + message.sparkJobLocation = reader.string(); + break; + } + case 3: { + if (message.endpoints === $util.emptyObject) + message.endpoints = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.endpoints, key); + message.endpoints[key] = value; + break; + } + case 4: { + message.loggingInfo = $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.kmsKeyName = reader.string(); + break; + } + case 6: { + message.gcsStagingBucket = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SparkStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SparkStatistics} SparkStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.sparkJobId != null && Object.hasOwnProperty.call(message, "sparkJobId")) { + properties._sparkJobId = 1; + if (!$util.isString(message.sparkJobId)) + return "sparkJobId: string expected"; + } + if (message.sparkJobLocation != null && Object.hasOwnProperty.call(message, "sparkJobLocation")) { + properties._sparkJobLocation = 1; + if (!$util.isString(message.sparkJobLocation)) + return "sparkJobLocation: string expected"; + } + if (message.endpoints != null && Object.hasOwnProperty.call(message, "endpoints")) { + if (!$util.isObject(message.endpoints)) + return "endpoints: object expected"; + var key = Object.keys(message.endpoints); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.endpoints[key[i]])) + return "endpoints: string{k:string} expected"; + } + if (message.loggingInfo != null && Object.hasOwnProperty.call(message, "loggingInfo")) { + properties._loggingInfo = 1; + { + var error = $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.verify(message.loggingInfo, long + 1); + if (error) + return "loggingInfo." + error; + } + } + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) { + properties._kmsKeyName = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + } + if (message.gcsStagingBucket != null && Object.hasOwnProperty.call(message, "gcsStagingBucket")) { + properties._gcsStagingBucket = 1; + if (!$util.isString(message.gcsStagingBucket)) + return "gcsStagingBucket: string expected"; + } + return null; + }; + + /** + * Creates a SparkStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SparkStatistics} SparkStatistics + */ + SparkStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SparkStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SparkStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SparkStatistics(); + if (object.sparkJobId != null) + message.sparkJobId = String(object.sparkJobId); + if (object.sparkJobLocation != null) + message.sparkJobLocation = String(object.sparkJobLocation); + if (object.endpoints) { + if (!$util.isObject(object.endpoints)) + throw TypeError(".google.cloud.bigquery.v2.SparkStatistics.endpoints: object expected"); + message.endpoints = {}; + for (var keys = Object.keys(object.endpoints), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.endpoints, keys[i]); + message.endpoints[keys[i]] = String(object.endpoints[keys[i]]); + } + } + if (object.loggingInfo != null) { + if (!$util.isObject(object.loggingInfo)) + throw TypeError(".google.cloud.bigquery.v2.SparkStatistics.loggingInfo: object expected"); + message.loggingInfo = $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.fromObject(object.loggingInfo, long + 1); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.gcsStagingBucket != null) + message.gcsStagingBucket = String(object.gcsStagingBucket); + return message; + }; + + /** + * Creates a plain object from a SparkStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {google.cloud.bigquery.v2.SparkStatistics} message SparkStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.endpoints = {}; + if (message.sparkJobId != null && Object.hasOwnProperty.call(message, "sparkJobId")) { + object.sparkJobId = message.sparkJobId; + if (options.oneofs) + object._sparkJobId = "sparkJobId"; + } + if (message.sparkJobLocation != null && Object.hasOwnProperty.call(message, "sparkJobLocation")) { + object.sparkJobLocation = message.sparkJobLocation; + if (options.oneofs) + object._sparkJobLocation = "sparkJobLocation"; + } + var keys2; + if (message.endpoints && (keys2 = Object.keys(message.endpoints)).length) { + object.endpoints = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.endpoints, keys2[j]); + object.endpoints[keys2[j]] = message.endpoints[keys2[j]]; + } + } + if (message.loggingInfo != null && Object.hasOwnProperty.call(message, "loggingInfo")) { + object.loggingInfo = $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.toObject(message.loggingInfo, options, q + 1); + if (options.oneofs) + object._loggingInfo = "loggingInfo"; + } + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object._kmsKeyName = "kmsKeyName"; + } + if (message.gcsStagingBucket != null && Object.hasOwnProperty.call(message, "gcsStagingBucket")) { + object.gcsStagingBucket = message.gcsStagingBucket; + if (options.oneofs) + object._gcsStagingBucket = "gcsStagingBucket"; + } + return object; + }; + + /** + * Converts this SparkStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @instance + * @returns {Object.} JSON object + */ + SparkStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SparkStatistics"; + }; + + SparkStatistics.LoggingInfo = (function() { + + /** + * Properties of a LoggingInfo. + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @interface ILoggingInfo + * @property {string|null} [resourceType] LoggingInfo resourceType + * @property {string|null} [projectId] LoggingInfo projectId + */ + + /** + * Constructs a new LoggingInfo. + * @memberof google.cloud.bigquery.v2.SparkStatistics + * @classdesc Represents a LoggingInfo. + * @implements ILoggingInfo + * @constructor + * @param {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo=} [properties] Properties to set + */ + function LoggingInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingInfo resourceType. + * @member {string} resourceType + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @instance + */ + LoggingInfo.prototype.resourceType = ""; + + /** + * LoggingInfo projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @instance + */ + LoggingInfo.prototype.projectId = ""; + + /** + * Creates a new LoggingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SparkStatistics.LoggingInfo} LoggingInfo instance + */ + LoggingInfo.create = function create(properties) { + return new LoggingInfo(properties); + }; + + /** + * Encodes the specified LoggingInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo} message LoggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceType); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified LoggingInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkStatistics.LoggingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {google.cloud.bigquery.v2.SparkStatistics.ILoggingInfo} message LoggingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LoggingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SparkStatistics.LoggingInfo} LoggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SparkStatistics.LoggingInfo} LoggingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a LoggingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SparkStatistics.LoggingInfo} LoggingInfo + */ + LoggingInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SparkStatistics.LoggingInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SparkStatistics.LoggingInfo(); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a LoggingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {google.cloud.bigquery.v2.SparkStatistics.LoggingInfo} message LoggingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.resourceType = ""; + object.projectId = ""; + } + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + object.resourceType = message.resourceType; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this LoggingInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @instance + * @returns {Object.} JSON object + */ + LoggingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SparkStatistics.LoggingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SparkStatistics.LoggingInfo"; + }; + + return LoggingInfo; + })(); + + return SparkStatistics; + })(); + + v2.MaterializedViewStatistics = (function() { + + /** + * Properties of a MaterializedViewStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IMaterializedViewStatistics + * @property {Array.|null} [materializedView] MaterializedViewStatistics materializedView + */ + + /** + * Constructs a new MaterializedViewStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MaterializedViewStatistics. + * @implements IMaterializedViewStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IMaterializedViewStatistics=} [properties] Properties to set + */ + function MaterializedViewStatistics(properties) { + this.materializedView = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedViewStatistics materializedView. + * @member {Array.} materializedView + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @instance + */ + MaterializedViewStatistics.prototype.materializedView = $util.emptyArray; + + /** + * Creates a new MaterializedViewStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MaterializedViewStatistics} MaterializedViewStatistics instance + */ + MaterializedViewStatistics.create = function create(properties) { + return new MaterializedViewStatistics(properties); + }; + + /** + * Encodes the specified MaterializedViewStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatistics} message MaterializedViewStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.materializedView != null && message.materializedView.length) + for (var i = 0; i < message.materializedView.length; ++i) + $root.google.cloud.bigquery.v2.MaterializedView.encode(message.materializedView[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaterializedViewStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatistics} message MaterializedViewStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MaterializedViewStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MaterializedViewStatistics} MaterializedViewStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MaterializedViewStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.materializedView && message.materializedView.length)) + message.materializedView = []; + message.materializedView.push($root.google.cloud.bigquery.v2.MaterializedView.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedViewStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MaterializedViewStatistics} MaterializedViewStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedViewStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedViewStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) { + if (!Array.isArray(message.materializedView)) + return "materializedView: array expected"; + for (var i = 0; i < message.materializedView.length; ++i) { + var error = $root.google.cloud.bigquery.v2.MaterializedView.verify(message.materializedView[i], long + 1); + if (error) + return "materializedView." + error; + } + } + return null; + }; + + /** + * Creates a MaterializedViewStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MaterializedViewStatistics} MaterializedViewStatistics + */ + MaterializedViewStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MaterializedViewStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MaterializedViewStatistics(); + if (object.materializedView) { + if (!Array.isArray(object.materializedView)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatistics.materializedView: array expected"); + message.materializedView = []; + for (var i = 0; i < object.materializedView.length; ++i) { + if (!$util.isObject(object.materializedView[i])) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatistics.materializedView: object expected"); + message.materializedView[i] = $root.google.cloud.bigquery.v2.MaterializedView.fromObject(object.materializedView[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MaterializedViewStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {google.cloud.bigquery.v2.MaterializedViewStatistics} message MaterializedViewStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedViewStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.materializedView = []; + if (message.materializedView && message.materializedView.length) { + object.materializedView = []; + for (var j = 0; j < message.materializedView.length; ++j) + object.materializedView[j] = $root.google.cloud.bigquery.v2.MaterializedView.toObject(message.materializedView[j], options, q + 1); + } + return object; + }; + + /** + * Converts this MaterializedViewStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @instance + * @returns {Object.} JSON object + */ + MaterializedViewStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedViewStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MaterializedViewStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedViewStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MaterializedViewStatistics"; + }; + + return MaterializedViewStatistics; + })(); + + v2.MaterializedView = (function() { + + /** + * Properties of a MaterializedView. + * @memberof google.cloud.bigquery.v2 + * @interface IMaterializedView + * @property {google.cloud.bigquery.v2.ITableReference|null} [tableReference] MaterializedView tableReference + * @property {boolean|null} [chosen] MaterializedView chosen + * @property {number|Long|null} [estimatedBytesSaved] MaterializedView estimatedBytesSaved + * @property {google.cloud.bigquery.v2.MaterializedView.RejectedReason|null} [rejectedReason] MaterializedView rejectedReason + */ + + /** + * Constructs a new MaterializedView. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MaterializedView. + * @implements IMaterializedView + * @constructor + * @param {google.cloud.bigquery.v2.IMaterializedView=} [properties] Properties to set + */ + function MaterializedView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedView tableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.tableReference = null; + + /** + * MaterializedView chosen. + * @member {boolean|null|undefined} chosen + * @memberof google.cloud.bigquery.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.chosen = null; + + /** + * MaterializedView estimatedBytesSaved. + * @member {number|Long|null|undefined} estimatedBytesSaved + * @memberof google.cloud.bigquery.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.estimatedBytesSaved = null; + + /** + * MaterializedView rejectedReason. + * @member {google.cloud.bigquery.v2.MaterializedView.RejectedReason|null|undefined} rejectedReason + * @memberof google.cloud.bigquery.v2.MaterializedView + * @instance + */ + MaterializedView.prototype.rejectedReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MaterializedView.prototype, "_tableReference", { + get: $util.oneOfGetter($oneOfFields = ["tableReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MaterializedView.prototype, "_chosen", { + get: $util.oneOfGetter($oneOfFields = ["chosen"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MaterializedView.prototype, "_estimatedBytesSaved", { + get: $util.oneOfGetter($oneOfFields = ["estimatedBytesSaved"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(MaterializedView.prototype, "_rejectedReason", { + get: $util.oneOfGetter($oneOfFields = ["rejectedReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MaterializedView instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {google.cloud.bigquery.v2.IMaterializedView=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MaterializedView} MaterializedView instance + */ + MaterializedView.create = function create(properties) { + return new MaterializedView(properties); + }; + + /** + * Encodes the specified MaterializedView message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedView.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {google.cloud.bigquery.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.chosen != null && Object.hasOwnProperty.call(message, "chosen")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.chosen); + if (message.estimatedBytesSaved != null && Object.hasOwnProperty.call(message, "estimatedBytesSaved")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.estimatedBytesSaved); + if (message.rejectedReason != null && Object.hasOwnProperty.call(message, "rejectedReason")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rejectedReason); + return writer; + }; + + /** + * Encodes the specified MaterializedView message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {google.cloud.bigquery.v2.IMaterializedView} message MaterializedView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MaterializedView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.chosen = reader.bool(); + break; + } + case 3: { + message.estimatedBytesSaved = reader.int64(); + break; + } + case 4: { + message.rejectedReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MaterializedView} MaterializedView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedView message. + * @function verify + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedView.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + properties._tableReference = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.tableReference, long + 1); + if (error) + return "tableReference." + error; + } + } + if (message.chosen != null && Object.hasOwnProperty.call(message, "chosen")) { + properties._chosen = 1; + if (typeof message.chosen !== "boolean") + return "chosen: boolean expected"; + } + if (message.estimatedBytesSaved != null && Object.hasOwnProperty.call(message, "estimatedBytesSaved")) { + properties._estimatedBytesSaved = 1; + if (!$util.isInteger(message.estimatedBytesSaved) && !(message.estimatedBytesSaved && $util.isInteger(message.estimatedBytesSaved.low) && $util.isInteger(message.estimatedBytesSaved.high))) + return "estimatedBytesSaved: integer|Long expected"; + } + if (message.rejectedReason != null && Object.hasOwnProperty.call(message, "rejectedReason")) { + properties._rejectedReason = 1; + switch (message.rejectedReason) { + default: + return "rejectedReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + } + return null; + }; + + /** + * Creates a MaterializedView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MaterializedView} MaterializedView + */ + MaterializedView.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MaterializedView) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedView: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MaterializedView(); + if (object.tableReference != null) { + if (!$util.isObject(object.tableReference)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedView.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.tableReference, long + 1); + } + if (object.chosen != null) + message.chosen = Boolean(object.chosen); + if (object.estimatedBytesSaved != null) + if ($util.Long) + message.estimatedBytesSaved = $util.Long.fromValue(object.estimatedBytesSaved, false); + else if (typeof object.estimatedBytesSaved === "string") + message.estimatedBytesSaved = parseInt(object.estimatedBytesSaved, 10); + else if (typeof object.estimatedBytesSaved === "number") + message.estimatedBytesSaved = object.estimatedBytesSaved; + else if (typeof object.estimatedBytesSaved === "object") + message.estimatedBytesSaved = new $util.LongBits(object.estimatedBytesSaved.low >>> 0, object.estimatedBytesSaved.high >>> 0).toNumber(); + switch (object.rejectedReason) { + default: + if (typeof object.rejectedReason === "number") { + message.rejectedReason = object.rejectedReason; + break; + } + break; + case "REJECTED_REASON_UNSPECIFIED": + case 0: + message.rejectedReason = 0; + break; + case "NO_DATA": + case 1: + message.rejectedReason = 1; + break; + case "COST": + case 2: + message.rejectedReason = 2; + break; + case "BASE_TABLE_TRUNCATED": + case 3: + message.rejectedReason = 3; + break; + case "BASE_TABLE_DATA_CHANGE": + case 4: + message.rejectedReason = 4; + break; + case "BASE_TABLE_PARTITION_EXPIRATION_CHANGE": + case 5: + message.rejectedReason = 5; + break; + case "BASE_TABLE_EXPIRED_PARTITION": + case 6: + message.rejectedReason = 6; + break; + case "BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE": + case 7: + message.rejectedReason = 7; + break; + case "TIME_ZONE": + case 8: + message.rejectedReason = 8; + break; + case "OUT_OF_TIME_TRAVEL_WINDOW": + case 9: + message.rejectedReason = 9; + break; + case "BASE_TABLE_FINE_GRAINED_SECURITY_POLICY": + case 10: + message.rejectedReason = 10; + break; + case "BASE_TABLE_TOO_STALE": + case 11: + message.rejectedReason = 11; + break; + } + return message; + }; + + /** + * Creates a plain object from a MaterializedView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {google.cloud.bigquery.v2.MaterializedView} message MaterializedView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedView.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + object.tableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.tableReference, options, q + 1); + if (options.oneofs) + object._tableReference = "tableReference"; + } + if (message.chosen != null && Object.hasOwnProperty.call(message, "chosen")) { + object.chosen = message.chosen; + if (options.oneofs) + object._chosen = "chosen"; + } + if (message.estimatedBytesSaved != null && Object.hasOwnProperty.call(message, "estimatedBytesSaved")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.estimatedBytesSaved = typeof message.estimatedBytesSaved === "number" ? BigInt(message.estimatedBytesSaved) : $util.Long.fromBits(message.estimatedBytesSaved.low >>> 0, message.estimatedBytesSaved.high >>> 0, false).toBigInt(); + else if (typeof message.estimatedBytesSaved === "number") + object.estimatedBytesSaved = options.longs === String ? String(message.estimatedBytesSaved) : message.estimatedBytesSaved; + else + object.estimatedBytesSaved = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedBytesSaved) : options.longs === Number ? new $util.LongBits(message.estimatedBytesSaved.low >>> 0, message.estimatedBytesSaved.high >>> 0).toNumber() : message.estimatedBytesSaved; + if (options.oneofs) + object._estimatedBytesSaved = "estimatedBytesSaved"; + } + if (message.rejectedReason != null && Object.hasOwnProperty.call(message, "rejectedReason")) { + object.rejectedReason = options.enums === String ? $root.google.cloud.bigquery.v2.MaterializedView.RejectedReason[message.rejectedReason] === undefined ? message.rejectedReason : $root.google.cloud.bigquery.v2.MaterializedView.RejectedReason[message.rejectedReason] : message.rejectedReason; + if (options.oneofs) + object._rejectedReason = "rejectedReason"; + } + return object; + }; + + /** + * Converts this MaterializedView to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MaterializedView + * @instance + * @returns {Object.} JSON object + */ + MaterializedView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedView + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MaterializedView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MaterializedView"; + }; + + /** + * RejectedReason enum. + * @name google.cloud.bigquery.v2.MaterializedView.RejectedReason + * @enum {number} + * @property {number} REJECTED_REASON_UNSPECIFIED=0 REJECTED_REASON_UNSPECIFIED value + * @property {number} NO_DATA=1 NO_DATA value + * @property {number} COST=2 COST value + * @property {number} BASE_TABLE_TRUNCATED=3 BASE_TABLE_TRUNCATED value + * @property {number} BASE_TABLE_DATA_CHANGE=4 BASE_TABLE_DATA_CHANGE value + * @property {number} BASE_TABLE_PARTITION_EXPIRATION_CHANGE=5 BASE_TABLE_PARTITION_EXPIRATION_CHANGE value + * @property {number} BASE_TABLE_EXPIRED_PARTITION=6 BASE_TABLE_EXPIRED_PARTITION value + * @property {number} BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE=7 BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE value + * @property {number} TIME_ZONE=8 TIME_ZONE value + * @property {number} OUT_OF_TIME_TRAVEL_WINDOW=9 OUT_OF_TIME_TRAVEL_WINDOW value + * @property {number} BASE_TABLE_FINE_GRAINED_SECURITY_POLICY=10 BASE_TABLE_FINE_GRAINED_SECURITY_POLICY value + * @property {number} BASE_TABLE_TOO_STALE=11 BASE_TABLE_TOO_STALE value + */ + MaterializedView.RejectedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REJECTED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_DATA"] = 1; + values[valuesById[2] = "COST"] = 2; + values[valuesById[3] = "BASE_TABLE_TRUNCATED"] = 3; + values[valuesById[4] = "BASE_TABLE_DATA_CHANGE"] = 4; + values[valuesById[5] = "BASE_TABLE_PARTITION_EXPIRATION_CHANGE"] = 5; + values[valuesById[6] = "BASE_TABLE_EXPIRED_PARTITION"] = 6; + values[valuesById[7] = "BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE"] = 7; + values[valuesById[8] = "TIME_ZONE"] = 8; + values[valuesById[9] = "OUT_OF_TIME_TRAVEL_WINDOW"] = 9; + values[valuesById[10] = "BASE_TABLE_FINE_GRAINED_SECURITY_POLICY"] = 10; + values[valuesById[11] = "BASE_TABLE_TOO_STALE"] = 11; + return values; + })(); + + return MaterializedView; + })(); + + v2.PruningStats = (function() { + + /** + * Properties of a PruningStats. + * @memberof google.cloud.bigquery.v2 + * @interface IPruningStats + * @property {number|Long|null} [postCmetaPruningPartitionCount] PruningStats postCmetaPruningPartitionCount + * @property {number|Long|null} [preCmetaPruningParallelInputCount] PruningStats preCmetaPruningParallelInputCount + * @property {number|Long|null} [postCmetaPruningParallelInputCount] PruningStats postCmetaPruningParallelInputCount + */ + + /** + * Constructs a new PruningStats. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PruningStats. + * @implements IPruningStats + * @constructor + * @param {google.cloud.bigquery.v2.IPruningStats=} [properties] Properties to set + */ + function PruningStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PruningStats postCmetaPruningPartitionCount. + * @member {number|Long|null|undefined} postCmetaPruningPartitionCount + * @memberof google.cloud.bigquery.v2.PruningStats + * @instance + */ + PruningStats.prototype.postCmetaPruningPartitionCount = null; + + /** + * PruningStats preCmetaPruningParallelInputCount. + * @member {number|Long|null|undefined} preCmetaPruningParallelInputCount + * @memberof google.cloud.bigquery.v2.PruningStats + * @instance + */ + PruningStats.prototype.preCmetaPruningParallelInputCount = null; + + /** + * PruningStats postCmetaPruningParallelInputCount. + * @member {number|Long|null|undefined} postCmetaPruningParallelInputCount + * @memberof google.cloud.bigquery.v2.PruningStats + * @instance + */ + PruningStats.prototype.postCmetaPruningParallelInputCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PruningStats.prototype, "_postCmetaPruningPartitionCount", { + get: $util.oneOfGetter($oneOfFields = ["postCmetaPruningPartitionCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PruningStats.prototype, "_preCmetaPruningParallelInputCount", { + get: $util.oneOfGetter($oneOfFields = ["preCmetaPruningParallelInputCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PruningStats.prototype, "_postCmetaPruningParallelInputCount", { + get: $util.oneOfGetter($oneOfFields = ["postCmetaPruningParallelInputCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PruningStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {google.cloud.bigquery.v2.IPruningStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PruningStats} PruningStats instance + */ + PruningStats.create = function create(properties) { + return new PruningStats(properties); + }; + + /** + * Encodes the specified PruningStats message. Does not implicitly {@link google.cloud.bigquery.v2.PruningStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {google.cloud.bigquery.v2.IPruningStats} message PruningStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PruningStats.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.postCmetaPruningPartitionCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningPartitionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.postCmetaPruningPartitionCount); + if (message.preCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preCmetaPruningParallelInputCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.preCmetaPruningParallelInputCount); + if (message.postCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningParallelInputCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.postCmetaPruningParallelInputCount); + return writer; + }; + + /** + * Encodes the specified PruningStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PruningStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {google.cloud.bigquery.v2.IPruningStats} message PruningStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PruningStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PruningStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PruningStats} PruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PruningStats.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PruningStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.postCmetaPruningPartitionCount = reader.int64(); + break; + } + case 2: { + message.preCmetaPruningParallelInputCount = reader.int64(); + break; + } + case 3: { + message.postCmetaPruningParallelInputCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PruningStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PruningStats} PruningStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PruningStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PruningStats message. + * @function verify + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PruningStats.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.postCmetaPruningPartitionCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningPartitionCount")) { + properties._postCmetaPruningPartitionCount = 1; + if (!$util.isInteger(message.postCmetaPruningPartitionCount) && !(message.postCmetaPruningPartitionCount && $util.isInteger(message.postCmetaPruningPartitionCount.low) && $util.isInteger(message.postCmetaPruningPartitionCount.high))) + return "postCmetaPruningPartitionCount: integer|Long expected"; + } + if (message.preCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preCmetaPruningParallelInputCount")) { + properties._preCmetaPruningParallelInputCount = 1; + if (!$util.isInteger(message.preCmetaPruningParallelInputCount) && !(message.preCmetaPruningParallelInputCount && $util.isInteger(message.preCmetaPruningParallelInputCount.low) && $util.isInteger(message.preCmetaPruningParallelInputCount.high))) + return "preCmetaPruningParallelInputCount: integer|Long expected"; + } + if (message.postCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningParallelInputCount")) { + properties._postCmetaPruningParallelInputCount = 1; + if (!$util.isInteger(message.postCmetaPruningParallelInputCount) && !(message.postCmetaPruningParallelInputCount && $util.isInteger(message.postCmetaPruningParallelInputCount.low) && $util.isInteger(message.postCmetaPruningParallelInputCount.high))) + return "postCmetaPruningParallelInputCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a PruningStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PruningStats} PruningStats + */ + PruningStats.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PruningStats) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PruningStats: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PruningStats(); + if (object.postCmetaPruningPartitionCount != null) + if ($util.Long) + message.postCmetaPruningPartitionCount = $util.Long.fromValue(object.postCmetaPruningPartitionCount, false); + else if (typeof object.postCmetaPruningPartitionCount === "string") + message.postCmetaPruningPartitionCount = parseInt(object.postCmetaPruningPartitionCount, 10); + else if (typeof object.postCmetaPruningPartitionCount === "number") + message.postCmetaPruningPartitionCount = object.postCmetaPruningPartitionCount; + else if (typeof object.postCmetaPruningPartitionCount === "object") + message.postCmetaPruningPartitionCount = new $util.LongBits(object.postCmetaPruningPartitionCount.low >>> 0, object.postCmetaPruningPartitionCount.high >>> 0).toNumber(); + if (object.preCmetaPruningParallelInputCount != null) + if ($util.Long) + message.preCmetaPruningParallelInputCount = $util.Long.fromValue(object.preCmetaPruningParallelInputCount, false); + else if (typeof object.preCmetaPruningParallelInputCount === "string") + message.preCmetaPruningParallelInputCount = parseInt(object.preCmetaPruningParallelInputCount, 10); + else if (typeof object.preCmetaPruningParallelInputCount === "number") + message.preCmetaPruningParallelInputCount = object.preCmetaPruningParallelInputCount; + else if (typeof object.preCmetaPruningParallelInputCount === "object") + message.preCmetaPruningParallelInputCount = new $util.LongBits(object.preCmetaPruningParallelInputCount.low >>> 0, object.preCmetaPruningParallelInputCount.high >>> 0).toNumber(); + if (object.postCmetaPruningParallelInputCount != null) + if ($util.Long) + message.postCmetaPruningParallelInputCount = $util.Long.fromValue(object.postCmetaPruningParallelInputCount, false); + else if (typeof object.postCmetaPruningParallelInputCount === "string") + message.postCmetaPruningParallelInputCount = parseInt(object.postCmetaPruningParallelInputCount, 10); + else if (typeof object.postCmetaPruningParallelInputCount === "number") + message.postCmetaPruningParallelInputCount = object.postCmetaPruningParallelInputCount; + else if (typeof object.postCmetaPruningParallelInputCount === "object") + message.postCmetaPruningParallelInputCount = new $util.LongBits(object.postCmetaPruningParallelInputCount.low >>> 0, object.postCmetaPruningParallelInputCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PruningStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {google.cloud.bigquery.v2.PruningStats} message PruningStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PruningStats.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.postCmetaPruningPartitionCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningPartitionCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.postCmetaPruningPartitionCount = typeof message.postCmetaPruningPartitionCount === "number" ? BigInt(message.postCmetaPruningPartitionCount) : $util.Long.fromBits(message.postCmetaPruningPartitionCount.low >>> 0, message.postCmetaPruningPartitionCount.high >>> 0, false).toBigInt(); + else if (typeof message.postCmetaPruningPartitionCount === "number") + object.postCmetaPruningPartitionCount = options.longs === String ? String(message.postCmetaPruningPartitionCount) : message.postCmetaPruningPartitionCount; + else + object.postCmetaPruningPartitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.postCmetaPruningPartitionCount) : options.longs === Number ? new $util.LongBits(message.postCmetaPruningPartitionCount.low >>> 0, message.postCmetaPruningPartitionCount.high >>> 0).toNumber() : message.postCmetaPruningPartitionCount; + if (options.oneofs) + object._postCmetaPruningPartitionCount = "postCmetaPruningPartitionCount"; + } + if (message.preCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "preCmetaPruningParallelInputCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.preCmetaPruningParallelInputCount = typeof message.preCmetaPruningParallelInputCount === "number" ? BigInt(message.preCmetaPruningParallelInputCount) : $util.Long.fromBits(message.preCmetaPruningParallelInputCount.low >>> 0, message.preCmetaPruningParallelInputCount.high >>> 0, false).toBigInt(); + else if (typeof message.preCmetaPruningParallelInputCount === "number") + object.preCmetaPruningParallelInputCount = options.longs === String ? String(message.preCmetaPruningParallelInputCount) : message.preCmetaPruningParallelInputCount; + else + object.preCmetaPruningParallelInputCount = options.longs === String ? $util.Long.prototype.toString.call(message.preCmetaPruningParallelInputCount) : options.longs === Number ? new $util.LongBits(message.preCmetaPruningParallelInputCount.low >>> 0, message.preCmetaPruningParallelInputCount.high >>> 0).toNumber() : message.preCmetaPruningParallelInputCount; + if (options.oneofs) + object._preCmetaPruningParallelInputCount = "preCmetaPruningParallelInputCount"; + } + if (message.postCmetaPruningParallelInputCount != null && Object.hasOwnProperty.call(message, "postCmetaPruningParallelInputCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.postCmetaPruningParallelInputCount = typeof message.postCmetaPruningParallelInputCount === "number" ? BigInt(message.postCmetaPruningParallelInputCount) : $util.Long.fromBits(message.postCmetaPruningParallelInputCount.low >>> 0, message.postCmetaPruningParallelInputCount.high >>> 0, false).toBigInt(); + else if (typeof message.postCmetaPruningParallelInputCount === "number") + object.postCmetaPruningParallelInputCount = options.longs === String ? String(message.postCmetaPruningParallelInputCount) : message.postCmetaPruningParallelInputCount; + else + object.postCmetaPruningParallelInputCount = options.longs === String ? $util.Long.prototype.toString.call(message.postCmetaPruningParallelInputCount) : options.longs === Number ? new $util.LongBits(message.postCmetaPruningParallelInputCount.low >>> 0, message.postCmetaPruningParallelInputCount.high >>> 0).toNumber() : message.postCmetaPruningParallelInputCount; + if (options.oneofs) + object._postCmetaPruningParallelInputCount = "postCmetaPruningParallelInputCount"; + } + return object; + }; + + /** + * Converts this PruningStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PruningStats + * @instance + * @returns {Object.} JSON object + */ + PruningStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PruningStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PruningStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PruningStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PruningStats"; + }; + + return PruningStats; + })(); + + v2.TableMetadataCacheUsage = (function() { + + /** + * Properties of a TableMetadataCacheUsage. + * @memberof google.cloud.bigquery.v2 + * @interface ITableMetadataCacheUsage + * @property {google.cloud.bigquery.v2.ITableReference|null} [tableReference] TableMetadataCacheUsage tableReference + * @property {google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|null} [unusedReason] TableMetadataCacheUsage unusedReason + * @property {string|null} [explanation] TableMetadataCacheUsage explanation + * @property {google.protobuf.IDuration|null} [staleness] TableMetadataCacheUsage staleness + * @property {string|null} [tableType] TableMetadataCacheUsage tableType + * @property {google.cloud.bigquery.v2.IPruningStats|null} [pruningStats] TableMetadataCacheUsage pruningStats + */ + + /** + * Constructs a new TableMetadataCacheUsage. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableMetadataCacheUsage. + * @implements ITableMetadataCacheUsage + * @constructor + * @param {google.cloud.bigquery.v2.ITableMetadataCacheUsage=} [properties] Properties to set + */ + function TableMetadataCacheUsage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableMetadataCacheUsage tableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.tableReference = null; + + /** + * TableMetadataCacheUsage unusedReason. + * @member {google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason|null|undefined} unusedReason + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.unusedReason = null; + + /** + * TableMetadataCacheUsage explanation. + * @member {string|null|undefined} explanation + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.explanation = null; + + /** + * TableMetadataCacheUsage staleness. + * @member {google.protobuf.IDuration|null|undefined} staleness + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.staleness = null; + + /** + * TableMetadataCacheUsage tableType. + * @member {string} tableType + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.tableType = ""; + + /** + * TableMetadataCacheUsage pruningStats. + * @member {google.cloud.bigquery.v2.IPruningStats|null|undefined} pruningStats + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + */ + TableMetadataCacheUsage.prototype.pruningStats = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableMetadataCacheUsage.prototype, "_tableReference", { + get: $util.oneOfGetter($oneOfFields = ["tableReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableMetadataCacheUsage.prototype, "_unusedReason", { + get: $util.oneOfGetter($oneOfFields = ["unusedReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableMetadataCacheUsage.prototype, "_explanation", { + get: $util.oneOfGetter($oneOfFields = ["explanation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TableMetadataCacheUsage.prototype, "_pruningStats", { + get: $util.oneOfGetter($oneOfFields = ["pruningStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TableMetadataCacheUsage instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {google.cloud.bigquery.v2.ITableMetadataCacheUsage=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableMetadataCacheUsage} TableMetadataCacheUsage instance + */ + TableMetadataCacheUsage.create = function create(properties) { + return new TableMetadataCacheUsage(properties); + }; + + /** + * Encodes the specified TableMetadataCacheUsage message. Does not implicitly {@link google.cloud.bigquery.v2.TableMetadataCacheUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {google.cloud.bigquery.v2.ITableMetadataCacheUsage} message TableMetadataCacheUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableMetadataCacheUsage.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.unusedReason != null && Object.hasOwnProperty.call(message, "unusedReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unusedReason); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.explanation); + if (message.staleness != null && Object.hasOwnProperty.call(message, "staleness")) + $root.google.protobuf.Duration.encode(message.staleness, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.tableType != null && Object.hasOwnProperty.call(message, "tableType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.tableType); + if (message.pruningStats != null && Object.hasOwnProperty.call(message, "pruningStats")) + $root.google.cloud.bigquery.v2.PruningStats.encode(message.pruningStats, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableMetadataCacheUsage message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableMetadataCacheUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {google.cloud.bigquery.v2.ITableMetadataCacheUsage} message TableMetadataCacheUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableMetadataCacheUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableMetadataCacheUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableMetadataCacheUsage} TableMetadataCacheUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableMetadataCacheUsage.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableMetadataCacheUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.unusedReason = reader.int32(); + break; + } + case 3: { + message.explanation = reader.string(); + break; + } + case 5: { + message.staleness = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.tableType = reader.string(); + break; + } + case 7: { + message.pruningStats = $root.google.cloud.bigquery.v2.PruningStats.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableMetadataCacheUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableMetadataCacheUsage} TableMetadataCacheUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableMetadataCacheUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableMetadataCacheUsage message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableMetadataCacheUsage.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + properties._tableReference = 1; + { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.tableReference, long + 1); + if (error) + return "tableReference." + error; + } + } + if (message.unusedReason != null && Object.hasOwnProperty.call(message, "unusedReason")) { + properties._unusedReason = 1; + switch (message.unusedReason) { + default: + return "unusedReason: enum value expected"; + case 0: + case 1: + case 3: + case 2: + break; + } + } + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) { + properties._explanation = 1; + if (!$util.isString(message.explanation)) + return "explanation: string expected"; + } + if (message.staleness != null && Object.hasOwnProperty.call(message, "staleness")) { + var error = $root.google.protobuf.Duration.verify(message.staleness, long + 1); + if (error) + return "staleness." + error; + } + if (message.tableType != null && Object.hasOwnProperty.call(message, "tableType")) + if (!$util.isString(message.tableType)) + return "tableType: string expected"; + if (message.pruningStats != null && Object.hasOwnProperty.call(message, "pruningStats")) { + properties._pruningStats = 1; + { + var error = $root.google.cloud.bigquery.v2.PruningStats.verify(message.pruningStats, long + 1); + if (error) + return "pruningStats." + error; + } + } + return null; + }; + + /** + * Creates a TableMetadataCacheUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableMetadataCacheUsage} TableMetadataCacheUsage + */ + TableMetadataCacheUsage.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableMetadataCacheUsage) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableMetadataCacheUsage: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableMetadataCacheUsage(); + if (object.tableReference != null) { + if (!$util.isObject(object.tableReference)) + throw TypeError(".google.cloud.bigquery.v2.TableMetadataCacheUsage.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.tableReference, long + 1); + } + switch (object.unusedReason) { + default: + if (typeof object.unusedReason === "number") { + message.unusedReason = object.unusedReason; + break; + } + break; + case "UNUSED_REASON_UNSPECIFIED": + case 0: + message.unusedReason = 0; + break; + case "EXCEEDED_MAX_STALENESS": + case 1: + message.unusedReason = 1; + break; + case "METADATA_CACHING_NOT_ENABLED": + case 3: + message.unusedReason = 3; + break; + case "OTHER_REASON": + case 2: + message.unusedReason = 2; + break; + } + if (object.explanation != null) + message.explanation = String(object.explanation); + if (object.staleness != null) { + if (!$util.isObject(object.staleness)) + throw TypeError(".google.cloud.bigquery.v2.TableMetadataCacheUsage.staleness: object expected"); + message.staleness = $root.google.protobuf.Duration.fromObject(object.staleness, long + 1); + } + if (object.tableType != null) + message.tableType = String(object.tableType); + if (object.pruningStats != null) { + if (!$util.isObject(object.pruningStats)) + throw TypeError(".google.cloud.bigquery.v2.TableMetadataCacheUsage.pruningStats: object expected"); + message.pruningStats = $root.google.cloud.bigquery.v2.PruningStats.fromObject(object.pruningStats, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TableMetadataCacheUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {google.cloud.bigquery.v2.TableMetadataCacheUsage} message TableMetadataCacheUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableMetadataCacheUsage.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.staleness = null; + object.tableType = ""; + } + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + object.tableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.tableReference, options, q + 1); + if (options.oneofs) + object._tableReference = "tableReference"; + } + if (message.unusedReason != null && Object.hasOwnProperty.call(message, "unusedReason")) { + object.unusedReason = options.enums === String ? $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason[message.unusedReason] === undefined ? message.unusedReason : $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason[message.unusedReason] : message.unusedReason; + if (options.oneofs) + object._unusedReason = "unusedReason"; + } + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) { + object.explanation = message.explanation; + if (options.oneofs) + object._explanation = "explanation"; + } + if (message.staleness != null && Object.hasOwnProperty.call(message, "staleness")) + object.staleness = $root.google.protobuf.Duration.toObject(message.staleness, options, q + 1); + if (message.tableType != null && Object.hasOwnProperty.call(message, "tableType")) + object.tableType = message.tableType; + if (message.pruningStats != null && Object.hasOwnProperty.call(message, "pruningStats")) { + object.pruningStats = $root.google.cloud.bigquery.v2.PruningStats.toObject(message.pruningStats, options, q + 1); + if (options.oneofs) + object._pruningStats = "pruningStats"; + } + return object; + }; + + /** + * Converts this TableMetadataCacheUsage to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @instance + * @returns {Object.} JSON object + */ + TableMetadataCacheUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableMetadataCacheUsage + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableMetadataCacheUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableMetadataCacheUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableMetadataCacheUsage"; + }; + + /** + * UnusedReason enum. + * @name google.cloud.bigquery.v2.TableMetadataCacheUsage.UnusedReason + * @enum {number} + * @property {number} UNUSED_REASON_UNSPECIFIED=0 UNUSED_REASON_UNSPECIFIED value + * @property {number} EXCEEDED_MAX_STALENESS=1 EXCEEDED_MAX_STALENESS value + * @property {number} METADATA_CACHING_NOT_ENABLED=3 METADATA_CACHING_NOT_ENABLED value + * @property {number} OTHER_REASON=2 OTHER_REASON value + */ + TableMetadataCacheUsage.UnusedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNUSED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXCEEDED_MAX_STALENESS"] = 1; + values[valuesById[3] = "METADATA_CACHING_NOT_ENABLED"] = 3; + values[valuesById[2] = "OTHER_REASON"] = 2; + return values; + })(); + + return TableMetadataCacheUsage; + })(); + + v2.MetadataCacheStatistics = (function() { + + /** + * Properties of a MetadataCacheStatistics. + * @memberof google.cloud.bigquery.v2 + * @interface IMetadataCacheStatistics + * @property {Array.|null} [tableMetadataCacheUsage] MetadataCacheStatistics tableMetadataCacheUsage + */ + + /** + * Constructs a new MetadataCacheStatistics. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MetadataCacheStatistics. + * @implements IMetadataCacheStatistics + * @constructor + * @param {google.cloud.bigquery.v2.IMetadataCacheStatistics=} [properties] Properties to set + */ + function MetadataCacheStatistics(properties) { + this.tableMetadataCacheUsage = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataCacheStatistics tableMetadataCacheUsage. + * @member {Array.} tableMetadataCacheUsage + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @instance + */ + MetadataCacheStatistics.prototype.tableMetadataCacheUsage = $util.emptyArray; + + /** + * Creates a new MetadataCacheStatistics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStatistics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MetadataCacheStatistics} MetadataCacheStatistics instance + */ + MetadataCacheStatistics.create = function create(properties) { + return new MetadataCacheStatistics(properties); + }; + + /** + * Encodes the specified MetadataCacheStatistics message. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStatistics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStatistics} message MetadataCacheStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataCacheStatistics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.tableMetadataCacheUsage != null && message.tableMetadataCacheUsage.length) + for (var i = 0; i < message.tableMetadataCacheUsage.length; ++i) + $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.encode(message.tableMetadataCacheUsage[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataCacheStatistics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MetadataCacheStatistics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {google.cloud.bigquery.v2.IMetadataCacheStatistics} message MetadataCacheStatistics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataCacheStatistics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MetadataCacheStatistics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MetadataCacheStatistics} MetadataCacheStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataCacheStatistics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MetadataCacheStatistics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tableMetadataCacheUsage && message.tableMetadataCacheUsage.length)) + message.tableMetadataCacheUsage = []; + message.tableMetadataCacheUsage.push($root.google.cloud.bigquery.v2.TableMetadataCacheUsage.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataCacheStatistics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MetadataCacheStatistics} MetadataCacheStatistics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataCacheStatistics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataCacheStatistics message. + * @function verify + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataCacheStatistics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.tableMetadataCacheUsage != null && Object.hasOwnProperty.call(message, "tableMetadataCacheUsage")) { + if (!Array.isArray(message.tableMetadataCacheUsage)) + return "tableMetadataCacheUsage: array expected"; + for (var i = 0; i < message.tableMetadataCacheUsage.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.verify(message.tableMetadataCacheUsage[i], long + 1); + if (error) + return "tableMetadataCacheUsage." + error; + } + } + return null; + }; + + /** + * Creates a MetadataCacheStatistics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MetadataCacheStatistics} MetadataCacheStatistics + */ + MetadataCacheStatistics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MetadataCacheStatistics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MetadataCacheStatistics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MetadataCacheStatistics(); + if (object.tableMetadataCacheUsage) { + if (!Array.isArray(object.tableMetadataCacheUsage)) + throw TypeError(".google.cloud.bigquery.v2.MetadataCacheStatistics.tableMetadataCacheUsage: array expected"); + message.tableMetadataCacheUsage = []; + for (var i = 0; i < object.tableMetadataCacheUsage.length; ++i) { + if (!$util.isObject(object.tableMetadataCacheUsage[i])) + throw TypeError(".google.cloud.bigquery.v2.MetadataCacheStatistics.tableMetadataCacheUsage: object expected"); + message.tableMetadataCacheUsage[i] = $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.fromObject(object.tableMetadataCacheUsage[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MetadataCacheStatistics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {google.cloud.bigquery.v2.MetadataCacheStatistics} message MetadataCacheStatistics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataCacheStatistics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.tableMetadataCacheUsage = []; + if (message.tableMetadataCacheUsage && message.tableMetadataCacheUsage.length) { + object.tableMetadataCacheUsage = []; + for (var j = 0; j < message.tableMetadataCacheUsage.length; ++j) + object.tableMetadataCacheUsage[j] = $root.google.cloud.bigquery.v2.TableMetadataCacheUsage.toObject(message.tableMetadataCacheUsage[j], options, q + 1); + } + return object; + }; + + /** + * Converts this MetadataCacheStatistics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @instance + * @returns {Object.} JSON object + */ + MetadataCacheStatistics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataCacheStatistics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MetadataCacheStatistics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataCacheStatistics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MetadataCacheStatistics"; + }; + + return MetadataCacheStatistics; + })(); + + /** + * ReservationEdition enum. + * @name google.cloud.bigquery.v2.ReservationEdition + * @enum {number} + * @property {number} RESERVATION_EDITION_UNSPECIFIED=0 RESERVATION_EDITION_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} ENTERPRISE=2 ENTERPRISE value + * @property {number} ENTERPRISE_PLUS=3 ENTERPRISE_PLUS value + */ + v2.ReservationEdition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESERVATION_EDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "ENTERPRISE"] = 2; + values[valuesById[3] = "ENTERPRISE_PLUS"] = 3; + return values; + })(); + + v2.ModelService = (function() { + + /** + * Constructs a new ModelService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ModelService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ModelService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService; + + /** + * Creates new ModelService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.ModelService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ModelService} RPC service. Useful where requests and/or responses are streamed. + */ + ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|getModel}. + * @memberof google.cloud.bigquery.v2.ModelService + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.bigquery.v2.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getModel, $root.google.cloud.bigquery.v2.GetModelRequest, $root.google.cloud.bigquery.v2.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|listModels}. + * @memberof google.cloud.bigquery.v2.ModelService + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.bigquery.v2.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listModels, $root.google.cloud.bigquery.v2.ListModelsRequest, $root.google.cloud.bigquery.v2.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|patchModel}. + * @memberof google.cloud.bigquery.v2.ModelService + * @typedef PatchModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Model} [response] Model + */ + + /** + * Calls PatchModel. + * @function patchModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IPatchModelRequest} request PatchModelRequest message or plain object + * @param {google.cloud.bigquery.v2.ModelService.PatchModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.patchModel = function patchModel(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patchModel, $root.google.cloud.bigquery.v2.PatchModelRequest, $root.google.cloud.bigquery.v2.Model, request, callback); + }, "name", { value: "PatchModel" }); + + /** + * Calls PatchModel. + * @function patchModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IPatchModelRequest} request PatchModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ModelService|deleteModel}. + * @memberof google.cloud.bigquery.v2.ModelService + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.bigquery.v2.ModelService.DeleteModelCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.deleteModel = function deleteModel(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteModel, $root.google.cloud.bigquery.v2.DeleteModelRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.bigquery.v2.ModelService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ModelService; + })(); + + v2.RemoteModelInfo = (function() { + + /** + * Properties of a RemoteModelInfo. + * @memberof google.cloud.bigquery.v2 + * @interface IRemoteModelInfo + * @property {string|null} [endpoint] RemoteModelInfo endpoint + * @property {google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|null} [remoteServiceType] RemoteModelInfo remoteServiceType + * @property {string|null} [connection] RemoteModelInfo connection + * @property {number|Long|null} [maxBatchingRows] RemoteModelInfo maxBatchingRows + * @property {string|null} [remoteModelVersion] RemoteModelInfo remoteModelVersion + * @property {string|null} [speechRecognizer] RemoteModelInfo speechRecognizer + */ + + /** + * Constructs a new RemoteModelInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RemoteModelInfo. + * @implements IRemoteModelInfo + * @constructor + * @param {google.cloud.bigquery.v2.IRemoteModelInfo=} [properties] Properties to set + */ + function RemoteModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteModelInfo endpoint. + * @member {string|null|undefined} endpoint + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.endpoint = null; + + /** + * RemoteModelInfo remoteServiceType. + * @member {google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType|null|undefined} remoteServiceType + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.remoteServiceType = null; + + /** + * RemoteModelInfo connection. + * @member {string} connection + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.connection = ""; + + /** + * RemoteModelInfo maxBatchingRows. + * @member {number|Long} maxBatchingRows + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.maxBatchingRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RemoteModelInfo remoteModelVersion. + * @member {string} remoteModelVersion + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.remoteModelVersion = ""; + + /** + * RemoteModelInfo speechRecognizer. + * @member {string} speechRecognizer + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + RemoteModelInfo.prototype.speechRecognizer = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoteModelInfo remoteService. + * @member {"endpoint"|"remoteServiceType"|undefined} remoteService + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + */ + Object.defineProperty(RemoteModelInfo.prototype, "remoteService", { + get: $util.oneOfGetter($oneOfFields = ["endpoint", "remoteServiceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoteModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {google.cloud.bigquery.v2.IRemoteModelInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RemoteModelInfo} RemoteModelInfo instance + */ + RemoteModelInfo.create = function create(properties) { + return new RemoteModelInfo(properties); + }; + + /** + * Encodes the specified RemoteModelInfo message. Does not implicitly {@link google.cloud.bigquery.v2.RemoteModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {google.cloud.bigquery.v2.IRemoteModelInfo} message RemoteModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteModelInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.remoteServiceType != null && Object.hasOwnProperty.call(message, "remoteServiceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.remoteServiceType); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.connection); + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxBatchingRows); + if (message.remoteModelVersion != null && Object.hasOwnProperty.call(message, "remoteModelVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.remoteModelVersion); + if (message.speechRecognizer != null && Object.hasOwnProperty.call(message, "speechRecognizer")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.speechRecognizer); + return writer; + }; + + /** + * Encodes the specified RemoteModelInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RemoteModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {google.cloud.bigquery.v2.IRemoteModelInfo} message RemoteModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RemoteModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RemoteModelInfo} RemoteModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteModelInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RemoteModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.remoteServiceType = reader.int32(); + break; + } + case 3: { + message.connection = reader.string(); + break; + } + case 4: { + message.maxBatchingRows = reader.int64(); + break; + } + case 5: { + message.remoteModelVersion = reader.string(); + break; + } + case 7: { + message.speechRecognizer = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RemoteModelInfo} RemoteModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteModelInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteModelInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) { + properties.remoteService = 1; + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + } + if (message.remoteServiceType != null && Object.hasOwnProperty.call(message, "remoteServiceType")) { + if (properties.remoteService === 1) + return "remoteService: multiple values"; + properties.remoteService = 1; + switch (message.remoteServiceType) { + default: + return "remoteServiceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 7: + break; + } + } + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (!$util.isInteger(message.maxBatchingRows) && !(message.maxBatchingRows && $util.isInteger(message.maxBatchingRows.low) && $util.isInteger(message.maxBatchingRows.high))) + return "maxBatchingRows: integer|Long expected"; + if (message.remoteModelVersion != null && Object.hasOwnProperty.call(message, "remoteModelVersion")) + if (!$util.isString(message.remoteModelVersion)) + return "remoteModelVersion: string expected"; + if (message.speechRecognizer != null && Object.hasOwnProperty.call(message, "speechRecognizer")) + if (!$util.isString(message.speechRecognizer)) + return "speechRecognizer: string expected"; + return null; + }; + + /** + * Creates a RemoteModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RemoteModelInfo} RemoteModelInfo + */ + RemoteModelInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RemoteModelInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RemoteModelInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RemoteModelInfo(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + switch (object.remoteServiceType) { + default: + if (typeof object.remoteServiceType === "number") { + message.remoteServiceType = object.remoteServiceType; + break; + } + break; + case "REMOTE_SERVICE_TYPE_UNSPECIFIED": + case 0: + message.remoteServiceType = 0; + break; + case "CLOUD_AI_TRANSLATE_V3": + case 1: + message.remoteServiceType = 1; + break; + case "CLOUD_AI_VISION_V1": + case 2: + message.remoteServiceType = 2; + break; + case "CLOUD_AI_NATURAL_LANGUAGE_V1": + case 3: + message.remoteServiceType = 3; + break; + case "CLOUD_AI_SPEECH_TO_TEXT_V2": + case 7: + message.remoteServiceType = 7; + break; + } + if (object.connection != null) + message.connection = String(object.connection); + if (object.maxBatchingRows != null) + if ($util.Long) + message.maxBatchingRows = $util.Long.fromValue(object.maxBatchingRows, false); + else if (typeof object.maxBatchingRows === "string") + message.maxBatchingRows = parseInt(object.maxBatchingRows, 10); + else if (typeof object.maxBatchingRows === "number") + message.maxBatchingRows = object.maxBatchingRows; + else if (typeof object.maxBatchingRows === "object") + message.maxBatchingRows = new $util.LongBits(object.maxBatchingRows.low >>> 0, object.maxBatchingRows.high >>> 0).toNumber(); + if (object.remoteModelVersion != null) + message.remoteModelVersion = String(object.remoteModelVersion); + if (object.speechRecognizer != null) + message.speechRecognizer = String(object.speechRecognizer); + return message; + }; + + /** + * Creates a plain object from a RemoteModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {google.cloud.bigquery.v2.RemoteModelInfo} message RemoteModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteModelInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.connection = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBatchingRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxBatchingRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.remoteModelVersion = ""; + object.speechRecognizer = ""; + } + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) { + object.endpoint = message.endpoint; + if (options.oneofs) + object.remoteService = "endpoint"; + } + if (message.remoteServiceType != null && Object.hasOwnProperty.call(message, "remoteServiceType")) { + object.remoteServiceType = options.enums === String ? $root.google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType[message.remoteServiceType] === undefined ? message.remoteServiceType : $root.google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType[message.remoteServiceType] : message.remoteServiceType; + if (options.oneofs) + object.remoteService = "remoteServiceType"; + } + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + object.connection = message.connection; + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxBatchingRows = typeof message.maxBatchingRows === "number" ? BigInt(message.maxBatchingRows) : $util.Long.fromBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0, false).toBigInt(); + else if (typeof message.maxBatchingRows === "number") + object.maxBatchingRows = options.longs === String ? String(message.maxBatchingRows) : message.maxBatchingRows; + else + object.maxBatchingRows = options.longs === String ? $util.Long.prototype.toString.call(message.maxBatchingRows) : options.longs === Number ? new $util.LongBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0).toNumber() : message.maxBatchingRows; + if (message.remoteModelVersion != null && Object.hasOwnProperty.call(message, "remoteModelVersion")) + object.remoteModelVersion = message.remoteModelVersion; + if (message.speechRecognizer != null && Object.hasOwnProperty.call(message, "speechRecognizer")) + object.speechRecognizer = message.speechRecognizer; + return object; + }; + + /** + * Converts this RemoteModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @instance + * @returns {Object.} JSON object + */ + RemoteModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteModelInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RemoteModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RemoteModelInfo"; + }; + + /** + * RemoteServiceType enum. + * @name google.cloud.bigquery.v2.RemoteModelInfo.RemoteServiceType + * @enum {number} + * @property {number} REMOTE_SERVICE_TYPE_UNSPECIFIED=0 REMOTE_SERVICE_TYPE_UNSPECIFIED value + * @property {number} CLOUD_AI_TRANSLATE_V3=1 CLOUD_AI_TRANSLATE_V3 value + * @property {number} CLOUD_AI_VISION_V1=2 CLOUD_AI_VISION_V1 value + * @property {number} CLOUD_AI_NATURAL_LANGUAGE_V1=3 CLOUD_AI_NATURAL_LANGUAGE_V1 value + * @property {number} CLOUD_AI_SPEECH_TO_TEXT_V2=7 CLOUD_AI_SPEECH_TO_TEXT_V2 value + */ + RemoteModelInfo.RemoteServiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REMOTE_SERVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_AI_TRANSLATE_V3"] = 1; + values[valuesById[2] = "CLOUD_AI_VISION_V1"] = 2; + values[valuesById[3] = "CLOUD_AI_NATURAL_LANGUAGE_V1"] = 3; + values[valuesById[7] = "CLOUD_AI_SPEECH_TO_TEXT_V2"] = 7; + return values; + })(); + + return RemoteModelInfo; + })(); + + v2.TransformColumn = (function() { + + /** + * Properties of a TransformColumn. + * @memberof google.cloud.bigquery.v2 + * @interface ITransformColumn + * @property {string|null} [name] TransformColumn name + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [type] TransformColumn type + * @property {string|null} [transformSql] TransformColumn transformSql + */ + + /** + * Constructs a new TransformColumn. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TransformColumn. + * @implements ITransformColumn + * @constructor + * @param {google.cloud.bigquery.v2.ITransformColumn=} [properties] Properties to set + */ + function TransformColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformColumn name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.TransformColumn + * @instance + */ + TransformColumn.prototype.name = ""; + + /** + * TransformColumn type. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} type + * @memberof google.cloud.bigquery.v2.TransformColumn + * @instance + */ + TransformColumn.prototype.type = null; + + /** + * TransformColumn transformSql. + * @member {string} transformSql + * @memberof google.cloud.bigquery.v2.TransformColumn + * @instance + */ + TransformColumn.prototype.transformSql = ""; + + /** + * Creates a new TransformColumn instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {google.cloud.bigquery.v2.ITransformColumn=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TransformColumn} TransformColumn instance + */ + TransformColumn.create = function create(properties) { + return new TransformColumn(properties); + }; + + /** + * Encodes the specified TransformColumn message. Does not implicitly {@link google.cloud.bigquery.v2.TransformColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {google.cloud.bigquery.v2.ITransformColumn} message TransformColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformColumn.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.transformSql != null && Object.hasOwnProperty.call(message, "transformSql")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.transformSql); + return writer; + }; + + /** + * Encodes the specified TransformColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TransformColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {google.cloud.bigquery.v2.ITransformColumn} message TransformColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TransformColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TransformColumn} TransformColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformColumn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TransformColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.transformSql = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TransformColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TransformColumn} TransformColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformColumn message. + * @function verify + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformColumn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.type, long + 1); + if (error) + return "type." + error; + } + if (message.transformSql != null && Object.hasOwnProperty.call(message, "transformSql")) + if (!$util.isString(message.transformSql)) + return "transformSql: string expected"; + return null; + }; + + /** + * Creates a TransformColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TransformColumn} TransformColumn + */ + TransformColumn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TransformColumn) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TransformColumn: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TransformColumn(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) { + if (!$util.isObject(object.type)) + throw TypeError(".google.cloud.bigquery.v2.TransformColumn.type: object expected"); + message.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.type, long + 1); + } + if (object.transformSql != null) + message.transformSql = String(object.transformSql); + return message; + }; + + /** + * Creates a plain object from a TransformColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {google.cloud.bigquery.v2.TransformColumn} message TransformColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformColumn.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.type = null; + object.transformSql = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.type, options, q + 1); + if (message.transformSql != null && Object.hasOwnProperty.call(message, "transformSql")) + object.transformSql = message.transformSql; + return object; + }; + + /** + * Converts this TransformColumn to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TransformColumn + * @instance + * @returns {Object.} JSON object + */ + TransformColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransformColumn + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TransformColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransformColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TransformColumn"; + }; + + return TransformColumn; + })(); + + v2.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.bigquery.v2 + * @interface IModel + * @property {string|null} [etag] Model etag + * @property {google.cloud.bigquery.v2.IModelReference|null} [modelReference] Model modelReference + * @property {number|Long|null} [creationTime] Model creationTime + * @property {number|Long|null} [lastModifiedTime] Model lastModifiedTime + * @property {string|null} [description] Model description + * @property {string|null} [friendlyName] Model friendlyName + * @property {Object.|null} [labels] Model labels + * @property {number|Long|null} [expirationTime] Model expirationTime + * @property {string|null} [location] Model location + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [encryptionConfiguration] Model encryptionConfiguration + * @property {google.cloud.bigquery.v2.Model.ModelType|null} [modelType] Model modelType + * @property {Array.|null} [trainingRuns] Model trainingRuns + * @property {Array.|null} [featureColumns] Model featureColumns + * @property {Array.|null} [labelColumns] Model labelColumns + * @property {Array.|null} [transformColumns] Model transformColumns + * @property {google.cloud.bigquery.v2.Model.IHparamSearchSpaces|null} [hparamSearchSpaces] Model hparamSearchSpaces + * @property {number|Long|null} [defaultTrialId] Model defaultTrialId + * @property {Array.|null} [hparamTrials] Model hparamTrials + * @property {Array.|null} [optimalTrialIds] Model optimalTrialIds + * @property {google.cloud.bigquery.v2.IRemoteModelInfo|null} [remoteModelInfo] Model remoteModelInfo + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.bigquery.v2.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.labels = {}; + this.trainingRuns = []; + this.featureColumns = []; + this.labelColumns = []; + this.transformColumns = []; + this.hparamTrials = []; + this.optimalTrialIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.etag = ""; + + /** + * Model modelReference. + * @member {google.cloud.bigquery.v2.IModelReference|null|undefined} modelReference + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.modelReference = null; + + /** + * Model creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Model lastModifiedTime. + * @member {number|Long} lastModifiedTime + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.lastModifiedTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Model description. + * @member {string} description + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.description = ""; + + /** + * Model friendlyName. + * @member {string} friendlyName + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.friendlyName = ""; + + /** + * Model labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.labels = $util.emptyObject; + + /** + * Model expirationTime. + * @member {number|Long} expirationTime + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.expirationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Model location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.location = ""; + + /** + * Model encryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} encryptionConfiguration + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.encryptionConfiguration = null; + + /** + * Model modelType. + * @member {google.cloud.bigquery.v2.Model.ModelType} modelType + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.modelType = 0; + + /** + * Model trainingRuns. + * @member {Array.} trainingRuns + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.trainingRuns = $util.emptyArray; + + /** + * Model featureColumns. + * @member {Array.} featureColumns + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.featureColumns = $util.emptyArray; + + /** + * Model labelColumns. + * @member {Array.} labelColumns + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.labelColumns = $util.emptyArray; + + /** + * Model transformColumns. + * @member {Array.} transformColumns + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.transformColumns = $util.emptyArray; + + /** + * Model hparamSearchSpaces. + * @member {google.cloud.bigquery.v2.Model.IHparamSearchSpaces|null|undefined} hparamSearchSpaces + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.hparamSearchSpaces = null; + + /** + * Model defaultTrialId. + * @member {number|Long} defaultTrialId + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.defaultTrialId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Model hparamTrials. + * @member {Array.} hparamTrials + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.hparamTrials = $util.emptyArray; + + /** + * Model optimalTrialIds. + * @member {Array.} optimalTrialIds + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.optimalTrialIds = $util.emptyArray; + + /** + * Model remoteModelInfo. + * @member {google.cloud.bigquery.v2.IRemoteModelInfo|null|undefined} remoteModelInfo + * @memberof google.cloud.bigquery.v2.Model + * @instance + */ + Model.prototype.remoteModelInfo = null; + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {google.cloud.bigquery.v2.IModel=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.bigquery.v2.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {google.cloud.bigquery.v2.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.etag); + if (message.modelReference != null && Object.hasOwnProperty.call(message, "modelReference")) + $root.google.cloud.bigquery.v2.ModelReference.encode(message.modelReference, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.creationTime); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.lastModifiedTime); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.modelType); + if (message.trainingRuns != null && message.trainingRuns.length) + for (var i = 0; i < message.trainingRuns.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.encode(message.trainingRuns[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.featureColumns != null && message.featureColumns.length) + for (var i = 0; i < message.featureColumns.length; ++i) + $root.google.cloud.bigquery.v2.StandardSqlField.encode(message.featureColumns[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.labelColumns != null && message.labelColumns.length) + for (var i = 0; i < message.labelColumns.length; ++i) + $root.google.cloud.bigquery.v2.StandardSqlField.encode(message.labelColumns[i], writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.location); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.friendlyName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.expirationTime); + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.encryptionConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + if (message.hparamSearchSpaces != null && Object.hasOwnProperty.call(message, "hparamSearchSpaces")) + $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces.encode(message.hparamSearchSpaces, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.hparamTrials != null && message.hparamTrials.length) + for (var i = 0; i < message.hparamTrials.length; ++i) + $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.encode(message.hparamTrials[i], writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.defaultTrialId != null && Object.hasOwnProperty.call(message, "defaultTrialId")) + writer.uint32(/* id 21, wireType 0 =*/168).int64(message.defaultTrialId); + if (message.optimalTrialIds != null && message.optimalTrialIds.length) { + writer.uint32(/* id 22, wireType 2 =*/178).fork(); + for (var i = 0; i < message.optimalTrialIds.length; ++i) + writer.int64(message.optimalTrialIds[i]); + writer.ldelim(); + } + if (message.remoteModelInfo != null && Object.hasOwnProperty.call(message, "remoteModelInfo")) + $root.google.cloud.bigquery.v2.RemoteModelInfo.encode(message.remoteModelInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.transformColumns != null && message.transformColumns.length) + for (var i = 0; i < message.transformColumns.length; ++i) + $root.google.cloud.bigquery.v2.TransformColumn.encode(message.transformColumns[i], writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {google.cloud.bigquery.v2.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.etag = reader.string(); + break; + } + case 2: { + message.modelReference = $root.google.cloud.bigquery.v2.ModelReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.creationTime = reader.int64(); + break; + } + case 6: { + message.lastModifiedTime = reader.int64(); + break; + } + case 12: { + message.description = reader.string(); + break; + } + case 14: { + message.friendlyName = reader.string(); + break; + } + case 15: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 16: { + message.expirationTime = reader.int64(); + break; + } + case 13: { + message.location = reader.string(); + break; + } + case 17: { + message.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.modelType = reader.int32(); + break; + } + case 9: { + if (!(message.trainingRuns && message.trainingRuns.length)) + message.trainingRuns = []; + message.trainingRuns.push($root.google.cloud.bigquery.v2.Model.TrainingRun.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.featureColumns && message.featureColumns.length)) + message.featureColumns = []; + message.featureColumns.push($root.google.cloud.bigquery.v2.StandardSqlField.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + if (!(message.labelColumns && message.labelColumns.length)) + message.labelColumns = []; + message.labelColumns.push($root.google.cloud.bigquery.v2.StandardSqlField.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 26: { + if (!(message.transformColumns && message.transformColumns.length)) + message.transformColumns = []; + message.transformColumns.push($root.google.cloud.bigquery.v2.TransformColumn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 18: { + message.hparamSearchSpaces = $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.defaultTrialId = reader.int64(); + break; + } + case 20: { + if (!(message.hparamTrials && message.hparamTrials.length)) + message.hparamTrials = []; + message.hparamTrials.push($root.google.cloud.bigquery.v2.Model.HparamTuningTrial.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 22: { + if (!(message.optimalTrialIds && message.optimalTrialIds.length)) + message.optimalTrialIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.optimalTrialIds.push(reader.int64()); + } else + message.optimalTrialIds.push(reader.int64()); + break; + } + case 25: { + message.remoteModelInfo = $root.google.cloud.bigquery.v2.RemoteModelInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.modelReference != null && Object.hasOwnProperty.call(message, "modelReference")) { + var error = $root.google.cloud.bigquery.v2.ModelReference.verify(message.modelReference, long + 1); + if (error) + return "modelReference." + error; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (!$util.isInteger(message.lastModifiedTime) && !(message.lastModifiedTime && $util.isInteger(message.lastModifiedTime.low) && $util.isInteger(message.lastModifiedTime.high))) + return "lastModifiedTime: integer|Long expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + if (!$util.isString(message.friendlyName)) + return "friendlyName: string expected"; + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + if (!$util.isInteger(message.expirationTime) && !(message.expirationTime && $util.isInteger(message.expirationTime.low) && $util.isInteger(message.expirationTime.high))) + return "expirationTime: integer|Long expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.encryptionConfiguration, long + 1); + if (error) + return "encryptionConfiguration." + error; + } + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 16: + case 17: + case 18: + case 19: + case 23: + case 24: + case 25: + case 26: + case 28: + case 29: + case 37: + break; + } + if (message.trainingRuns != null && Object.hasOwnProperty.call(message, "trainingRuns")) { + if (!Array.isArray(message.trainingRuns)) + return "trainingRuns: array expected"; + for (var i = 0; i < message.trainingRuns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.verify(message.trainingRuns[i], long + 1); + if (error) + return "trainingRuns." + error; + } + } + if (message.featureColumns != null && Object.hasOwnProperty.call(message, "featureColumns")) { + if (!Array.isArray(message.featureColumns)) + return "featureColumns: array expected"; + for (var i = 0; i < message.featureColumns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StandardSqlField.verify(message.featureColumns[i], long + 1); + if (error) + return "featureColumns." + error; + } + } + if (message.labelColumns != null && Object.hasOwnProperty.call(message, "labelColumns")) { + if (!Array.isArray(message.labelColumns)) + return "labelColumns: array expected"; + for (var i = 0; i < message.labelColumns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.StandardSqlField.verify(message.labelColumns[i], long + 1); + if (error) + return "labelColumns." + error; + } + } + if (message.transformColumns != null && Object.hasOwnProperty.call(message, "transformColumns")) { + if (!Array.isArray(message.transformColumns)) + return "transformColumns: array expected"; + for (var i = 0; i < message.transformColumns.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TransformColumn.verify(message.transformColumns[i], long + 1); + if (error) + return "transformColumns." + error; + } + } + if (message.hparamSearchSpaces != null && Object.hasOwnProperty.call(message, "hparamSearchSpaces")) { + var error = $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces.verify(message.hparamSearchSpaces, long + 1); + if (error) + return "hparamSearchSpaces." + error; + } + if (message.defaultTrialId != null && Object.hasOwnProperty.call(message, "defaultTrialId")) + if (!$util.isInteger(message.defaultTrialId) && !(message.defaultTrialId && $util.isInteger(message.defaultTrialId.low) && $util.isInteger(message.defaultTrialId.high))) + return "defaultTrialId: integer|Long expected"; + if (message.hparamTrials != null && Object.hasOwnProperty.call(message, "hparamTrials")) { + if (!Array.isArray(message.hparamTrials)) + return "hparamTrials: array expected"; + for (var i = 0; i < message.hparamTrials.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.verify(message.hparamTrials[i], long + 1); + if (error) + return "hparamTrials." + error; + } + } + if (message.optimalTrialIds != null && Object.hasOwnProperty.call(message, "optimalTrialIds")) { + if (!Array.isArray(message.optimalTrialIds)) + return "optimalTrialIds: array expected"; + for (var i = 0; i < message.optimalTrialIds.length; ++i) + if (!$util.isInteger(message.optimalTrialIds[i]) && !(message.optimalTrialIds[i] && $util.isInteger(message.optimalTrialIds[i].low) && $util.isInteger(message.optimalTrialIds[i].high))) + return "optimalTrialIds: integer|Long[] expected"; + } + if (message.remoteModelInfo != null && Object.hasOwnProperty.call(message, "remoteModelInfo")) { + var error = $root.google.cloud.bigquery.v2.RemoteModelInfo.verify(message.remoteModelInfo, long + 1); + if (error) + return "remoteModelInfo." + error; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model} Model + */ + Model.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.modelReference != null) { + if (!$util.isObject(object.modelReference)) + throw TypeError(".google.cloud.bigquery.v2.Model.modelReference: object expected"); + message.modelReference = $root.google.cloud.bigquery.v2.ModelReference.fromObject(object.modelReference, long + 1); + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.lastModifiedTime != null) + if ($util.Long) + message.lastModifiedTime = $util.Long.fromValue(object.lastModifiedTime, false); + else if (typeof object.lastModifiedTime === "string") + message.lastModifiedTime = parseInt(object.lastModifiedTime, 10); + else if (typeof object.lastModifiedTime === "number") + message.lastModifiedTime = object.lastModifiedTime; + else if (typeof object.lastModifiedTime === "object") + message.lastModifiedTime = new $util.LongBits(object.lastModifiedTime.low >>> 0, object.lastModifiedTime.high >>> 0).toNumber(); + if (object.description != null) + message.description = String(object.description); + if (object.friendlyName != null) + message.friendlyName = String(object.friendlyName); + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.Model.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.expirationTime != null) + if ($util.Long) + message.expirationTime = $util.Long.fromValue(object.expirationTime, false); + else if (typeof object.expirationTime === "string") + message.expirationTime = parseInt(object.expirationTime, 10); + else if (typeof object.expirationTime === "number") + message.expirationTime = object.expirationTime; + else if (typeof object.expirationTime === "object") + message.expirationTime = new $util.LongBits(object.expirationTime.low >>> 0, object.expirationTime.high >>> 0).toNumber(); + if (object.location != null) + message.location = String(object.location); + if (object.encryptionConfiguration != null) { + if (!$util.isObject(object.encryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.Model.encryptionConfiguration: object expected"); + message.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.encryptionConfiguration, long + 1); + } + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "LINEAR_REGRESSION": + case 1: + message.modelType = 1; + break; + case "LOGISTIC_REGRESSION": + case 2: + message.modelType = 2; + break; + case "KMEANS": + case 3: + message.modelType = 3; + break; + case "MATRIX_FACTORIZATION": + case 4: + message.modelType = 4; + break; + case "DNN_CLASSIFIER": + case 5: + message.modelType = 5; + break; + case "TENSORFLOW": + case 6: + message.modelType = 6; + break; + case "DNN_REGRESSOR": + case 7: + message.modelType = 7; + break; + case "XGBOOST": + case 8: + message.modelType = 8; + break; + case "BOOSTED_TREE_REGRESSOR": + case 9: + message.modelType = 9; + break; + case "BOOSTED_TREE_CLASSIFIER": + case 10: + message.modelType = 10; + break; + case "ARIMA": + case 11: + message.modelType = 11; + break; + case "AUTOML_REGRESSOR": + case 12: + message.modelType = 12; + break; + case "AUTOML_CLASSIFIER": + case 13: + message.modelType = 13; + break; + case "PCA": + case 14: + message.modelType = 14; + break; + case "DNN_LINEAR_COMBINED_CLASSIFIER": + case 16: + message.modelType = 16; + break; + case "DNN_LINEAR_COMBINED_REGRESSOR": + case 17: + message.modelType = 17; + break; + case "AUTOENCODER": + case 18: + message.modelType = 18; + break; + case "ARIMA_PLUS": + case 19: + message.modelType = 19; + break; + case "ARIMA_PLUS_XREG": + case 23: + message.modelType = 23; + break; + case "RANDOM_FOREST_REGRESSOR": + case 24: + message.modelType = 24; + break; + case "RANDOM_FOREST_CLASSIFIER": + case 25: + message.modelType = 25; + break; + case "TENSORFLOW_LITE": + case 26: + message.modelType = 26; + break; + case "ONNX": + case 28: + message.modelType = 28; + break; + case "TRANSFORM_ONLY": + case 29: + message.modelType = 29; + break; + case "CONTRIBUTION_ANALYSIS": + case 37: + message.modelType = 37; + break; + } + if (object.trainingRuns) { + if (!Array.isArray(object.trainingRuns)) + throw TypeError(".google.cloud.bigquery.v2.Model.trainingRuns: array expected"); + message.trainingRuns = []; + for (var i = 0; i < object.trainingRuns.length; ++i) { + if (!$util.isObject(object.trainingRuns[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.trainingRuns: object expected"); + message.trainingRuns[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.fromObject(object.trainingRuns[i], long + 1); + } + } + if (object.featureColumns) { + if (!Array.isArray(object.featureColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.featureColumns: array expected"); + message.featureColumns = []; + for (var i = 0; i < object.featureColumns.length; ++i) { + if (!$util.isObject(object.featureColumns[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.featureColumns: object expected"); + message.featureColumns[i] = $root.google.cloud.bigquery.v2.StandardSqlField.fromObject(object.featureColumns[i], long + 1); + } + } + if (object.labelColumns) { + if (!Array.isArray(object.labelColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.labelColumns: array expected"); + message.labelColumns = []; + for (var i = 0; i < object.labelColumns.length; ++i) { + if (!$util.isObject(object.labelColumns[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.labelColumns: object expected"); + message.labelColumns[i] = $root.google.cloud.bigquery.v2.StandardSqlField.fromObject(object.labelColumns[i], long + 1); + } + } + if (object.transformColumns) { + if (!Array.isArray(object.transformColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.transformColumns: array expected"); + message.transformColumns = []; + for (var i = 0; i < object.transformColumns.length; ++i) { + if (!$util.isObject(object.transformColumns[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.transformColumns: object expected"); + message.transformColumns[i] = $root.google.cloud.bigquery.v2.TransformColumn.fromObject(object.transformColumns[i], long + 1); + } + } + if (object.hparamSearchSpaces != null) { + if (!$util.isObject(object.hparamSearchSpaces)) + throw TypeError(".google.cloud.bigquery.v2.Model.hparamSearchSpaces: object expected"); + message.hparamSearchSpaces = $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces.fromObject(object.hparamSearchSpaces, long + 1); + } + if (object.defaultTrialId != null) + if ($util.Long) + message.defaultTrialId = $util.Long.fromValue(object.defaultTrialId, false); + else if (typeof object.defaultTrialId === "string") + message.defaultTrialId = parseInt(object.defaultTrialId, 10); + else if (typeof object.defaultTrialId === "number") + message.defaultTrialId = object.defaultTrialId; + else if (typeof object.defaultTrialId === "object") + message.defaultTrialId = new $util.LongBits(object.defaultTrialId.low >>> 0, object.defaultTrialId.high >>> 0).toNumber(); + if (object.hparamTrials) { + if (!Array.isArray(object.hparamTrials)) + throw TypeError(".google.cloud.bigquery.v2.Model.hparamTrials: array expected"); + message.hparamTrials = []; + for (var i = 0; i < object.hparamTrials.length; ++i) { + if (!$util.isObject(object.hparamTrials[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.hparamTrials: object expected"); + message.hparamTrials[i] = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.fromObject(object.hparamTrials[i], long + 1); + } + } + if (object.optimalTrialIds) { + if (!Array.isArray(object.optimalTrialIds)) + throw TypeError(".google.cloud.bigquery.v2.Model.optimalTrialIds: array expected"); + message.optimalTrialIds = []; + for (var i = 0; i < object.optimalTrialIds.length; ++i) + if ($util.Long) + message.optimalTrialIds[i] = $util.Long.fromValue(object.optimalTrialIds[i], false); + else if (typeof object.optimalTrialIds[i] === "string") + message.optimalTrialIds[i] = parseInt(object.optimalTrialIds[i], 10); + else if (typeof object.optimalTrialIds[i] === "number") + message.optimalTrialIds[i] = object.optimalTrialIds[i]; + else if (typeof object.optimalTrialIds[i] === "object") + message.optimalTrialIds[i] = new $util.LongBits(object.optimalTrialIds[i].low >>> 0, object.optimalTrialIds[i].high >>> 0).toNumber(); + } + if (object.remoteModelInfo != null) { + if (!$util.isObject(object.remoteModelInfo)) + throw TypeError(".google.cloud.bigquery.v2.Model.remoteModelInfo: object expected"); + message.remoteModelInfo = $root.google.cloud.bigquery.v2.RemoteModelInfo.fromObject(object.remoteModelInfo, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {google.cloud.bigquery.v2.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.trainingRuns = []; + object.featureColumns = []; + object.labelColumns = []; + object.hparamTrials = []; + object.optimalTrialIds = []; + object.transformColumns = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.etag = ""; + object.modelReference = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastModifiedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.lastModifiedTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.description = ""; + object.location = ""; + object.friendlyName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expirationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.expirationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.encryptionConfiguration = null; + object.hparamSearchSpaces = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.defaultTrialId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.defaultTrialId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.remoteModelInfo = null; + } + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.modelReference != null && Object.hasOwnProperty.call(message, "modelReference")) + object.modelReference = $root.google.cloud.bigquery.v2.ModelReference.toObject(message.modelReference, options, q + 1); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.lastModifiedTime = typeof message.lastModifiedTime === "number" ? BigInt(message.lastModifiedTime) : $util.Long.fromBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0, false).toBigInt(); + else if (typeof message.lastModifiedTime === "number") + object.lastModifiedTime = options.longs === String ? String(message.lastModifiedTime) : message.lastModifiedTime; + else + object.lastModifiedTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastModifiedTime) : options.longs === Number ? new $util.LongBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0).toNumber() : message.lastModifiedTime; + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + object.modelType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.bigquery.v2.Model.ModelType[message.modelType] : message.modelType; + if (message.trainingRuns && message.trainingRuns.length) { + object.trainingRuns = []; + for (var j = 0; j < message.trainingRuns.length; ++j) + object.trainingRuns[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.toObject(message.trainingRuns[j], options, q + 1); + } + if (message.featureColumns && message.featureColumns.length) { + object.featureColumns = []; + for (var j = 0; j < message.featureColumns.length; ++j) + object.featureColumns[j] = $root.google.cloud.bigquery.v2.StandardSqlField.toObject(message.featureColumns[j], options, q + 1); + } + if (message.labelColumns && message.labelColumns.length) { + object.labelColumns = []; + for (var j = 0; j < message.labelColumns.length; ++j) + object.labelColumns[j] = $root.google.cloud.bigquery.v2.StandardSqlField.toObject(message.labelColumns[j], options, q + 1); + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = message.friendlyName; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.expirationTime = typeof message.expirationTime === "number" ? BigInt(message.expirationTime) : $util.Long.fromBits(message.expirationTime.low >>> 0, message.expirationTime.high >>> 0, false).toBigInt(); + else if (typeof message.expirationTime === "number") + object.expirationTime = options.longs === String ? String(message.expirationTime) : message.expirationTime; + else + object.expirationTime = options.longs === String ? $util.Long.prototype.toString.call(message.expirationTime) : options.longs === Number ? new $util.LongBits(message.expirationTime.low >>> 0, message.expirationTime.high >>> 0).toNumber() : message.expirationTime; + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) + object.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.encryptionConfiguration, options, q + 1); + if (message.hparamSearchSpaces != null && Object.hasOwnProperty.call(message, "hparamSearchSpaces")) + object.hparamSearchSpaces = $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces.toObject(message.hparamSearchSpaces, options, q + 1); + if (message.hparamTrials && message.hparamTrials.length) { + object.hparamTrials = []; + for (var j = 0; j < message.hparamTrials.length; ++j) + object.hparamTrials[j] = $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.toObject(message.hparamTrials[j], options, q + 1); + } + if (message.defaultTrialId != null && Object.hasOwnProperty.call(message, "defaultTrialId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.defaultTrialId = typeof message.defaultTrialId === "number" ? BigInt(message.defaultTrialId) : $util.Long.fromBits(message.defaultTrialId.low >>> 0, message.defaultTrialId.high >>> 0, false).toBigInt(); + else if (typeof message.defaultTrialId === "number") + object.defaultTrialId = options.longs === String ? String(message.defaultTrialId) : message.defaultTrialId; + else + object.defaultTrialId = options.longs === String ? $util.Long.prototype.toString.call(message.defaultTrialId) : options.longs === Number ? new $util.LongBits(message.defaultTrialId.low >>> 0, message.defaultTrialId.high >>> 0).toNumber() : message.defaultTrialId; + if (message.optimalTrialIds && message.optimalTrialIds.length) { + object.optimalTrialIds = []; + for (var j = 0; j < message.optimalTrialIds.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.optimalTrialIds[j] = typeof message.optimalTrialIds[j] === "number" ? BigInt(message.optimalTrialIds[j]) : $util.Long.fromBits(message.optimalTrialIds[j].low >>> 0, message.optimalTrialIds[j].high >>> 0, false).toBigInt(); + else if (typeof message.optimalTrialIds[j] === "number") + object.optimalTrialIds[j] = options.longs === String ? String(message.optimalTrialIds[j]) : message.optimalTrialIds[j]; + else + object.optimalTrialIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.optimalTrialIds[j]) : options.longs === Number ? new $util.LongBits(message.optimalTrialIds[j].low >>> 0, message.optimalTrialIds[j].high >>> 0).toNumber() : message.optimalTrialIds[j]; + } + if (message.remoteModelInfo != null && Object.hasOwnProperty.call(message, "remoteModelInfo")) + object.remoteModelInfo = $root.google.cloud.bigquery.v2.RemoteModelInfo.toObject(message.remoteModelInfo, options, q + 1); + if (message.transformColumns && message.transformColumns.length) { + object.transformColumns = []; + for (var j = 0; j < message.transformColumns.length; ++j) + object.transformColumns[j] = $root.google.cloud.bigquery.v2.TransformColumn.toObject(message.transformColumns[j], options, q + 1); + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model"; + }; + + /** + * ModelType enum. + * @name google.cloud.bigquery.v2.Model.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} LINEAR_REGRESSION=1 LINEAR_REGRESSION value + * @property {number} LOGISTIC_REGRESSION=2 LOGISTIC_REGRESSION value + * @property {number} KMEANS=3 KMEANS value + * @property {number} MATRIX_FACTORIZATION=4 MATRIX_FACTORIZATION value + * @property {number} DNN_CLASSIFIER=5 DNN_CLASSIFIER value + * @property {number} TENSORFLOW=6 TENSORFLOW value + * @property {number} DNN_REGRESSOR=7 DNN_REGRESSOR value + * @property {number} XGBOOST=8 XGBOOST value + * @property {number} BOOSTED_TREE_REGRESSOR=9 BOOSTED_TREE_REGRESSOR value + * @property {number} BOOSTED_TREE_CLASSIFIER=10 BOOSTED_TREE_CLASSIFIER value + * @property {number} ARIMA=11 ARIMA value + * @property {number} AUTOML_REGRESSOR=12 AUTOML_REGRESSOR value + * @property {number} AUTOML_CLASSIFIER=13 AUTOML_CLASSIFIER value + * @property {number} PCA=14 PCA value + * @property {number} DNN_LINEAR_COMBINED_CLASSIFIER=16 DNN_LINEAR_COMBINED_CLASSIFIER value + * @property {number} DNN_LINEAR_COMBINED_REGRESSOR=17 DNN_LINEAR_COMBINED_REGRESSOR value + * @property {number} AUTOENCODER=18 AUTOENCODER value + * @property {number} ARIMA_PLUS=19 ARIMA_PLUS value + * @property {number} ARIMA_PLUS_XREG=23 ARIMA_PLUS_XREG value + * @property {number} RANDOM_FOREST_REGRESSOR=24 RANDOM_FOREST_REGRESSOR value + * @property {number} RANDOM_FOREST_CLASSIFIER=25 RANDOM_FOREST_CLASSIFIER value + * @property {number} TENSORFLOW_LITE=26 TENSORFLOW_LITE value + * @property {number} ONNX=28 ONNX value + * @property {number} TRANSFORM_ONLY=29 TRANSFORM_ONLY value + * @property {number} CONTRIBUTION_ANALYSIS=37 CONTRIBUTION_ANALYSIS value + */ + Model.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINEAR_REGRESSION"] = 1; + values[valuesById[2] = "LOGISTIC_REGRESSION"] = 2; + values[valuesById[3] = "KMEANS"] = 3; + values[valuesById[4] = "MATRIX_FACTORIZATION"] = 4; + values[valuesById[5] = "DNN_CLASSIFIER"] = 5; + values[valuesById[6] = "TENSORFLOW"] = 6; + values[valuesById[7] = "DNN_REGRESSOR"] = 7; + values[valuesById[8] = "XGBOOST"] = 8; + values[valuesById[9] = "BOOSTED_TREE_REGRESSOR"] = 9; + values[valuesById[10] = "BOOSTED_TREE_CLASSIFIER"] = 10; + values[valuesById[11] = "ARIMA"] = 11; + values[valuesById[12] = "AUTOML_REGRESSOR"] = 12; + values[valuesById[13] = "AUTOML_CLASSIFIER"] = 13; + values[valuesById[14] = "PCA"] = 14; + values[valuesById[16] = "DNN_LINEAR_COMBINED_CLASSIFIER"] = 16; + values[valuesById[17] = "DNN_LINEAR_COMBINED_REGRESSOR"] = 17; + values[valuesById[18] = "AUTOENCODER"] = 18; + values[valuesById[19] = "ARIMA_PLUS"] = 19; + values[valuesById[23] = "ARIMA_PLUS_XREG"] = 23; + values[valuesById[24] = "RANDOM_FOREST_REGRESSOR"] = 24; + values[valuesById[25] = "RANDOM_FOREST_CLASSIFIER"] = 25; + values[valuesById[26] = "TENSORFLOW_LITE"] = 26; + values[valuesById[28] = "ONNX"] = 28; + values[valuesById[29] = "TRANSFORM_ONLY"] = 29; + values[valuesById[37] = "CONTRIBUTION_ANALYSIS"] = 37; + return values; + })(); + + /** + * LossType enum. + * @name google.cloud.bigquery.v2.Model.LossType + * @enum {number} + * @property {number} LOSS_TYPE_UNSPECIFIED=0 LOSS_TYPE_UNSPECIFIED value + * @property {number} MEAN_SQUARED_LOSS=1 MEAN_SQUARED_LOSS value + * @property {number} MEAN_LOG_LOSS=2 MEAN_LOG_LOSS value + */ + Model.LossType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOSS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEAN_SQUARED_LOSS"] = 1; + values[valuesById[2] = "MEAN_LOG_LOSS"] = 2; + return values; + })(); + + /** + * DistanceType enum. + * @name google.cloud.bigquery.v2.Model.DistanceType + * @enum {number} + * @property {number} DISTANCE_TYPE_UNSPECIFIED=0 DISTANCE_TYPE_UNSPECIFIED value + * @property {number} EUCLIDEAN=1 EUCLIDEAN value + * @property {number} COSINE=2 COSINE value + */ + Model.DistanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EUCLIDEAN"] = 1; + values[valuesById[2] = "COSINE"] = 2; + return values; + })(); + + /** + * DataSplitMethod enum. + * @name google.cloud.bigquery.v2.Model.DataSplitMethod + * @enum {number} + * @property {number} DATA_SPLIT_METHOD_UNSPECIFIED=0 DATA_SPLIT_METHOD_UNSPECIFIED value + * @property {number} RANDOM=1 RANDOM value + * @property {number} CUSTOM=2 CUSTOM value + * @property {number} SEQUENTIAL=3 SEQUENTIAL value + * @property {number} NO_SPLIT=4 NO_SPLIT value + * @property {number} AUTO_SPLIT=5 AUTO_SPLIT value + */ + Model.DataSplitMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_SPLIT_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "RANDOM"] = 1; + values[valuesById[2] = "CUSTOM"] = 2; + values[valuesById[3] = "SEQUENTIAL"] = 3; + values[valuesById[4] = "NO_SPLIT"] = 4; + values[valuesById[5] = "AUTO_SPLIT"] = 5; + return values; + })(); + + /** + * DataFrequency enum. + * @name google.cloud.bigquery.v2.Model.DataFrequency + * @enum {number} + * @property {number} DATA_FREQUENCY_UNSPECIFIED=0 DATA_FREQUENCY_UNSPECIFIED value + * @property {number} AUTO_FREQUENCY=1 AUTO_FREQUENCY value + * @property {number} YEARLY=2 YEARLY value + * @property {number} QUARTERLY=3 QUARTERLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} WEEKLY=5 WEEKLY value + * @property {number} DAILY=6 DAILY value + * @property {number} HOURLY=7 HOURLY value + * @property {number} PER_MINUTE=8 PER_MINUTE value + */ + Model.DataFrequency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FREQUENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO_FREQUENCY"] = 1; + values[valuesById[2] = "YEARLY"] = 2; + values[valuesById[3] = "QUARTERLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "WEEKLY"] = 5; + values[valuesById[6] = "DAILY"] = 6; + values[valuesById[7] = "HOURLY"] = 7; + values[valuesById[8] = "PER_MINUTE"] = 8; + return values; + })(); + + /** + * HolidayRegion enum. + * @name google.cloud.bigquery.v2.Model.HolidayRegion + * @enum {number} + * @property {number} HOLIDAY_REGION_UNSPECIFIED=0 HOLIDAY_REGION_UNSPECIFIED value + * @property {number} GLOBAL=1 GLOBAL value + * @property {number} NA=2 NA value + * @property {number} JAPAC=3 JAPAC value + * @property {number} EMEA=4 EMEA value + * @property {number} LAC=5 LAC value + * @property {number} AE=6 AE value + * @property {number} AR=7 AR value + * @property {number} AT=8 AT value + * @property {number} AU=9 AU value + * @property {number} BE=10 BE value + * @property {number} BR=11 BR value + * @property {number} CA=12 CA value + * @property {number} CH=13 CH value + * @property {number} CL=14 CL value + * @property {number} CN=15 CN value + * @property {number} CO=16 CO value + * @property {number} CS=17 CS value + * @property {number} CZ=18 CZ value + * @property {number} DE=19 DE value + * @property {number} DK=20 DK value + * @property {number} DZ=21 DZ value + * @property {number} EC=22 EC value + * @property {number} EE=23 EE value + * @property {number} EG=24 EG value + * @property {number} ES=25 ES value + * @property {number} FI=26 FI value + * @property {number} FR=27 FR value + * @property {number} GB=28 GB value + * @property {number} GR=29 GR value + * @property {number} HK=30 HK value + * @property {number} HU=31 HU value + * @property {number} ID=32 ID value + * @property {number} IE=33 IE value + * @property {number} IL=34 IL value + * @property {number} IN=35 IN value + * @property {number} IR=36 IR value + * @property {number} IT=37 IT value + * @property {number} JP=38 JP value + * @property {number} KR=39 KR value + * @property {number} LV=40 LV value + * @property {number} MA=41 MA value + * @property {number} MX=42 MX value + * @property {number} MY=43 MY value + * @property {number} NG=44 NG value + * @property {number} NL=45 NL value + * @property {number} NO=46 NO value + * @property {number} NZ=47 NZ value + * @property {number} PE=48 PE value + * @property {number} PH=49 PH value + * @property {number} PK=50 PK value + * @property {number} PL=51 PL value + * @property {number} PT=52 PT value + * @property {number} RO=53 RO value + * @property {number} RS=54 RS value + * @property {number} RU=55 RU value + * @property {number} SA=56 SA value + * @property {number} SE=57 SE value + * @property {number} SG=58 SG value + * @property {number} SI=59 SI value + * @property {number} SK=60 SK value + * @property {number} TH=61 TH value + * @property {number} TR=62 TR value + * @property {number} TW=63 TW value + * @property {number} UA=64 UA value + * @property {number} US=65 US value + * @property {number} VE=66 VE value + * @property {number} VN=67 VN value + * @property {number} ZA=68 ZA value + */ + Model.HolidayRegion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HOLIDAY_REGION_UNSPECIFIED"] = 0; + values[valuesById[1] = "GLOBAL"] = 1; + values[valuesById[2] = "NA"] = 2; + values[valuesById[3] = "JAPAC"] = 3; + values[valuesById[4] = "EMEA"] = 4; + values[valuesById[5] = "LAC"] = 5; + values[valuesById[6] = "AE"] = 6; + values[valuesById[7] = "AR"] = 7; + values[valuesById[8] = "AT"] = 8; + values[valuesById[9] = "AU"] = 9; + values[valuesById[10] = "BE"] = 10; + values[valuesById[11] = "BR"] = 11; + values[valuesById[12] = "CA"] = 12; + values[valuesById[13] = "CH"] = 13; + values[valuesById[14] = "CL"] = 14; + values[valuesById[15] = "CN"] = 15; + values[valuesById[16] = "CO"] = 16; + values[valuesById[17] = "CS"] = 17; + values[valuesById[18] = "CZ"] = 18; + values[valuesById[19] = "DE"] = 19; + values[valuesById[20] = "DK"] = 20; + values[valuesById[21] = "DZ"] = 21; + values[valuesById[22] = "EC"] = 22; + values[valuesById[23] = "EE"] = 23; + values[valuesById[24] = "EG"] = 24; + values[valuesById[25] = "ES"] = 25; + values[valuesById[26] = "FI"] = 26; + values[valuesById[27] = "FR"] = 27; + values[valuesById[28] = "GB"] = 28; + values[valuesById[29] = "GR"] = 29; + values[valuesById[30] = "HK"] = 30; + values[valuesById[31] = "HU"] = 31; + values[valuesById[32] = "ID"] = 32; + values[valuesById[33] = "IE"] = 33; + values[valuesById[34] = "IL"] = 34; + values[valuesById[35] = "IN"] = 35; + values[valuesById[36] = "IR"] = 36; + values[valuesById[37] = "IT"] = 37; + values[valuesById[38] = "JP"] = 38; + values[valuesById[39] = "KR"] = 39; + values[valuesById[40] = "LV"] = 40; + values[valuesById[41] = "MA"] = 41; + values[valuesById[42] = "MX"] = 42; + values[valuesById[43] = "MY"] = 43; + values[valuesById[44] = "NG"] = 44; + values[valuesById[45] = "NL"] = 45; + values[valuesById[46] = "NO"] = 46; + values[valuesById[47] = "NZ"] = 47; + values[valuesById[48] = "PE"] = 48; + values[valuesById[49] = "PH"] = 49; + values[valuesById[50] = "PK"] = 50; + values[valuesById[51] = "PL"] = 51; + values[valuesById[52] = "PT"] = 52; + values[valuesById[53] = "RO"] = 53; + values[valuesById[54] = "RS"] = 54; + values[valuesById[55] = "RU"] = 55; + values[valuesById[56] = "SA"] = 56; + values[valuesById[57] = "SE"] = 57; + values[valuesById[58] = "SG"] = 58; + values[valuesById[59] = "SI"] = 59; + values[valuesById[60] = "SK"] = 60; + values[valuesById[61] = "TH"] = 61; + values[valuesById[62] = "TR"] = 62; + values[valuesById[63] = "TW"] = 63; + values[valuesById[64] = "UA"] = 64; + values[valuesById[65] = "US"] = 65; + values[valuesById[66] = "VE"] = 66; + values[valuesById[67] = "VN"] = 67; + values[valuesById[68] = "ZA"] = 68; + return values; + })(); + + Model.SeasonalPeriod = (function() { + + /** + * Properties of a SeasonalPeriod. + * @memberof google.cloud.bigquery.v2.Model + * @interface ISeasonalPeriod + */ + + /** + * Constructs a new SeasonalPeriod. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a SeasonalPeriod. + * @implements ISeasonalPeriod + * @constructor + * @param {google.cloud.bigquery.v2.Model.ISeasonalPeriod=} [properties] Properties to set + */ + function SeasonalPeriod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SeasonalPeriod instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {google.cloud.bigquery.v2.Model.ISeasonalPeriod=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.SeasonalPeriod} SeasonalPeriod instance + */ + SeasonalPeriod.create = function create(properties) { + return new SeasonalPeriod(properties); + }; + + /** + * Encodes the specified SeasonalPeriod message. Does not implicitly {@link google.cloud.bigquery.v2.Model.SeasonalPeriod.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {google.cloud.bigquery.v2.Model.ISeasonalPeriod} message SeasonalPeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeasonalPeriod.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified SeasonalPeriod message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.SeasonalPeriod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {google.cloud.bigquery.v2.Model.ISeasonalPeriod} message SeasonalPeriod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeasonalPeriod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SeasonalPeriod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.SeasonalPeriod} SeasonalPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeasonalPeriod.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.SeasonalPeriod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SeasonalPeriod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.SeasonalPeriod} SeasonalPeriod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeasonalPeriod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeasonalPeriod message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeasonalPeriod.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a SeasonalPeriod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.SeasonalPeriod} SeasonalPeriod + */ + SeasonalPeriod.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.SeasonalPeriod) + return object; + return new $root.google.cloud.bigquery.v2.Model.SeasonalPeriod(); + }; + + /** + * Creates a plain object from a SeasonalPeriod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {google.cloud.bigquery.v2.Model.SeasonalPeriod} message SeasonalPeriod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeasonalPeriod.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SeasonalPeriod to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @instance + * @returns {Object.} JSON object + */ + SeasonalPeriod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeasonalPeriod + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.SeasonalPeriod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeasonalPeriod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.SeasonalPeriod"; + }; + + /** + * SeasonalPeriodType enum. + * @name google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType + * @enum {number} + * @property {number} SEASONAL_PERIOD_TYPE_UNSPECIFIED=0 SEASONAL_PERIOD_TYPE_UNSPECIFIED value + * @property {number} NO_SEASONALITY=1 NO_SEASONALITY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} QUARTERLY=5 QUARTERLY value + * @property {number} YEARLY=6 YEARLY value + * @property {number} HOURLY=7 HOURLY value + */ + SeasonalPeriod.SeasonalPeriodType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEASONAL_PERIOD_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_SEASONALITY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "QUARTERLY"] = 5; + values[valuesById[6] = "YEARLY"] = 6; + values[valuesById[7] = "HOURLY"] = 7; + return values; + })(); + + return SeasonalPeriod; + })(); + + /** + * ColorSpace enum. + * @name google.cloud.bigquery.v2.Model.ColorSpace + * @enum {number} + * @property {number} COLOR_SPACE_UNSPECIFIED=0 COLOR_SPACE_UNSPECIFIED value + * @property {number} RGB=1 RGB value + * @property {number} HSV=2 HSV value + * @property {number} YIQ=3 YIQ value + * @property {number} YUV=4 YUV value + * @property {number} GRAYSCALE=5 GRAYSCALE value + */ + Model.ColorSpace = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COLOR_SPACE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RGB"] = 1; + values[valuesById[2] = "HSV"] = 2; + values[valuesById[3] = "YIQ"] = 3; + values[valuesById[4] = "YUV"] = 4; + values[valuesById[5] = "GRAYSCALE"] = 5; + return values; + })(); + + Model.KmeansEnums = (function() { + + /** + * Properties of a KmeansEnums. + * @memberof google.cloud.bigquery.v2.Model + * @interface IKmeansEnums + */ + + /** + * Constructs a new KmeansEnums. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a KmeansEnums. + * @implements IKmeansEnums + * @constructor + * @param {google.cloud.bigquery.v2.Model.IKmeansEnums=} [properties] Properties to set + */ + function KmeansEnums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new KmeansEnums instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IKmeansEnums=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.KmeansEnums} KmeansEnums instance + */ + KmeansEnums.create = function create(properties) { + return new KmeansEnums(properties); + }; + + /** + * Encodes the specified KmeansEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.KmeansEnums.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IKmeansEnums} message KmeansEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KmeansEnums.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified KmeansEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.KmeansEnums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IKmeansEnums} message KmeansEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KmeansEnums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a KmeansEnums message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.KmeansEnums} KmeansEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KmeansEnums.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.KmeansEnums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a KmeansEnums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.KmeansEnums} KmeansEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KmeansEnums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KmeansEnums message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KmeansEnums.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a KmeansEnums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.KmeansEnums} KmeansEnums + */ + KmeansEnums.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.KmeansEnums) + return object; + return new $root.google.cloud.bigquery.v2.Model.KmeansEnums(); + }; + + /** + * Creates a plain object from a KmeansEnums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {google.cloud.bigquery.v2.Model.KmeansEnums} message KmeansEnums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KmeansEnums.toObject = function toObject() { + return {}; + }; + + /** + * Converts this KmeansEnums to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @instance + * @returns {Object.} JSON object + */ + KmeansEnums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KmeansEnums + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.KmeansEnums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KmeansEnums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.KmeansEnums"; + }; + + /** + * KmeansInitializationMethod enum. + * @name google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod + * @enum {number} + * @property {number} KMEANS_INITIALIZATION_METHOD_UNSPECIFIED=0 KMEANS_INITIALIZATION_METHOD_UNSPECIFIED value + * @property {number} RANDOM=1 RANDOM value + * @property {number} CUSTOM=2 CUSTOM value + * @property {number} KMEANS_PLUS_PLUS=3 KMEANS_PLUS_PLUS value + */ + KmeansEnums.KmeansInitializationMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "RANDOM"] = 1; + values[valuesById[2] = "CUSTOM"] = 2; + values[valuesById[3] = "KMEANS_PLUS_PLUS"] = 3; + return values; + })(); + + return KmeansEnums; + })(); + + Model.BoostedTreeOptionEnums = (function() { + + /** + * Properties of a BoostedTreeOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @interface IBoostedTreeOptionEnums + */ + + /** + * Constructs a new BoostedTreeOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a BoostedTreeOptionEnums. + * @implements IBoostedTreeOptionEnums + * @constructor + * @param {google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums=} [properties] Properties to set + */ + function BoostedTreeOptionEnums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new BoostedTreeOptionEnums instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums} BoostedTreeOptionEnums instance + */ + BoostedTreeOptionEnums.create = function create(properties) { + return new BoostedTreeOptionEnums(properties); + }; + + /** + * Encodes the specified BoostedTreeOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums} message BoostedTreeOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostedTreeOptionEnums.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified BoostedTreeOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IBoostedTreeOptionEnums} message BoostedTreeOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostedTreeOptionEnums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BoostedTreeOptionEnums message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums} BoostedTreeOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostedTreeOptionEnums.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoostedTreeOptionEnums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums} BoostedTreeOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostedTreeOptionEnums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostedTreeOptionEnums message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostedTreeOptionEnums.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a BoostedTreeOptionEnums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums} BoostedTreeOptionEnums + */ + BoostedTreeOptionEnums.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums) + return object; + return new $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums(); + }; + + /** + * Creates a plain object from a BoostedTreeOptionEnums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums} message BoostedTreeOptionEnums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostedTreeOptionEnums.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BoostedTreeOptionEnums to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @instance + * @returns {Object.} JSON object + */ + BoostedTreeOptionEnums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostedTreeOptionEnums + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostedTreeOptionEnums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums"; + }; + + /** + * BoosterType enum. + * @name google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType + * @enum {number} + * @property {number} BOOSTER_TYPE_UNSPECIFIED=0 BOOSTER_TYPE_UNSPECIFIED value + * @property {number} GBTREE=1 GBTREE value + * @property {number} DART=2 DART value + */ + BoostedTreeOptionEnums.BoosterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOOSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GBTREE"] = 1; + values[valuesById[2] = "DART"] = 2; + return values; + })(); + + /** + * DartNormalizeType enum. + * @name google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType + * @enum {number} + * @property {number} DART_NORMALIZE_TYPE_UNSPECIFIED=0 DART_NORMALIZE_TYPE_UNSPECIFIED value + * @property {number} TREE=1 TREE value + * @property {number} FOREST=2 FOREST value + */ + BoostedTreeOptionEnums.DartNormalizeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DART_NORMALIZE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TREE"] = 1; + values[valuesById[2] = "FOREST"] = 2; + return values; + })(); + + /** + * TreeMethod enum. + * @name google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod + * @enum {number} + * @property {number} TREE_METHOD_UNSPECIFIED=0 TREE_METHOD_UNSPECIFIED value + * @property {number} AUTO=1 AUTO value + * @property {number} EXACT=2 EXACT value + * @property {number} APPROX=3 APPROX value + * @property {number} HIST=4 HIST value + */ + BoostedTreeOptionEnums.TreeMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TREE_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO"] = 1; + values[valuesById[2] = "EXACT"] = 2; + values[valuesById[3] = "APPROX"] = 3; + values[valuesById[4] = "HIST"] = 4; + return values; + })(); + + return BoostedTreeOptionEnums; + })(); + + Model.HparamTuningEnums = (function() { + + /** + * Properties of a HparamTuningEnums. + * @memberof google.cloud.bigquery.v2.Model + * @interface IHparamTuningEnums + */ + + /** + * Constructs a new HparamTuningEnums. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a HparamTuningEnums. + * @implements IHparamTuningEnums + * @constructor + * @param {google.cloud.bigquery.v2.Model.IHparamTuningEnums=} [properties] Properties to set + */ + function HparamTuningEnums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new HparamTuningEnums instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningEnums=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.HparamTuningEnums} HparamTuningEnums instance + */ + HparamTuningEnums.create = function create(properties) { + return new HparamTuningEnums(properties); + }; + + /** + * Encodes the specified HparamTuningEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningEnums.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningEnums} message HparamTuningEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamTuningEnums.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified HparamTuningEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningEnums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningEnums} message HparamTuningEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamTuningEnums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HparamTuningEnums message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.HparamTuningEnums} HparamTuningEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamTuningEnums.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.HparamTuningEnums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HparamTuningEnums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.HparamTuningEnums} HparamTuningEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamTuningEnums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HparamTuningEnums message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HparamTuningEnums.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a HparamTuningEnums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.HparamTuningEnums} HparamTuningEnums + */ + HparamTuningEnums.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.HparamTuningEnums) + return object; + return new $root.google.cloud.bigquery.v2.Model.HparamTuningEnums(); + }; + + /** + * Creates a plain object from a HparamTuningEnums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {google.cloud.bigquery.v2.Model.HparamTuningEnums} message HparamTuningEnums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HparamTuningEnums.toObject = function toObject() { + return {}; + }; + + /** + * Converts this HparamTuningEnums to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @instance + * @returns {Object.} JSON object + */ + HparamTuningEnums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HparamTuningEnums + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.HparamTuningEnums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HparamTuningEnums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.HparamTuningEnums"; + }; + + /** + * HparamTuningObjective enum. + * @name google.cloud.bigquery.v2.Model.HparamTuningEnums.HparamTuningObjective + * @enum {number} + * @property {number} HPARAM_TUNING_OBJECTIVE_UNSPECIFIED=0 HPARAM_TUNING_OBJECTIVE_UNSPECIFIED value + * @property {number} MEAN_ABSOLUTE_ERROR=1 MEAN_ABSOLUTE_ERROR value + * @property {number} MEAN_SQUARED_ERROR=2 MEAN_SQUARED_ERROR value + * @property {number} MEAN_SQUARED_LOG_ERROR=3 MEAN_SQUARED_LOG_ERROR value + * @property {number} MEDIAN_ABSOLUTE_ERROR=4 MEDIAN_ABSOLUTE_ERROR value + * @property {number} R_SQUARED=5 R_SQUARED value + * @property {number} EXPLAINED_VARIANCE=6 EXPLAINED_VARIANCE value + * @property {number} PRECISION=7 PRECISION value + * @property {number} RECALL=8 RECALL value + * @property {number} ACCURACY=9 ACCURACY value + * @property {number} F1_SCORE=10 F1_SCORE value + * @property {number} LOG_LOSS=11 LOG_LOSS value + * @property {number} ROC_AUC=12 ROC_AUC value + * @property {number} DAVIES_BOULDIN_INDEX=13 DAVIES_BOULDIN_INDEX value + * @property {number} MEAN_AVERAGE_PRECISION=14 MEAN_AVERAGE_PRECISION value + * @property {number} NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN=15 NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN value + * @property {number} AVERAGE_RANK=16 AVERAGE_RANK value + */ + HparamTuningEnums.HparamTuningObjective = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HPARAM_TUNING_OBJECTIVE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEAN_ABSOLUTE_ERROR"] = 1; + values[valuesById[2] = "MEAN_SQUARED_ERROR"] = 2; + values[valuesById[3] = "MEAN_SQUARED_LOG_ERROR"] = 3; + values[valuesById[4] = "MEDIAN_ABSOLUTE_ERROR"] = 4; + values[valuesById[5] = "R_SQUARED"] = 5; + values[valuesById[6] = "EXPLAINED_VARIANCE"] = 6; + values[valuesById[7] = "PRECISION"] = 7; + values[valuesById[8] = "RECALL"] = 8; + values[valuesById[9] = "ACCURACY"] = 9; + values[valuesById[10] = "F1_SCORE"] = 10; + values[valuesById[11] = "LOG_LOSS"] = 11; + values[valuesById[12] = "ROC_AUC"] = 12; + values[valuesById[13] = "DAVIES_BOULDIN_INDEX"] = 13; + values[valuesById[14] = "MEAN_AVERAGE_PRECISION"] = 14; + values[valuesById[15] = "NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN"] = 15; + values[valuesById[16] = "AVERAGE_RANK"] = 16; + return values; + })(); + + return HparamTuningEnums; + })(); + + /** + * LearnRateStrategy enum. + * @name google.cloud.bigquery.v2.Model.LearnRateStrategy + * @enum {number} + * @property {number} LEARN_RATE_STRATEGY_UNSPECIFIED=0 LEARN_RATE_STRATEGY_UNSPECIFIED value + * @property {number} LINE_SEARCH=1 LINE_SEARCH value + * @property {number} CONSTANT=2 CONSTANT value + */ + Model.LearnRateStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEARN_RATE_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "LINE_SEARCH"] = 1; + values[valuesById[2] = "CONSTANT"] = 2; + return values; + })(); + + /** + * OptimizationStrategy enum. + * @name google.cloud.bigquery.v2.Model.OptimizationStrategy + * @enum {number} + * @property {number} OPTIMIZATION_STRATEGY_UNSPECIFIED=0 OPTIMIZATION_STRATEGY_UNSPECIFIED value + * @property {number} BATCH_GRADIENT_DESCENT=1 BATCH_GRADIENT_DESCENT value + * @property {number} NORMAL_EQUATION=2 NORMAL_EQUATION value + */ + Model.OptimizationStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPTIMIZATION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "BATCH_GRADIENT_DESCENT"] = 1; + values[valuesById[2] = "NORMAL_EQUATION"] = 2; + return values; + })(); + + /** + * FeedbackType enum. + * @name google.cloud.bigquery.v2.Model.FeedbackType + * @enum {number} + * @property {number} FEEDBACK_TYPE_UNSPECIFIED=0 FEEDBACK_TYPE_UNSPECIFIED value + * @property {number} IMPLICIT=1 IMPLICIT value + * @property {number} EXPLICIT=2 EXPLICIT value + */ + Model.FeedbackType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEEDBACK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPLICIT"] = 1; + values[valuesById[2] = "EXPLICIT"] = 2; + return values; + })(); + + Model.RegressionMetrics = (function() { + + /** + * Properties of a RegressionMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IRegressionMetrics + * @property {google.protobuf.IDoubleValue|null} [meanAbsoluteError] RegressionMetrics meanAbsoluteError + * @property {google.protobuf.IDoubleValue|null} [meanSquaredError] RegressionMetrics meanSquaredError + * @property {google.protobuf.IDoubleValue|null} [meanSquaredLogError] RegressionMetrics meanSquaredLogError + * @property {google.protobuf.IDoubleValue|null} [medianAbsoluteError] RegressionMetrics medianAbsoluteError + * @property {google.protobuf.IDoubleValue|null} [rSquared] RegressionMetrics rSquared + */ + + /** + * Constructs a new RegressionMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a RegressionMetrics. + * @implements IRegressionMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IRegressionMetrics=} [properties] Properties to set + */ + function RegressionMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegressionMetrics meanAbsoluteError. + * @member {google.protobuf.IDoubleValue|null|undefined} meanAbsoluteError + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + */ + RegressionMetrics.prototype.meanAbsoluteError = null; + + /** + * RegressionMetrics meanSquaredError. + * @member {google.protobuf.IDoubleValue|null|undefined} meanSquaredError + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + */ + RegressionMetrics.prototype.meanSquaredError = null; + + /** + * RegressionMetrics meanSquaredLogError. + * @member {google.protobuf.IDoubleValue|null|undefined} meanSquaredLogError + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + */ + RegressionMetrics.prototype.meanSquaredLogError = null; + + /** + * RegressionMetrics medianAbsoluteError. + * @member {google.protobuf.IDoubleValue|null|undefined} medianAbsoluteError + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + */ + RegressionMetrics.prototype.medianAbsoluteError = null; + + /** + * RegressionMetrics rSquared. + * @member {google.protobuf.IDoubleValue|null|undefined} rSquared + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + */ + RegressionMetrics.prototype.rSquared = null; + + /** + * Creates a new RegressionMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRegressionMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.RegressionMetrics} RegressionMetrics instance + */ + RegressionMetrics.create = function create(properties) { + return new RegressionMetrics(properties); + }; + + /** + * Encodes the specified RegressionMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.RegressionMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRegressionMetrics} message RegressionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + $root.google.protobuf.DoubleValue.encode(message.meanAbsoluteError, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + $root.google.protobuf.DoubleValue.encode(message.meanSquaredError, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.meanSquaredLogError != null && Object.hasOwnProperty.call(message, "meanSquaredLogError")) + $root.google.protobuf.DoubleValue.encode(message.meanSquaredLogError, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.medianAbsoluteError != null && Object.hasOwnProperty.call(message, "medianAbsoluteError")) + $root.google.protobuf.DoubleValue.encode(message.medianAbsoluteError, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.rSquared != null && Object.hasOwnProperty.call(message, "rSquared")) + $root.google.protobuf.DoubleValue.encode(message.rSquared, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegressionMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.RegressionMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRegressionMetrics} message RegressionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RegressionMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.RegressionMetrics} RegressionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.RegressionMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.meanAbsoluteError = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.meanSquaredError = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.meanSquaredLogError = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.medianAbsoluteError = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.rSquared = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RegressionMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.RegressionMetrics} RegressionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegressionMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegressionMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanAbsoluteError, long + 1); + if (error) + return "meanAbsoluteError." + error; + } + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanSquaredError, long + 1); + if (error) + return "meanSquaredError." + error; + } + if (message.meanSquaredLogError != null && Object.hasOwnProperty.call(message, "meanSquaredLogError")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanSquaredLogError, long + 1); + if (error) + return "meanSquaredLogError." + error; + } + if (message.medianAbsoluteError != null && Object.hasOwnProperty.call(message, "medianAbsoluteError")) { + var error = $root.google.protobuf.DoubleValue.verify(message.medianAbsoluteError, long + 1); + if (error) + return "medianAbsoluteError." + error; + } + if (message.rSquared != null && Object.hasOwnProperty.call(message, "rSquared")) { + var error = $root.google.protobuf.DoubleValue.verify(message.rSquared, long + 1); + if (error) + return "rSquared." + error; + } + return null; + }; + + /** + * Creates a RegressionMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.RegressionMetrics} RegressionMetrics + */ + RegressionMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.RegressionMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.RegressionMetrics(); + if (object.meanAbsoluteError != null) { + if (!$util.isObject(object.meanAbsoluteError)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics.meanAbsoluteError: object expected"); + message.meanAbsoluteError = $root.google.protobuf.DoubleValue.fromObject(object.meanAbsoluteError, long + 1); + } + if (object.meanSquaredError != null) { + if (!$util.isObject(object.meanSquaredError)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics.meanSquaredError: object expected"); + message.meanSquaredError = $root.google.protobuf.DoubleValue.fromObject(object.meanSquaredError, long + 1); + } + if (object.meanSquaredLogError != null) { + if (!$util.isObject(object.meanSquaredLogError)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics.meanSquaredLogError: object expected"); + message.meanSquaredLogError = $root.google.protobuf.DoubleValue.fromObject(object.meanSquaredLogError, long + 1); + } + if (object.medianAbsoluteError != null) { + if (!$util.isObject(object.medianAbsoluteError)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics.medianAbsoluteError: object expected"); + message.medianAbsoluteError = $root.google.protobuf.DoubleValue.fromObject(object.medianAbsoluteError, long + 1); + } + if (object.rSquared != null) { + if (!$util.isObject(object.rSquared)) + throw TypeError(".google.cloud.bigquery.v2.Model.RegressionMetrics.rSquared: object expected"); + message.rSquared = $root.google.protobuf.DoubleValue.fromObject(object.rSquared, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RegressionMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.RegressionMetrics} message RegressionMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegressionMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.meanAbsoluteError = null; + object.meanSquaredError = null; + object.meanSquaredLogError = null; + object.medianAbsoluteError = null; + object.rSquared = null; + } + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + object.meanAbsoluteError = $root.google.protobuf.DoubleValue.toObject(message.meanAbsoluteError, options, q + 1); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + object.meanSquaredError = $root.google.protobuf.DoubleValue.toObject(message.meanSquaredError, options, q + 1); + if (message.meanSquaredLogError != null && Object.hasOwnProperty.call(message, "meanSquaredLogError")) + object.meanSquaredLogError = $root.google.protobuf.DoubleValue.toObject(message.meanSquaredLogError, options, q + 1); + if (message.medianAbsoluteError != null && Object.hasOwnProperty.call(message, "medianAbsoluteError")) + object.medianAbsoluteError = $root.google.protobuf.DoubleValue.toObject(message.medianAbsoluteError, options, q + 1); + if (message.rSquared != null && Object.hasOwnProperty.call(message, "rSquared")) + object.rSquared = $root.google.protobuf.DoubleValue.toObject(message.rSquared, options, q + 1); + return object; + }; + + /** + * Converts this RegressionMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @instance + * @returns {Object.} JSON object + */ + RegressionMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegressionMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.RegressionMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegressionMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.RegressionMetrics"; + }; + + return RegressionMetrics; + })(); + + Model.AggregateClassificationMetrics = (function() { + + /** + * Properties of an AggregateClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IAggregateClassificationMetrics + * @property {google.protobuf.IDoubleValue|null} [precision] AggregateClassificationMetrics precision + * @property {google.protobuf.IDoubleValue|null} [recall] AggregateClassificationMetrics recall + * @property {google.protobuf.IDoubleValue|null} [accuracy] AggregateClassificationMetrics accuracy + * @property {google.protobuf.IDoubleValue|null} [threshold] AggregateClassificationMetrics threshold + * @property {google.protobuf.IDoubleValue|null} [f1Score] AggregateClassificationMetrics f1Score + * @property {google.protobuf.IDoubleValue|null} [logLoss] AggregateClassificationMetrics logLoss + * @property {google.protobuf.IDoubleValue|null} [rocAuc] AggregateClassificationMetrics rocAuc + */ + + /** + * Constructs a new AggregateClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an AggregateClassificationMetrics. + * @implements IAggregateClassificationMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics=} [properties] Properties to set + */ + function AggregateClassificationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregateClassificationMetrics precision. + * @member {google.protobuf.IDoubleValue|null|undefined} precision + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.precision = null; + + /** + * AggregateClassificationMetrics recall. + * @member {google.protobuf.IDoubleValue|null|undefined} recall + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.recall = null; + + /** + * AggregateClassificationMetrics accuracy. + * @member {google.protobuf.IDoubleValue|null|undefined} accuracy + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.accuracy = null; + + /** + * AggregateClassificationMetrics threshold. + * @member {google.protobuf.IDoubleValue|null|undefined} threshold + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.threshold = null; + + /** + * AggregateClassificationMetrics f1Score. + * @member {google.protobuf.IDoubleValue|null|undefined} f1Score + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.f1Score = null; + + /** + * AggregateClassificationMetrics logLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} logLoss + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.logLoss = null; + + /** + * AggregateClassificationMetrics rocAuc. + * @member {google.protobuf.IDoubleValue|null|undefined} rocAuc + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + */ + AggregateClassificationMetrics.prototype.rocAuc = null; + + /** + * Creates a new AggregateClassificationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.AggregateClassificationMetrics} AggregateClassificationMetrics instance + */ + AggregateClassificationMetrics.create = function create(properties) { + return new AggregateClassificationMetrics(properties); + }; + + /** + * Encodes the specified AggregateClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics} message AggregateClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregateClassificationMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + $root.google.protobuf.DoubleValue.encode(message.precision, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + $root.google.protobuf.DoubleValue.encode(message.recall, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) + $root.google.protobuf.DoubleValue.encode(message.accuracy, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + $root.google.protobuf.DoubleValue.encode(message.threshold, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + $root.google.protobuf.DoubleValue.encode(message.f1Score, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + $root.google.protobuf.DoubleValue.encode(message.logLoss, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.rocAuc != null && Object.hasOwnProperty.call(message, "rocAuc")) + $root.google.protobuf.DoubleValue.encode(message.rocAuc, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified AggregateClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics} message AggregateClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregateClassificationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an AggregateClassificationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.AggregateClassificationMetrics} AggregateClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregateClassificationMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precision = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.recall = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.accuracy = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.threshold = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.f1Score = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.logLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.rocAuc = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AggregateClassificationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.AggregateClassificationMetrics} AggregateClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregateClassificationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregateClassificationMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregateClassificationMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) { + var error = $root.google.protobuf.DoubleValue.verify(message.precision, long + 1); + if (error) + return "precision." + error; + } + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) { + var error = $root.google.protobuf.DoubleValue.verify(message.recall, long + 1); + if (error) + return "recall." + error; + } + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) { + var error = $root.google.protobuf.DoubleValue.verify(message.accuracy, long + 1); + if (error) + return "accuracy." + error; + } + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) { + var error = $root.google.protobuf.DoubleValue.verify(message.threshold, long + 1); + if (error) + return "threshold." + error; + } + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) { + var error = $root.google.protobuf.DoubleValue.verify(message.f1Score, long + 1); + if (error) + return "f1Score." + error; + } + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.logLoss, long + 1); + if (error) + return "logLoss." + error; + } + if (message.rocAuc != null && Object.hasOwnProperty.call(message, "rocAuc")) { + var error = $root.google.protobuf.DoubleValue.verify(message.rocAuc, long + 1); + if (error) + return "rocAuc." + error; + } + return null; + }; + + /** + * Creates an AggregateClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.AggregateClassificationMetrics} AggregateClassificationMetrics + */ + AggregateClassificationMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics(); + if (object.precision != null) { + if (!$util.isObject(object.precision)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.precision: object expected"); + message.precision = $root.google.protobuf.DoubleValue.fromObject(object.precision, long + 1); + } + if (object.recall != null) { + if (!$util.isObject(object.recall)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.recall: object expected"); + message.recall = $root.google.protobuf.DoubleValue.fromObject(object.recall, long + 1); + } + if (object.accuracy != null) { + if (!$util.isObject(object.accuracy)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.accuracy: object expected"); + message.accuracy = $root.google.protobuf.DoubleValue.fromObject(object.accuracy, long + 1); + } + if (object.threshold != null) { + if (!$util.isObject(object.threshold)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.threshold: object expected"); + message.threshold = $root.google.protobuf.DoubleValue.fromObject(object.threshold, long + 1); + } + if (object.f1Score != null) { + if (!$util.isObject(object.f1Score)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.f1Score: object expected"); + message.f1Score = $root.google.protobuf.DoubleValue.fromObject(object.f1Score, long + 1); + } + if (object.logLoss != null) { + if (!$util.isObject(object.logLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.logLoss: object expected"); + message.logLoss = $root.google.protobuf.DoubleValue.fromObject(object.logLoss, long + 1); + } + if (object.rocAuc != null) { + if (!$util.isObject(object.rocAuc)) + throw TypeError(".google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.rocAuc: object expected"); + message.rocAuc = $root.google.protobuf.DoubleValue.fromObject(object.rocAuc, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an AggregateClassificationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.AggregateClassificationMetrics} message AggregateClassificationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregateClassificationMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.precision = null; + object.recall = null; + object.accuracy = null; + object.threshold = null; + object.f1Score = null; + object.logLoss = null; + object.rocAuc = null; + } + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + object.precision = $root.google.protobuf.DoubleValue.toObject(message.precision, options, q + 1); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + object.recall = $root.google.protobuf.DoubleValue.toObject(message.recall, options, q + 1); + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) + object.accuracy = $root.google.protobuf.DoubleValue.toObject(message.accuracy, options, q + 1); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + object.threshold = $root.google.protobuf.DoubleValue.toObject(message.threshold, options, q + 1); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + object.f1Score = $root.google.protobuf.DoubleValue.toObject(message.f1Score, options, q + 1); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + object.logLoss = $root.google.protobuf.DoubleValue.toObject(message.logLoss, options, q + 1); + if (message.rocAuc != null && Object.hasOwnProperty.call(message, "rocAuc")) + object.rocAuc = $root.google.protobuf.DoubleValue.toObject(message.rocAuc, options, q + 1); + return object; + }; + + /** + * Converts this AggregateClassificationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @instance + * @returns {Object.} JSON object + */ + AggregateClassificationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregateClassificationMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.AggregateClassificationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregateClassificationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.AggregateClassificationMetrics"; + }; + + return AggregateClassificationMetrics; + })(); + + Model.BinaryClassificationMetrics = (function() { + + /** + * Properties of a BinaryClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IBinaryClassificationMetrics + * @property {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null} [aggregateClassificationMetrics] BinaryClassificationMetrics aggregateClassificationMetrics + * @property {Array.|null} [binaryConfusionMatrixList] BinaryClassificationMetrics binaryConfusionMatrixList + * @property {string|null} [positiveLabel] BinaryClassificationMetrics positiveLabel + * @property {string|null} [negativeLabel] BinaryClassificationMetrics negativeLabel + */ + + /** + * Constructs a new BinaryClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a BinaryClassificationMetrics. + * @implements IBinaryClassificationMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics=} [properties] Properties to set + */ + function BinaryClassificationMetrics(properties) { + this.binaryConfusionMatrixList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BinaryClassificationMetrics aggregateClassificationMetrics. + * @member {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null|undefined} aggregateClassificationMetrics + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @instance + */ + BinaryClassificationMetrics.prototype.aggregateClassificationMetrics = null; + + /** + * BinaryClassificationMetrics binaryConfusionMatrixList. + * @member {Array.} binaryConfusionMatrixList + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @instance + */ + BinaryClassificationMetrics.prototype.binaryConfusionMatrixList = $util.emptyArray; + + /** + * BinaryClassificationMetrics positiveLabel. + * @member {string} positiveLabel + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @instance + */ + BinaryClassificationMetrics.prototype.positiveLabel = ""; + + /** + * BinaryClassificationMetrics negativeLabel. + * @member {string} negativeLabel + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @instance + */ + BinaryClassificationMetrics.prototype.negativeLabel = ""; + + /** + * Creates a new BinaryClassificationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics} BinaryClassificationMetrics instance + */ + BinaryClassificationMetrics.create = function create(properties) { + return new BinaryClassificationMetrics(properties); + }; + + /** + * Encodes the specified BinaryClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics} message BinaryClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryClassificationMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) + $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.encode(message.aggregateClassificationMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.binaryConfusionMatrixList != null && message.binaryConfusionMatrixList.length) + for (var i = 0; i < message.binaryConfusionMatrixList.length; ++i) + $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.encode(message.binaryConfusionMatrixList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.positiveLabel != null && Object.hasOwnProperty.call(message, "positiveLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.positiveLabel); + if (message.negativeLabel != null && Object.hasOwnProperty.call(message, "negativeLabel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.negativeLabel); + return writer; + }; + + /** + * Encodes the specified BinaryClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics} message BinaryClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryClassificationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BinaryClassificationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics} BinaryClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryClassificationMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.binaryConfusionMatrixList && message.binaryConfusionMatrixList.length)) + message.binaryConfusionMatrixList = []; + message.binaryConfusionMatrixList.push($root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.positiveLabel = reader.string(); + break; + } + case 4: { + message.negativeLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BinaryClassificationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics} BinaryClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryClassificationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BinaryClassificationMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BinaryClassificationMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify(message.aggregateClassificationMetrics, long + 1); + if (error) + return "aggregateClassificationMetrics." + error; + } + if (message.binaryConfusionMatrixList != null && Object.hasOwnProperty.call(message, "binaryConfusionMatrixList")) { + if (!Array.isArray(message.binaryConfusionMatrixList)) + return "binaryConfusionMatrixList: array expected"; + for (var i = 0; i < message.binaryConfusionMatrixList.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.verify(message.binaryConfusionMatrixList[i], long + 1); + if (error) + return "binaryConfusionMatrixList." + error; + } + } + if (message.positiveLabel != null && Object.hasOwnProperty.call(message, "positiveLabel")) + if (!$util.isString(message.positiveLabel)) + return "positiveLabel: string expected"; + if (message.negativeLabel != null && Object.hasOwnProperty.call(message, "negativeLabel")) + if (!$util.isString(message.negativeLabel)) + return "negativeLabel: string expected"; + return null; + }; + + /** + * Creates a BinaryClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics} BinaryClassificationMetrics + */ + BinaryClassificationMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics(); + if (object.aggregateClassificationMetrics != null) { + if (!$util.isObject(object.aggregateClassificationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.aggregateClassificationMetrics: object expected"); + message.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.fromObject(object.aggregateClassificationMetrics, long + 1); + } + if (object.binaryConfusionMatrixList) { + if (!Array.isArray(object.binaryConfusionMatrixList)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.binaryConfusionMatrixList: array expected"); + message.binaryConfusionMatrixList = []; + for (var i = 0; i < object.binaryConfusionMatrixList.length; ++i) { + if (!$util.isObject(object.binaryConfusionMatrixList[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.binaryConfusionMatrixList: object expected"); + message.binaryConfusionMatrixList[i] = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.fromObject(object.binaryConfusionMatrixList[i], long + 1); + } + } + if (object.positiveLabel != null) + message.positiveLabel = String(object.positiveLabel); + if (object.negativeLabel != null) + message.negativeLabel = String(object.negativeLabel); + return message; + }; + + /** + * Creates a plain object from a BinaryClassificationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics} message BinaryClassificationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BinaryClassificationMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.binaryConfusionMatrixList = []; + if (options.defaults) { + object.aggregateClassificationMetrics = null; + object.positiveLabel = ""; + object.negativeLabel = ""; + } + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) + object.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.toObject(message.aggregateClassificationMetrics, options, q + 1); + if (message.binaryConfusionMatrixList && message.binaryConfusionMatrixList.length) { + object.binaryConfusionMatrixList = []; + for (var j = 0; j < message.binaryConfusionMatrixList.length; ++j) + object.binaryConfusionMatrixList[j] = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.toObject(message.binaryConfusionMatrixList[j], options, q + 1); + } + if (message.positiveLabel != null && Object.hasOwnProperty.call(message, "positiveLabel")) + object.positiveLabel = message.positiveLabel; + if (message.negativeLabel != null && Object.hasOwnProperty.call(message, "negativeLabel")) + object.negativeLabel = message.negativeLabel; + return object; + }; + + /** + * Converts this BinaryClassificationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @instance + * @returns {Object.} JSON object + */ + BinaryClassificationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BinaryClassificationMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BinaryClassificationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.BinaryClassificationMetrics"; + }; + + BinaryClassificationMetrics.BinaryConfusionMatrix = (function() { + + /** + * Properties of a BinaryConfusionMatrix. + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @interface IBinaryConfusionMatrix + * @property {google.protobuf.IDoubleValue|null} [positiveClassThreshold] BinaryConfusionMatrix positiveClassThreshold + * @property {google.protobuf.IInt64Value|null} [truePositives] BinaryConfusionMatrix truePositives + * @property {google.protobuf.IInt64Value|null} [falsePositives] BinaryConfusionMatrix falsePositives + * @property {google.protobuf.IInt64Value|null} [trueNegatives] BinaryConfusionMatrix trueNegatives + * @property {google.protobuf.IInt64Value|null} [falseNegatives] BinaryConfusionMatrix falseNegatives + * @property {google.protobuf.IDoubleValue|null} [precision] BinaryConfusionMatrix precision + * @property {google.protobuf.IDoubleValue|null} [recall] BinaryConfusionMatrix recall + * @property {google.protobuf.IDoubleValue|null} [f1Score] BinaryConfusionMatrix f1Score + * @property {google.protobuf.IDoubleValue|null} [accuracy] BinaryConfusionMatrix accuracy + */ + + /** + * Constructs a new BinaryConfusionMatrix. + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics + * @classdesc Represents a BinaryConfusionMatrix. + * @implements IBinaryConfusionMatrix + * @constructor + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix=} [properties] Properties to set + */ + function BinaryConfusionMatrix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BinaryConfusionMatrix positiveClassThreshold. + * @member {google.protobuf.IDoubleValue|null|undefined} positiveClassThreshold + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.positiveClassThreshold = null; + + /** + * BinaryConfusionMatrix truePositives. + * @member {google.protobuf.IInt64Value|null|undefined} truePositives + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.truePositives = null; + + /** + * BinaryConfusionMatrix falsePositives. + * @member {google.protobuf.IInt64Value|null|undefined} falsePositives + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.falsePositives = null; + + /** + * BinaryConfusionMatrix trueNegatives. + * @member {google.protobuf.IInt64Value|null|undefined} trueNegatives + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.trueNegatives = null; + + /** + * BinaryConfusionMatrix falseNegatives. + * @member {google.protobuf.IInt64Value|null|undefined} falseNegatives + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.falseNegatives = null; + + /** + * BinaryConfusionMatrix precision. + * @member {google.protobuf.IDoubleValue|null|undefined} precision + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.precision = null; + + /** + * BinaryConfusionMatrix recall. + * @member {google.protobuf.IDoubleValue|null|undefined} recall + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.recall = null; + + /** + * BinaryConfusionMatrix f1Score. + * @member {google.protobuf.IDoubleValue|null|undefined} f1Score + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.f1Score = null; + + /** + * BinaryConfusionMatrix accuracy. + * @member {google.protobuf.IDoubleValue|null|undefined} accuracy + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + */ + BinaryConfusionMatrix.prototype.accuracy = null; + + /** + * Creates a new BinaryConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix} BinaryConfusionMatrix instance + */ + BinaryConfusionMatrix.create = function create(properties) { + return new BinaryConfusionMatrix(properties); + }; + + /** + * Encodes the specified BinaryConfusionMatrix message. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix} message BinaryConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryConfusionMatrix.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.positiveClassThreshold != null && Object.hasOwnProperty.call(message, "positiveClassThreshold")) + $root.google.protobuf.DoubleValue.encode(message.positiveClassThreshold, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.truePositives != null && Object.hasOwnProperty.call(message, "truePositives")) + $root.google.protobuf.Int64Value.encode(message.truePositives, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.falsePositives != null && Object.hasOwnProperty.call(message, "falsePositives")) + $root.google.protobuf.Int64Value.encode(message.falsePositives, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.trueNegatives != null && Object.hasOwnProperty.call(message, "trueNegatives")) + $root.google.protobuf.Int64Value.encode(message.trueNegatives, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.falseNegatives != null && Object.hasOwnProperty.call(message, "falseNegatives")) + $root.google.protobuf.Int64Value.encode(message.falseNegatives, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + $root.google.protobuf.DoubleValue.encode(message.precision, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + $root.google.protobuf.DoubleValue.encode(message.recall, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + $root.google.protobuf.DoubleValue.encode(message.f1Score, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) + $root.google.protobuf.DoubleValue.encode(message.accuracy, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified BinaryConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.IBinaryConfusionMatrix} message BinaryConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BinaryConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix} BinaryConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryConfusionMatrix.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.positiveClassThreshold = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.truePositives = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.falsePositives = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.trueNegatives = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.falseNegatives = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.precision = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.recall = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.f1Score = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.accuracy = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BinaryConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix} BinaryConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BinaryConfusionMatrix message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BinaryConfusionMatrix.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.positiveClassThreshold != null && Object.hasOwnProperty.call(message, "positiveClassThreshold")) { + var error = $root.google.protobuf.DoubleValue.verify(message.positiveClassThreshold, long + 1); + if (error) + return "positiveClassThreshold." + error; + } + if (message.truePositives != null && Object.hasOwnProperty.call(message, "truePositives")) { + var error = $root.google.protobuf.Int64Value.verify(message.truePositives, long + 1); + if (error) + return "truePositives." + error; + } + if (message.falsePositives != null && Object.hasOwnProperty.call(message, "falsePositives")) { + var error = $root.google.protobuf.Int64Value.verify(message.falsePositives, long + 1); + if (error) + return "falsePositives." + error; + } + if (message.trueNegatives != null && Object.hasOwnProperty.call(message, "trueNegatives")) { + var error = $root.google.protobuf.Int64Value.verify(message.trueNegatives, long + 1); + if (error) + return "trueNegatives." + error; + } + if (message.falseNegatives != null && Object.hasOwnProperty.call(message, "falseNegatives")) { + var error = $root.google.protobuf.Int64Value.verify(message.falseNegatives, long + 1); + if (error) + return "falseNegatives." + error; + } + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) { + var error = $root.google.protobuf.DoubleValue.verify(message.precision, long + 1); + if (error) + return "precision." + error; + } + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) { + var error = $root.google.protobuf.DoubleValue.verify(message.recall, long + 1); + if (error) + return "recall." + error; + } + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) { + var error = $root.google.protobuf.DoubleValue.verify(message.f1Score, long + 1); + if (error) + return "f1Score." + error; + } + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) { + var error = $root.google.protobuf.DoubleValue.verify(message.accuracy, long + 1); + if (error) + return "accuracy." + error; + } + return null; + }; + + /** + * Creates a BinaryConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix} BinaryConfusionMatrix + */ + BinaryConfusionMatrix.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix(); + if (object.positiveClassThreshold != null) { + if (!$util.isObject(object.positiveClassThreshold)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.positiveClassThreshold: object expected"); + message.positiveClassThreshold = $root.google.protobuf.DoubleValue.fromObject(object.positiveClassThreshold, long + 1); + } + if (object.truePositives != null) { + if (!$util.isObject(object.truePositives)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.truePositives: object expected"); + message.truePositives = $root.google.protobuf.Int64Value.fromObject(object.truePositives, long + 1); + } + if (object.falsePositives != null) { + if (!$util.isObject(object.falsePositives)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.falsePositives: object expected"); + message.falsePositives = $root.google.protobuf.Int64Value.fromObject(object.falsePositives, long + 1); + } + if (object.trueNegatives != null) { + if (!$util.isObject(object.trueNegatives)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.trueNegatives: object expected"); + message.trueNegatives = $root.google.protobuf.Int64Value.fromObject(object.trueNegatives, long + 1); + } + if (object.falseNegatives != null) { + if (!$util.isObject(object.falseNegatives)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.falseNegatives: object expected"); + message.falseNegatives = $root.google.protobuf.Int64Value.fromObject(object.falseNegatives, long + 1); + } + if (object.precision != null) { + if (!$util.isObject(object.precision)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.precision: object expected"); + message.precision = $root.google.protobuf.DoubleValue.fromObject(object.precision, long + 1); + } + if (object.recall != null) { + if (!$util.isObject(object.recall)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.recall: object expected"); + message.recall = $root.google.protobuf.DoubleValue.fromObject(object.recall, long + 1); + } + if (object.f1Score != null) { + if (!$util.isObject(object.f1Score)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.f1Score: object expected"); + message.f1Score = $root.google.protobuf.DoubleValue.fromObject(object.f1Score, long + 1); + } + if (object.accuracy != null) { + if (!$util.isObject(object.accuracy)) + throw TypeError(".google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.accuracy: object expected"); + message.accuracy = $root.google.protobuf.DoubleValue.fromObject(object.accuracy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BinaryConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix} message BinaryConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BinaryConfusionMatrix.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.positiveClassThreshold = null; + object.truePositives = null; + object.falsePositives = null; + object.trueNegatives = null; + object.falseNegatives = null; + object.precision = null; + object.recall = null; + object.f1Score = null; + object.accuracy = null; + } + if (message.positiveClassThreshold != null && Object.hasOwnProperty.call(message, "positiveClassThreshold")) + object.positiveClassThreshold = $root.google.protobuf.DoubleValue.toObject(message.positiveClassThreshold, options, q + 1); + if (message.truePositives != null && Object.hasOwnProperty.call(message, "truePositives")) + object.truePositives = $root.google.protobuf.Int64Value.toObject(message.truePositives, options, q + 1); + if (message.falsePositives != null && Object.hasOwnProperty.call(message, "falsePositives")) + object.falsePositives = $root.google.protobuf.Int64Value.toObject(message.falsePositives, options, q + 1); + if (message.trueNegatives != null && Object.hasOwnProperty.call(message, "trueNegatives")) + object.trueNegatives = $root.google.protobuf.Int64Value.toObject(message.trueNegatives, options, q + 1); + if (message.falseNegatives != null && Object.hasOwnProperty.call(message, "falseNegatives")) + object.falseNegatives = $root.google.protobuf.Int64Value.toObject(message.falseNegatives, options, q + 1); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + object.precision = $root.google.protobuf.DoubleValue.toObject(message.precision, options, q + 1); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + object.recall = $root.google.protobuf.DoubleValue.toObject(message.recall, options, q + 1); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + object.f1Score = $root.google.protobuf.DoubleValue.toObject(message.f1Score, options, q + 1); + if (message.accuracy != null && Object.hasOwnProperty.call(message, "accuracy")) + object.accuracy = $root.google.protobuf.DoubleValue.toObject(message.accuracy, options, q + 1); + return object; + }; + + /** + * Converts this BinaryConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + BinaryConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BinaryConfusionMatrix + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BinaryConfusionMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix"; + }; + + return BinaryConfusionMatrix; + })(); + + return BinaryClassificationMetrics; + })(); + + Model.MultiClassClassificationMetrics = (function() { + + /** + * Properties of a MultiClassClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IMultiClassClassificationMetrics + * @property {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null} [aggregateClassificationMetrics] MultiClassClassificationMetrics aggregateClassificationMetrics + * @property {Array.|null} [confusionMatrixList] MultiClassClassificationMetrics confusionMatrixList + */ + + /** + * Constructs a new MultiClassClassificationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a MultiClassClassificationMetrics. + * @implements IMultiClassClassificationMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics=} [properties] Properties to set + */ + function MultiClassClassificationMetrics(properties) { + this.confusionMatrixList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiClassClassificationMetrics aggregateClassificationMetrics. + * @member {google.cloud.bigquery.v2.Model.IAggregateClassificationMetrics|null|undefined} aggregateClassificationMetrics + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @instance + */ + MultiClassClassificationMetrics.prototype.aggregateClassificationMetrics = null; + + /** + * MultiClassClassificationMetrics confusionMatrixList. + * @member {Array.} confusionMatrixList + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @instance + */ + MultiClassClassificationMetrics.prototype.confusionMatrixList = $util.emptyArray; + + /** + * Creates a new MultiClassClassificationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics} MultiClassClassificationMetrics instance + */ + MultiClassClassificationMetrics.create = function create(properties) { + return new MultiClassClassificationMetrics(properties); + }; + + /** + * Encodes the specified MultiClassClassificationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics} message MultiClassClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClassClassificationMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) + $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.encode(message.aggregateClassificationMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.confusionMatrixList != null && message.confusionMatrixList.length) + for (var i = 0; i < message.confusionMatrixList.length; ++i) + $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.encode(message.confusionMatrixList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MultiClassClassificationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics} message MultiClassClassificationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiClassClassificationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MultiClassClassificationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics} MultiClassClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClassClassificationMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.confusionMatrixList && message.confusionMatrixList.length)) + message.confusionMatrixList = []; + message.confusionMatrixList.push($root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MultiClassClassificationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics} MultiClassClassificationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiClassClassificationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiClassClassificationMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiClassClassificationMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.verify(message.aggregateClassificationMetrics, long + 1); + if (error) + return "aggregateClassificationMetrics." + error; + } + if (message.confusionMatrixList != null && Object.hasOwnProperty.call(message, "confusionMatrixList")) { + if (!Array.isArray(message.confusionMatrixList)) + return "confusionMatrixList: array expected"; + for (var i = 0; i < message.confusionMatrixList.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.verify(message.confusionMatrixList[i], long + 1); + if (error) + return "confusionMatrixList." + error; + } + } + return null; + }; + + /** + * Creates a MultiClassClassificationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics} MultiClassClassificationMetrics + */ + MultiClassClassificationMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics(); + if (object.aggregateClassificationMetrics != null) { + if (!$util.isObject(object.aggregateClassificationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.aggregateClassificationMetrics: object expected"); + message.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.fromObject(object.aggregateClassificationMetrics, long + 1); + } + if (object.confusionMatrixList) { + if (!Array.isArray(object.confusionMatrixList)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.confusionMatrixList: array expected"); + message.confusionMatrixList = []; + for (var i = 0; i < object.confusionMatrixList.length; ++i) { + if (!$util.isObject(object.confusionMatrixList[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.confusionMatrixList: object expected"); + message.confusionMatrixList[i] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.fromObject(object.confusionMatrixList[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a MultiClassClassificationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics} message MultiClassClassificationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiClassClassificationMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.confusionMatrixList = []; + if (options.defaults) + object.aggregateClassificationMetrics = null; + if (message.aggregateClassificationMetrics != null && Object.hasOwnProperty.call(message, "aggregateClassificationMetrics")) + object.aggregateClassificationMetrics = $root.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics.toObject(message.aggregateClassificationMetrics, options, q + 1); + if (message.confusionMatrixList && message.confusionMatrixList.length) { + object.confusionMatrixList = []; + for (var j = 0; j < message.confusionMatrixList.length; ++j) + object.confusionMatrixList[j] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.toObject(message.confusionMatrixList[j], options, q + 1); + } + return object; + }; + + /** + * Converts this MultiClassClassificationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @instance + * @returns {Object.} JSON object + */ + MultiClassClassificationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiClassClassificationMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiClassClassificationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics"; + }; + + MultiClassClassificationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @interface IConfusionMatrix + * @property {google.protobuf.IDoubleValue|null} [confidenceThreshold] ConfusionMatrix confidenceThreshold + * @property {Array.|null} [rows] ConfusionMatrix rows + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrix confidenceThreshold. + * @member {google.protobuf.IDoubleValue|null|undefined} confidenceThreshold + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.confidenceThreshold = null; + + /** + * ConfusionMatrix rows. + * @member {Array.} rows + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.rows = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + $root.google.protobuf.DoubleValue.encode(message.confidenceThreshold, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrix message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrix.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) { + var error = $root.google.protobuf.DoubleValue.verify(message.confidenceThreshold, long + 1); + if (error) + return "confidenceThreshold." + error; + } + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.verify(message.rows[i], long + 1); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix(); + if (object.confidenceThreshold != null) { + if (!$util.isObject(object.confidenceThreshold)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.confidenceThreshold: object expected"); + message.confidenceThreshold = $root.google.protobuf.DoubleValue.fromObject(object.confidenceThreshold, long + 1); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (!$util.isObject(object.rows[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.rows: object expected"); + message.rows[i] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.fromObject(object.rows[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix} message ConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrix.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) + object.confidenceThreshold = null; + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + object.confidenceThreshold = $root.google.protobuf.DoubleValue.toObject(message.confidenceThreshold, options, q + 1); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.toObject(message.rows[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfusionMatrix + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfusionMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix"; + }; + + ConfusionMatrix.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @interface IEntry + * @property {string|null} [predictedLabel] Entry predictedLabel + * @property {google.protobuf.IInt64Value|null} [itemCount] Entry itemCount + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry predictedLabel. + * @member {string} predictedLabel + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @instance + */ + Entry.prototype.predictedLabel = ""; + + /** + * Entry itemCount. + * @member {google.protobuf.IInt64Value|null|undefined} itemCount + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @instance + */ + Entry.prototype.itemCount = null; + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.predictedLabel != null && Object.hasOwnProperty.call(message, "predictedLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.predictedLabel); + if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) + $root.google.protobuf.Int64Value.encode(message.itemCount, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.predictedLabel = reader.string(); + break; + } + case 2: { + message.itemCount = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.predictedLabel != null && Object.hasOwnProperty.call(message, "predictedLabel")) + if (!$util.isString(message.predictedLabel)) + return "predictedLabel: string expected"; + if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) { + var error = $root.google.protobuf.Int64Value.verify(message.itemCount, long + 1); + if (error) + return "itemCount." + error; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry} Entry + */ + Entry.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry(); + if (object.predictedLabel != null) + message.predictedLabel = String(object.predictedLabel); + if (object.itemCount != null) { + if (!$util.isObject(object.itemCount)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.itemCount: object expected"); + message.itemCount = $root.google.protobuf.Int64Value.fromObject(object.itemCount, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.predictedLabel = ""; + object.itemCount = null; + } + if (message.predictedLabel != null && Object.hasOwnProperty.call(message, "predictedLabel")) + object.predictedLabel = message.predictedLabel; + if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) + object.itemCount = $root.google.protobuf.Int64Value.toObject(message.itemCount, options, q + 1); + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry"; + }; + + return Entry; + })(); + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @interface IRow + * @property {string|null} [actualLabel] Row actualLabel + * @property {Array.|null} [entries] Row entries + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row actualLabel. + * @member {string} actualLabel + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.actualLabel = ""; + + /** + * Row entries. + * @member {Array.} entries + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.entries = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.actualLabel != null && Object.hasOwnProperty.call(message, "actualLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actualLabel); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.actualLabel = reader.string(); + break; + } + case 2: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.actualLabel != null && Object.hasOwnProperty.call(message, "actualLabel")) + if (!$util.isString(message.actualLabel)) + return "actualLabel: string expected"; + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.verify(message.entries[i], long + 1); + if (error) + return "entries." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row(); + if (object.actualLabel != null) + message.actualLabel = String(object.actualLabel); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (!$util.isObject(object.entries[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row.entries: object expected"); + message.entries[i] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.fromObject(object.entries[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.actualLabel = ""; + if (message.actualLabel != null && Object.hasOwnProperty.call(message, "actualLabel")) + object.actualLabel = message.actualLabel; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry.toObject(message.entries[j], options, q + 1); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return MultiClassClassificationMetrics; + })(); + + Model.ClusteringMetrics = (function() { + + /** + * Properties of a ClusteringMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IClusteringMetrics + * @property {google.protobuf.IDoubleValue|null} [daviesBouldinIndex] ClusteringMetrics daviesBouldinIndex + * @property {google.protobuf.IDoubleValue|null} [meanSquaredDistance] ClusteringMetrics meanSquaredDistance + * @property {Array.|null} [clusters] ClusteringMetrics clusters + */ + + /** + * Constructs a new ClusteringMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a ClusteringMetrics. + * @implements IClusteringMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IClusteringMetrics=} [properties] Properties to set + */ + function ClusteringMetrics(properties) { + this.clusters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusteringMetrics daviesBouldinIndex. + * @member {google.protobuf.IDoubleValue|null|undefined} daviesBouldinIndex + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @instance + */ + ClusteringMetrics.prototype.daviesBouldinIndex = null; + + /** + * ClusteringMetrics meanSquaredDistance. + * @member {google.protobuf.IDoubleValue|null|undefined} meanSquaredDistance + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @instance + */ + ClusteringMetrics.prototype.meanSquaredDistance = null; + + /** + * ClusteringMetrics clusters. + * @member {Array.} clusters + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @instance + */ + ClusteringMetrics.prototype.clusters = $util.emptyArray; + + /** + * Creates a new ClusteringMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IClusteringMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics} ClusteringMetrics instance + */ + ClusteringMetrics.create = function create(properties) { + return new ClusteringMetrics(properties); + }; + + /** + * Encodes the specified ClusteringMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IClusteringMetrics} message ClusteringMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusteringMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.daviesBouldinIndex != null && Object.hasOwnProperty.call(message, "daviesBouldinIndex")) + $root.google.protobuf.DoubleValue.encode(message.daviesBouldinIndex, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.meanSquaredDistance != null && Object.hasOwnProperty.call(message, "meanSquaredDistance")) + $root.google.protobuf.DoubleValue.encode(message.meanSquaredDistance, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.encode(message.clusters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusteringMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IClusteringMetrics} message ClusteringMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusteringMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ClusteringMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics} ClusteringMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusteringMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.daviesBouldinIndex = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.meanSquaredDistance = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClusteringMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics} ClusteringMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusteringMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusteringMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusteringMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.daviesBouldinIndex != null && Object.hasOwnProperty.call(message, "daviesBouldinIndex")) { + var error = $root.google.protobuf.DoubleValue.verify(message.daviesBouldinIndex, long + 1); + if (error) + return "daviesBouldinIndex." + error; + } + if (message.meanSquaredDistance != null && Object.hasOwnProperty.call(message, "meanSquaredDistance")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanSquaredDistance, long + 1); + if (error) + return "meanSquaredDistance." + error; + } + if (message.clusters != null && Object.hasOwnProperty.call(message, "clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.verify(message.clusters[i], long + 1); + if (error) + return "clusters." + error; + } + } + return null; + }; + + /** + * Creates a ClusteringMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics} ClusteringMetrics + */ + ClusteringMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ClusteringMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics(); + if (object.daviesBouldinIndex != null) { + if (!$util.isObject(object.daviesBouldinIndex)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.daviesBouldinIndex: object expected"); + message.daviesBouldinIndex = $root.google.protobuf.DoubleValue.fromObject(object.daviesBouldinIndex, long + 1); + } + if (object.meanSquaredDistance != null) { + if (!$util.isObject(object.meanSquaredDistance)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.meanSquaredDistance: object expected"); + message.meanSquaredDistance = $root.google.protobuf.DoubleValue.fromObject(object.meanSquaredDistance, long + 1); + } + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (!$util.isObject(object.clusters[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.clusters: object expected"); + message.clusters[i] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.fromObject(object.clusters[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusteringMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics} message ClusteringMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusteringMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.clusters = []; + if (options.defaults) { + object.daviesBouldinIndex = null; + object.meanSquaredDistance = null; + } + if (message.daviesBouldinIndex != null && Object.hasOwnProperty.call(message, "daviesBouldinIndex")) + object.daviesBouldinIndex = $root.google.protobuf.DoubleValue.toObject(message.daviesBouldinIndex, options, q + 1); + if (message.meanSquaredDistance != null && Object.hasOwnProperty.call(message, "meanSquaredDistance")) + object.meanSquaredDistance = $root.google.protobuf.DoubleValue.toObject(message.meanSquaredDistance, options, q + 1); + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.toObject(message.clusters[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ClusteringMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @instance + * @returns {Object.} JSON object + */ + ClusteringMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusteringMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusteringMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ClusteringMetrics"; + }; + + ClusteringMetrics.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @interface ICluster + * @property {number|Long|null} [centroidId] Cluster centroidId + * @property {Array.|null} [featureValues] Cluster featureValues + * @property {google.protobuf.IInt64Value|null} [count] Cluster count + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.featureValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster centroidId. + * @member {number|Long} centroidId + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @instance + */ + Cluster.prototype.centroidId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Cluster featureValues. + * @member {Array.} featureValues + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @instance + */ + Cluster.prototype.featureValues = $util.emptyArray; + + /** + * Cluster count. + * @member {google.protobuf.IInt64Value|null|undefined} count + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @instance + */ + Cluster.prototype.count = null; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.centroidId); + if (message.featureValues != null && message.featureValues.length) + for (var i = 0; i < message.featureValues.length; ++i) + $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.encode(message.featureValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.protobuf.Int64Value.encode(message.count, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.centroidId = reader.int64(); + break; + } + case 2: { + if (!(message.featureValues && message.featureValues.length)) + message.featureValues = []; + message.featureValues.push($root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.count = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + if (!$util.isInteger(message.centroidId) && !(message.centroidId && $util.isInteger(message.centroidId.low) && $util.isInteger(message.centroidId.high))) + return "centroidId: integer|Long expected"; + if (message.featureValues != null && Object.hasOwnProperty.call(message, "featureValues")) { + if (!Array.isArray(message.featureValues)) + return "featureValues: array expected"; + for (var i = 0; i < message.featureValues.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.verify(message.featureValues[i], long + 1); + if (error) + return "featureValues." + error; + } + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) { + var error = $root.google.protobuf.Int64Value.verify(message.count, long + 1); + if (error) + return "count." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster(); + if (object.centroidId != null) + if ($util.Long) + message.centroidId = $util.Long.fromValue(object.centroidId, false); + else if (typeof object.centroidId === "string") + message.centroidId = parseInt(object.centroidId, 10); + else if (typeof object.centroidId === "number") + message.centroidId = object.centroidId; + else if (typeof object.centroidId === "object") + message.centroidId = new $util.LongBits(object.centroidId.low >>> 0, object.centroidId.high >>> 0).toNumber(); + if (object.featureValues) { + if (!Array.isArray(object.featureValues)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.featureValues: array expected"); + message.featureValues = []; + for (var i = 0; i < object.featureValues.length; ++i) { + if (!$util.isObject(object.featureValues[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.featureValues: object expected"); + message.featureValues[i] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.fromObject(object.featureValues[i], long + 1); + } + } + if (object.count != null) { + if (!$util.isObject(object.count)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.count: object expected"); + message.count = $root.google.protobuf.Int64Value.fromObject(object.count, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.featureValues = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.centroidId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.centroidId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.count = null; + } + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.centroidId = typeof message.centroidId === "number" ? BigInt(message.centroidId) : $util.Long.fromBits(message.centroidId.low >>> 0, message.centroidId.high >>> 0, false).toBigInt(); + else if (typeof message.centroidId === "number") + object.centroidId = options.longs === String ? String(message.centroidId) : message.centroidId; + else + object.centroidId = options.longs === String ? $util.Long.prototype.toString.call(message.centroidId) : options.longs === Number ? new $util.LongBits(message.centroidId.low >>> 0, message.centroidId.high >>> 0).toNumber() : message.centroidId; + if (message.featureValues && message.featureValues.length) { + object.featureValues = []; + for (var j = 0; j < message.featureValues.length; ++j) + object.featureValues[j] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.toObject(message.featureValues[j], options, q + 1); + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + object.count = $root.google.protobuf.Int64Value.toObject(message.count, options, q + 1); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster"; + }; + + Cluster.FeatureValue = (function() { + + /** + * Properties of a FeatureValue. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @interface IFeatureValue + * @property {string|null} [featureColumn] FeatureValue featureColumn + * @property {google.protobuf.IDoubleValue|null} [numericalValue] FeatureValue numericalValue + * @property {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue|null} [categoricalValue] FeatureValue categoricalValue + */ + + /** + * Constructs a new FeatureValue. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster + * @classdesc Represents a FeatureValue. + * @implements IFeatureValue + * @constructor + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue=} [properties] Properties to set + */ + function FeatureValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureValue featureColumn. + * @member {string} featureColumn + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @instance + */ + FeatureValue.prototype.featureColumn = ""; + + /** + * FeatureValue numericalValue. + * @member {google.protobuf.IDoubleValue|null|undefined} numericalValue + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @instance + */ + FeatureValue.prototype.numericalValue = null; + + /** + * FeatureValue categoricalValue. + * @member {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue|null|undefined} categoricalValue + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @instance + */ + FeatureValue.prototype.categoricalValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeatureValue value. + * @member {"numericalValue"|"categoricalValue"|undefined} value + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @instance + */ + Object.defineProperty(FeatureValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["numericalValue", "categoricalValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeatureValue instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue} FeatureValue instance + */ + FeatureValue.create = function create(properties) { + return new FeatureValue(properties); + }; + + /** + * Encodes the specified FeatureValue message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue} message FeatureValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.featureColumn != null && Object.hasOwnProperty.call(message, "featureColumn")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureColumn); + if (message.numericalValue != null && Object.hasOwnProperty.call(message, "numericalValue")) + $root.google.protobuf.DoubleValue.encode(message.numericalValue, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.categoricalValue != null && Object.hasOwnProperty.call(message, "categoricalValue")) + $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.encode(message.categoricalValue, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.IFeatureValue} message FeatureValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue} FeatureValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.featureColumn = reader.string(); + break; + } + case 2: { + message.numericalValue = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.categoricalValue = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue} FeatureValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureValue message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.featureColumn != null && Object.hasOwnProperty.call(message, "featureColumn")) + if (!$util.isString(message.featureColumn)) + return "featureColumn: string expected"; + if (message.numericalValue != null && Object.hasOwnProperty.call(message, "numericalValue")) { + properties.value = 1; + { + var error = $root.google.protobuf.DoubleValue.verify(message.numericalValue, long + 1); + if (error) + return "numericalValue." + error; + } + } + if (message.categoricalValue != null && Object.hasOwnProperty.call(message, "categoricalValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.verify(message.categoricalValue, long + 1); + if (error) + return "categoricalValue." + error; + } + } + return null; + }; + + /** + * Creates a FeatureValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue} FeatureValue + */ + FeatureValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue(); + if (object.featureColumn != null) + message.featureColumn = String(object.featureColumn); + if (object.numericalValue != null) { + if (!$util.isObject(object.numericalValue)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.numericalValue: object expected"); + message.numericalValue = $root.google.protobuf.DoubleValue.fromObject(object.numericalValue, long + 1); + } + if (object.categoricalValue != null) { + if (!$util.isObject(object.categoricalValue)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.categoricalValue: object expected"); + message.categoricalValue = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.fromObject(object.categoricalValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FeatureValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue} message FeatureValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.featureColumn = ""; + if (message.featureColumn != null && Object.hasOwnProperty.call(message, "featureColumn")) + object.featureColumn = message.featureColumn; + if (message.numericalValue != null && Object.hasOwnProperty.call(message, "numericalValue")) { + object.numericalValue = $root.google.protobuf.DoubleValue.toObject(message.numericalValue, options, q + 1); + if (options.oneofs) + object.value = "numericalValue"; + } + if (message.categoricalValue != null && Object.hasOwnProperty.call(message, "categoricalValue")) { + object.categoricalValue = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.toObject(message.categoricalValue, options, q + 1); + if (options.oneofs) + object.value = "categoricalValue"; + } + return object; + }; + + /** + * Converts this FeatureValue to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @instance + * @returns {Object.} JSON object + */ + FeatureValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureValue + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue"; + }; + + FeatureValue.CategoricalValue = (function() { + + /** + * Properties of a CategoricalValue. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @interface ICategoricalValue + * @property {Array.|null} [categoryCounts] CategoricalValue categoryCounts + */ + + /** + * Constructs a new CategoricalValue. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue + * @classdesc Represents a CategoricalValue. + * @implements ICategoricalValue + * @constructor + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue=} [properties] Properties to set + */ + function CategoricalValue(properties) { + this.categoryCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalValue categoryCounts. + * @member {Array.} categoryCounts + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @instance + */ + CategoricalValue.prototype.categoryCounts = $util.emptyArray; + + /** + * Creates a new CategoricalValue instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue} CategoricalValue instance + */ + CategoricalValue.create = function create(properties) { + return new CategoricalValue(properties); + }; + + /** + * Encodes the specified CategoricalValue message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue} message CategoricalValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.categoryCounts != null && message.categoryCounts.length) + for (var i = 0; i < message.categoryCounts.length; ++i) + $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.encode(message.categoryCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoricalValue message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.ICategoricalValue} message CategoricalValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CategoricalValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue} CategoricalValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.categoryCounts && message.categoryCounts.length)) + message.categoryCounts = []; + message.categoryCounts.push($root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue} CategoricalValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalValue message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.categoryCounts != null && Object.hasOwnProperty.call(message, "categoryCounts")) { + if (!Array.isArray(message.categoryCounts)) + return "categoryCounts: array expected"; + for (var i = 0; i < message.categoryCounts.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.verify(message.categoryCounts[i], long + 1); + if (error) + return "categoryCounts." + error; + } + } + return null; + }; + + /** + * Creates a CategoricalValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue} CategoricalValue + */ + CategoricalValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue(); + if (object.categoryCounts) { + if (!Array.isArray(object.categoryCounts)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.categoryCounts: array expected"); + message.categoryCounts = []; + for (var i = 0; i < object.categoryCounts.length; ++i) { + if (!$util.isObject(object.categoryCounts[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.categoryCounts: object expected"); + message.categoryCounts[i] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.fromObject(object.categoryCounts[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a CategoricalValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue} message CategoricalValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.categoryCounts = []; + if (message.categoryCounts && message.categoryCounts.length) { + object.categoryCounts = []; + for (var j = 0; j < message.categoryCounts.length; ++j) + object.categoryCounts[j] = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.toObject(message.categoryCounts[j], options, q + 1); + } + return object; + }; + + /** + * Converts this CategoricalValue to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @instance + * @returns {Object.} JSON object + */ + CategoricalValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoricalValue + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoricalValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue"; + }; + + CategoricalValue.CategoryCount = (function() { + + /** + * Properties of a CategoryCount. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @interface ICategoryCount + * @property {string|null} [category] CategoryCount category + * @property {google.protobuf.IInt64Value|null} [count] CategoryCount count + */ + + /** + * Constructs a new CategoryCount. + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue + * @classdesc Represents a CategoryCount. + * @implements ICategoryCount + * @constructor + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount=} [properties] Properties to set + */ + function CategoryCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoryCount category. + * @member {string} category + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @instance + */ + CategoryCount.prototype.category = ""; + + /** + * CategoryCount count. + * @member {google.protobuf.IInt64Value|null|undefined} count + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @instance + */ + CategoryCount.prototype.count = null; + + /** + * Creates a new CategoryCount instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount} CategoryCount instance + */ + CategoryCount.create = function create(properties) { + return new CategoryCount(properties); + }; + + /** + * Encodes the specified CategoryCount message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount} message CategoryCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryCount.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.category); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.protobuf.Int64Value.encode(message.count, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoryCount message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.ICategoryCount} message CategoryCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CategoryCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount} CategoryCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryCount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.category = reader.string(); + break; + } + case 2: { + message.count = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount} CategoryCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryCount message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryCount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.count != null && Object.hasOwnProperty.call(message, "count")) { + var error = $root.google.protobuf.Int64Value.verify(message.count, long + 1); + if (error) + return "count." + error; + } + return null; + }; + + /** + * Creates a CategoryCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount} CategoryCount + */ + CategoryCount.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount(); + if (object.category != null) + message.category = String(object.category); + if (object.count != null) { + if (!$util.isObject(object.count)) + throw TypeError(".google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount.count: object expected"); + message.count = $root.google.protobuf.Int64Value.fromObject(object.count, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CategoryCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount} message CategoryCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryCount.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.category = ""; + object.count = null; + } + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + object.category = message.category; + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + object.count = $root.google.protobuf.Int64Value.toObject(message.count, options, q + 1); + return object; + }; + + /** + * Converts this CategoryCount to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @instance + * @returns {Object.} JSON object + */ + CategoryCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryCount + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount"; + }; + + return CategoryCount; + })(); + + return CategoricalValue; + })(); + + return FeatureValue; + })(); + + return Cluster; + })(); + + return ClusteringMetrics; + })(); + + Model.RankingMetrics = (function() { + + /** + * Properties of a RankingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IRankingMetrics + * @property {google.protobuf.IDoubleValue|null} [meanAveragePrecision] RankingMetrics meanAveragePrecision + * @property {google.protobuf.IDoubleValue|null} [meanSquaredError] RankingMetrics meanSquaredError + * @property {google.protobuf.IDoubleValue|null} [normalizedDiscountedCumulativeGain] RankingMetrics normalizedDiscountedCumulativeGain + * @property {google.protobuf.IDoubleValue|null} [averageRank] RankingMetrics averageRank + */ + + /** + * Constructs a new RankingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a RankingMetrics. + * @implements IRankingMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IRankingMetrics=} [properties] Properties to set + */ + function RankingMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RankingMetrics meanAveragePrecision. + * @member {google.protobuf.IDoubleValue|null|undefined} meanAveragePrecision + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @instance + */ + RankingMetrics.prototype.meanAveragePrecision = null; + + /** + * RankingMetrics meanSquaredError. + * @member {google.protobuf.IDoubleValue|null|undefined} meanSquaredError + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @instance + */ + RankingMetrics.prototype.meanSquaredError = null; + + /** + * RankingMetrics normalizedDiscountedCumulativeGain. + * @member {google.protobuf.IDoubleValue|null|undefined} normalizedDiscountedCumulativeGain + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @instance + */ + RankingMetrics.prototype.normalizedDiscountedCumulativeGain = null; + + /** + * RankingMetrics averageRank. + * @member {google.protobuf.IDoubleValue|null|undefined} averageRank + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @instance + */ + RankingMetrics.prototype.averageRank = null; + + /** + * Creates a new RankingMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRankingMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.RankingMetrics} RankingMetrics instance + */ + RankingMetrics.create = function create(properties) { + return new RankingMetrics(properties); + }; + + /** + * Encodes the specified RankingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.RankingMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRankingMetrics} message RankingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankingMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + $root.google.protobuf.DoubleValue.encode(message.meanAveragePrecision, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + $root.google.protobuf.DoubleValue.encode(message.meanSquaredError, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.normalizedDiscountedCumulativeGain != null && Object.hasOwnProperty.call(message, "normalizedDiscountedCumulativeGain")) + $root.google.protobuf.DoubleValue.encode(message.normalizedDiscountedCumulativeGain, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.averageRank != null && Object.hasOwnProperty.call(message, "averageRank")) + $root.google.protobuf.DoubleValue.encode(message.averageRank, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RankingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.RankingMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IRankingMetrics} message RankingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankingMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RankingMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.RankingMetrics} RankingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankingMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.RankingMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.meanAveragePrecision = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.meanSquaredError = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.normalizedDiscountedCumulativeGain = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.averageRank = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RankingMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.RankingMetrics} RankingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankingMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RankingMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RankingMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanAveragePrecision, long + 1); + if (error) + return "meanAveragePrecision." + error; + } + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) { + var error = $root.google.protobuf.DoubleValue.verify(message.meanSquaredError, long + 1); + if (error) + return "meanSquaredError." + error; + } + if (message.normalizedDiscountedCumulativeGain != null && Object.hasOwnProperty.call(message, "normalizedDiscountedCumulativeGain")) { + var error = $root.google.protobuf.DoubleValue.verify(message.normalizedDiscountedCumulativeGain, long + 1); + if (error) + return "normalizedDiscountedCumulativeGain." + error; + } + if (message.averageRank != null && Object.hasOwnProperty.call(message, "averageRank")) { + var error = $root.google.protobuf.DoubleValue.verify(message.averageRank, long + 1); + if (error) + return "averageRank." + error; + } + return null; + }; + + /** + * Creates a RankingMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.RankingMetrics} RankingMetrics + */ + RankingMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.RankingMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.RankingMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.RankingMetrics(); + if (object.meanAveragePrecision != null) { + if (!$util.isObject(object.meanAveragePrecision)) + throw TypeError(".google.cloud.bigquery.v2.Model.RankingMetrics.meanAveragePrecision: object expected"); + message.meanAveragePrecision = $root.google.protobuf.DoubleValue.fromObject(object.meanAveragePrecision, long + 1); + } + if (object.meanSquaredError != null) { + if (!$util.isObject(object.meanSquaredError)) + throw TypeError(".google.cloud.bigquery.v2.Model.RankingMetrics.meanSquaredError: object expected"); + message.meanSquaredError = $root.google.protobuf.DoubleValue.fromObject(object.meanSquaredError, long + 1); + } + if (object.normalizedDiscountedCumulativeGain != null) { + if (!$util.isObject(object.normalizedDiscountedCumulativeGain)) + throw TypeError(".google.cloud.bigquery.v2.Model.RankingMetrics.normalizedDiscountedCumulativeGain: object expected"); + message.normalizedDiscountedCumulativeGain = $root.google.protobuf.DoubleValue.fromObject(object.normalizedDiscountedCumulativeGain, long + 1); + } + if (object.averageRank != null) { + if (!$util.isObject(object.averageRank)) + throw TypeError(".google.cloud.bigquery.v2.Model.RankingMetrics.averageRank: object expected"); + message.averageRank = $root.google.protobuf.DoubleValue.fromObject(object.averageRank, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RankingMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.RankingMetrics} message RankingMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RankingMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.meanAveragePrecision = null; + object.meanSquaredError = null; + object.normalizedDiscountedCumulativeGain = null; + object.averageRank = null; + } + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + object.meanAveragePrecision = $root.google.protobuf.DoubleValue.toObject(message.meanAveragePrecision, options, q + 1); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + object.meanSquaredError = $root.google.protobuf.DoubleValue.toObject(message.meanSquaredError, options, q + 1); + if (message.normalizedDiscountedCumulativeGain != null && Object.hasOwnProperty.call(message, "normalizedDiscountedCumulativeGain")) + object.normalizedDiscountedCumulativeGain = $root.google.protobuf.DoubleValue.toObject(message.normalizedDiscountedCumulativeGain, options, q + 1); + if (message.averageRank != null && Object.hasOwnProperty.call(message, "averageRank")) + object.averageRank = $root.google.protobuf.DoubleValue.toObject(message.averageRank, options, q + 1); + return object; + }; + + /** + * Converts this RankingMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @instance + * @returns {Object.} JSON object + */ + RankingMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RankingMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.RankingMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RankingMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.RankingMetrics"; + }; + + return RankingMetrics; + })(); + + Model.ArimaForecastingMetrics = (function() { + + /** + * Properties of an ArimaForecastingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IArimaForecastingMetrics + * @property {Array.|null} [arimaSingleModelForecastingMetrics] ArimaForecastingMetrics arimaSingleModelForecastingMetrics + */ + + /** + * Constructs a new ArimaForecastingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an ArimaForecastingMetrics. + * @implements IArimaForecastingMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics=} [properties] Properties to set + */ + function ArimaForecastingMetrics(properties) { + this.arimaSingleModelForecastingMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaForecastingMetrics arimaSingleModelForecastingMetrics. + * @member {Array.} arimaSingleModelForecastingMetrics + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @instance + */ + ArimaForecastingMetrics.prototype.arimaSingleModelForecastingMetrics = $util.emptyArray; + + /** + * Creates a new ArimaForecastingMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics} ArimaForecastingMetrics instance + */ + ArimaForecastingMetrics.create = function create(properties) { + return new ArimaForecastingMetrics(properties); + }; + + /** + * Encodes the specified ArimaForecastingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics} message ArimaForecastingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaForecastingMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.arimaSingleModelForecastingMetrics != null && message.arimaSingleModelForecastingMetrics.length) + for (var i = 0; i < message.arimaSingleModelForecastingMetrics.length; ++i) + $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.encode(message.arimaSingleModelForecastingMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArimaForecastingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics} message ArimaForecastingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaForecastingMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaForecastingMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics} ArimaForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaForecastingMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + if (!(message.arimaSingleModelForecastingMetrics && message.arimaSingleModelForecastingMetrics.length)) + message.arimaSingleModelForecastingMetrics = []; + message.arimaSingleModelForecastingMetrics.push($root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaForecastingMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics} ArimaForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaForecastingMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaForecastingMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaForecastingMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.arimaSingleModelForecastingMetrics != null && Object.hasOwnProperty.call(message, "arimaSingleModelForecastingMetrics")) { + if (!Array.isArray(message.arimaSingleModelForecastingMetrics)) + return "arimaSingleModelForecastingMetrics: array expected"; + for (var i = 0; i < message.arimaSingleModelForecastingMetrics.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.verify(message.arimaSingleModelForecastingMetrics[i], long + 1); + if (error) + return "arimaSingleModelForecastingMetrics." + error; + } + } + return null; + }; + + /** + * Creates an ArimaForecastingMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics} ArimaForecastingMetrics + */ + ArimaForecastingMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics(); + if (object.arimaSingleModelForecastingMetrics) { + if (!Array.isArray(object.arimaSingleModelForecastingMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.arimaSingleModelForecastingMetrics: array expected"); + message.arimaSingleModelForecastingMetrics = []; + for (var i = 0; i < object.arimaSingleModelForecastingMetrics.length; ++i) { + if (!$util.isObject(object.arimaSingleModelForecastingMetrics[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.arimaSingleModelForecastingMetrics: object expected"); + message.arimaSingleModelForecastingMetrics[i] = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.fromObject(object.arimaSingleModelForecastingMetrics[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an ArimaForecastingMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics} message ArimaForecastingMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaForecastingMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.arimaSingleModelForecastingMetrics = []; + if (message.arimaSingleModelForecastingMetrics && message.arimaSingleModelForecastingMetrics.length) { + object.arimaSingleModelForecastingMetrics = []; + for (var j = 0; j < message.arimaSingleModelForecastingMetrics.length; ++j) + object.arimaSingleModelForecastingMetrics[j] = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.toObject(message.arimaSingleModelForecastingMetrics[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ArimaForecastingMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @instance + * @returns {Object.} JSON object + */ + ArimaForecastingMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaForecastingMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaForecastingMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ArimaForecastingMetrics"; + }; + + ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics = (function() { + + /** + * Properties of an ArimaSingleModelForecastingMetrics. + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @interface IArimaSingleModelForecastingMetrics + * @property {google.cloud.bigquery.v2.Model.IArimaOrder|null} [nonSeasonalOrder] ArimaSingleModelForecastingMetrics nonSeasonalOrder + * @property {google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null} [arimaFittingMetrics] ArimaSingleModelForecastingMetrics arimaFittingMetrics + * @property {google.protobuf.IBoolValue|null} [hasDrift] ArimaSingleModelForecastingMetrics hasDrift + * @property {string|null} [timeSeriesId] ArimaSingleModelForecastingMetrics timeSeriesId + * @property {Array.|null} [timeSeriesIds] ArimaSingleModelForecastingMetrics timeSeriesIds + * @property {Array.|null} [seasonalPeriods] ArimaSingleModelForecastingMetrics seasonalPeriods + * @property {google.protobuf.IBoolValue|null} [hasHolidayEffect] ArimaSingleModelForecastingMetrics hasHolidayEffect + * @property {google.protobuf.IBoolValue|null} [hasSpikesAndDips] ArimaSingleModelForecastingMetrics hasSpikesAndDips + * @property {google.protobuf.IBoolValue|null} [hasStepChanges] ArimaSingleModelForecastingMetrics hasStepChanges + */ + + /** + * Constructs a new ArimaSingleModelForecastingMetrics. + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics + * @classdesc Represents an ArimaSingleModelForecastingMetrics. + * @implements IArimaSingleModelForecastingMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics=} [properties] Properties to set + */ + function ArimaSingleModelForecastingMetrics(properties) { + this.timeSeriesIds = []; + this.seasonalPeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaSingleModelForecastingMetrics nonSeasonalOrder. + * @member {google.cloud.bigquery.v2.Model.IArimaOrder|null|undefined} nonSeasonalOrder + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.nonSeasonalOrder = null; + + /** + * ArimaSingleModelForecastingMetrics arimaFittingMetrics. + * @member {google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null|undefined} arimaFittingMetrics + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.arimaFittingMetrics = null; + + /** + * ArimaSingleModelForecastingMetrics hasDrift. + * @member {google.protobuf.IBoolValue|null|undefined} hasDrift + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.hasDrift = null; + + /** + * ArimaSingleModelForecastingMetrics timeSeriesId. + * @member {string} timeSeriesId + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.timeSeriesId = ""; + + /** + * ArimaSingleModelForecastingMetrics timeSeriesIds. + * @member {Array.} timeSeriesIds + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.timeSeriesIds = $util.emptyArray; + + /** + * ArimaSingleModelForecastingMetrics seasonalPeriods. + * @member {Array.} seasonalPeriods + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.seasonalPeriods = $util.emptyArray; + + /** + * ArimaSingleModelForecastingMetrics hasHolidayEffect. + * @member {google.protobuf.IBoolValue|null|undefined} hasHolidayEffect + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.hasHolidayEffect = null; + + /** + * ArimaSingleModelForecastingMetrics hasSpikesAndDips. + * @member {google.protobuf.IBoolValue|null|undefined} hasSpikesAndDips + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.hasSpikesAndDips = null; + + /** + * ArimaSingleModelForecastingMetrics hasStepChanges. + * @member {google.protobuf.IBoolValue|null|undefined} hasStepChanges + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + */ + ArimaSingleModelForecastingMetrics.prototype.hasStepChanges = null; + + /** + * Creates a new ArimaSingleModelForecastingMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics} ArimaSingleModelForecastingMetrics instance + */ + ArimaSingleModelForecastingMetrics.create = function create(properties) { + return new ArimaSingleModelForecastingMetrics(properties); + }; + + /** + * Encodes the specified ArimaSingleModelForecastingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics} message ArimaSingleModelForecastingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaSingleModelForecastingMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + $root.google.cloud.bigquery.v2.Model.ArimaOrder.encode(message.nonSeasonalOrder, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) + $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.encode(message.arimaFittingMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) + $root.google.protobuf.BoolValue.encode(message.hasDrift, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSeriesId); + if (message.seasonalPeriods != null && message.seasonalPeriods.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.seasonalPeriods.length; ++i) + writer.int32(message.seasonalPeriods[i]); + writer.ldelim(); + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) + $root.google.protobuf.BoolValue.encode(message.hasHolidayEffect, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) + $root.google.protobuf.BoolValue.encode(message.hasSpikesAndDips, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) + $root.google.protobuf.BoolValue.encode(message.hasStepChanges, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.timeSeriesIds != null && message.timeSeriesIds.length) + for (var i = 0; i < message.timeSeriesIds.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.timeSeriesIds[i]); + return writer; + }; + + /** + * Encodes the specified ArimaSingleModelForecastingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.IArimaSingleModelForecastingMetrics} message ArimaSingleModelForecastingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaSingleModelForecastingMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaSingleModelForecastingMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics} ArimaSingleModelForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaSingleModelForecastingMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.hasDrift = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.timeSeriesId = reader.string(); + break; + } + case 9: { + if (!(message.timeSeriesIds && message.timeSeriesIds.length)) + message.timeSeriesIds = []; + message.timeSeriesIds.push(reader.string()); + break; + } + case 5: { + if (!(message.seasonalPeriods && message.seasonalPeriods.length)) + message.seasonalPeriods = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.seasonalPeriods.push(reader.int32()); + } else + message.seasonalPeriods.push(reader.int32()); + break; + } + case 6: { + message.hasHolidayEffect = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.hasSpikesAndDips = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.hasStepChanges = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaSingleModelForecastingMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics} ArimaSingleModelForecastingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaSingleModelForecastingMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaSingleModelForecastingMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaSingleModelForecastingMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaOrder.verify(message.nonSeasonalOrder, long + 1); + if (error) + return "nonSeasonalOrder." + error; + } + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify(message.arimaFittingMetrics, long + 1); + if (error) + return "arimaFittingMetrics." + error; + } + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasDrift, long + 1); + if (error) + return "hasDrift." + error; + } + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + if (!$util.isString(message.timeSeriesId)) + return "timeSeriesId: string expected"; + if (message.timeSeriesIds != null && Object.hasOwnProperty.call(message, "timeSeriesIds")) { + if (!Array.isArray(message.timeSeriesIds)) + return "timeSeriesIds: array expected"; + for (var i = 0; i < message.timeSeriesIds.length; ++i) + if (!$util.isString(message.timeSeriesIds[i])) + return "timeSeriesIds: string[] expected"; + } + if (message.seasonalPeriods != null && Object.hasOwnProperty.call(message, "seasonalPeriods")) { + if (!Array.isArray(message.seasonalPeriods)) + return "seasonalPeriods: array expected"; + for (var i = 0; i < message.seasonalPeriods.length; ++i) + switch (message.seasonalPeriods[i]) { + default: + return "seasonalPeriods: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasHolidayEffect, long + 1); + if (error) + return "hasHolidayEffect." + error; + } + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasSpikesAndDips, long + 1); + if (error) + return "hasSpikesAndDips." + error; + } + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasStepChanges, long + 1); + if (error) + return "hasStepChanges." + error; + } + return null; + }; + + /** + * Creates an ArimaSingleModelForecastingMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics} ArimaSingleModelForecastingMetrics + */ + ArimaSingleModelForecastingMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics(); + if (object.nonSeasonalOrder != null) { + if (!$util.isObject(object.nonSeasonalOrder)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.nonSeasonalOrder: object expected"); + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.fromObject(object.nonSeasonalOrder, long + 1); + } + if (object.arimaFittingMetrics != null) { + if (!$util.isObject(object.arimaFittingMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.arimaFittingMetrics: object expected"); + message.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.fromObject(object.arimaFittingMetrics, long + 1); + } + if (object.hasDrift != null) { + if (!$util.isObject(object.hasDrift)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.hasDrift: object expected"); + message.hasDrift = $root.google.protobuf.BoolValue.fromObject(object.hasDrift, long + 1); + } + if (object.timeSeriesId != null) + message.timeSeriesId = String(object.timeSeriesId); + if (object.timeSeriesIds) { + if (!Array.isArray(object.timeSeriesIds)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.timeSeriesIds: array expected"); + message.timeSeriesIds = []; + for (var i = 0; i < object.timeSeriesIds.length; ++i) + message.timeSeriesIds[i] = String(object.timeSeriesIds[i]); + } + if (object.seasonalPeriods) { + if (!Array.isArray(object.seasonalPeriods)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.seasonalPeriods: array expected"); + message.seasonalPeriods = []; + for (var i = 0; i < object.seasonalPeriods.length; ++i) + switch (object.seasonalPeriods[i]) { + default: + if (typeof object.seasonalPeriods[i] === "number") { + message.seasonalPeriods[i] = object.seasonalPeriods[i]; + break; + } + case "SEASONAL_PERIOD_TYPE_UNSPECIFIED": + case 0: + message.seasonalPeriods[i] = 0; + break; + case "NO_SEASONALITY": + case 1: + message.seasonalPeriods[i] = 1; + break; + case "DAILY": + case 2: + message.seasonalPeriods[i] = 2; + break; + case "WEEKLY": + case 3: + message.seasonalPeriods[i] = 3; + break; + case "MONTHLY": + case 4: + message.seasonalPeriods[i] = 4; + break; + case "QUARTERLY": + case 5: + message.seasonalPeriods[i] = 5; + break; + case "YEARLY": + case 6: + message.seasonalPeriods[i] = 6; + break; + case "HOURLY": + case 7: + message.seasonalPeriods[i] = 7; + break; + } + } + if (object.hasHolidayEffect != null) { + if (!$util.isObject(object.hasHolidayEffect)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.hasHolidayEffect: object expected"); + message.hasHolidayEffect = $root.google.protobuf.BoolValue.fromObject(object.hasHolidayEffect, long + 1); + } + if (object.hasSpikesAndDips != null) { + if (!$util.isObject(object.hasSpikesAndDips)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.hasSpikesAndDips: object expected"); + message.hasSpikesAndDips = $root.google.protobuf.BoolValue.fromObject(object.hasSpikesAndDips, long + 1); + } + if (object.hasStepChanges != null) { + if (!$util.isObject(object.hasStepChanges)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics.hasStepChanges: object expected"); + message.hasStepChanges = $root.google.protobuf.BoolValue.fromObject(object.hasStepChanges, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ArimaSingleModelForecastingMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics} message ArimaSingleModelForecastingMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaSingleModelForecastingMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.seasonalPeriods = []; + object.timeSeriesIds = []; + } + if (options.defaults) { + object.nonSeasonalOrder = null; + object.arimaFittingMetrics = null; + object.hasDrift = null; + object.timeSeriesId = ""; + object.hasHolidayEffect = null; + object.hasSpikesAndDips = null; + object.hasStepChanges = null; + } + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + object.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.toObject(message.nonSeasonalOrder, options, q + 1); + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) + object.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.toObject(message.arimaFittingMetrics, options, q + 1); + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) + object.hasDrift = $root.google.protobuf.BoolValue.toObject(message.hasDrift, options, q + 1); + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + object.timeSeriesId = message.timeSeriesId; + if (message.seasonalPeriods && message.seasonalPeriods.length) { + object.seasonalPeriods = []; + for (var j = 0; j < message.seasonalPeriods.length; ++j) + object.seasonalPeriods[j] = options.enums === String ? $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] === undefined ? message.seasonalPeriods[j] : $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] : message.seasonalPeriods[j]; + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) + object.hasHolidayEffect = $root.google.protobuf.BoolValue.toObject(message.hasHolidayEffect, options, q + 1); + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) + object.hasSpikesAndDips = $root.google.protobuf.BoolValue.toObject(message.hasSpikesAndDips, options, q + 1); + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) + object.hasStepChanges = $root.google.protobuf.BoolValue.toObject(message.hasStepChanges, options, q + 1); + if (message.timeSeriesIds && message.timeSeriesIds.length) { + object.timeSeriesIds = []; + for (var j = 0; j < message.timeSeriesIds.length; ++j) + object.timeSeriesIds[j] = message.timeSeriesIds[j]; + } + return object; + }; + + /** + * Converts this ArimaSingleModelForecastingMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @instance + * @returns {Object.} JSON object + */ + ArimaSingleModelForecastingMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaSingleModelForecastingMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaSingleModelForecastingMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics"; + }; + + return ArimaSingleModelForecastingMetrics; + })(); + + return ArimaForecastingMetrics; + })(); + + Model.DimensionalityReductionMetrics = (function() { + + /** + * Properties of a DimensionalityReductionMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IDimensionalityReductionMetrics + * @property {google.protobuf.IDoubleValue|null} [totalExplainedVarianceRatio] DimensionalityReductionMetrics totalExplainedVarianceRatio + */ + + /** + * Constructs a new DimensionalityReductionMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a DimensionalityReductionMetrics. + * @implements IDimensionalityReductionMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics=} [properties] Properties to set + */ + function DimensionalityReductionMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DimensionalityReductionMetrics totalExplainedVarianceRatio. + * @member {google.protobuf.IDoubleValue|null|undefined} totalExplainedVarianceRatio + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @instance + */ + DimensionalityReductionMetrics.prototype.totalExplainedVarianceRatio = null; + + /** + * Creates a new DimensionalityReductionMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics} DimensionalityReductionMetrics instance + */ + DimensionalityReductionMetrics.create = function create(properties) { + return new DimensionalityReductionMetrics(properties); + }; + + /** + * Encodes the specified DimensionalityReductionMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics} message DimensionalityReductionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionalityReductionMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.totalExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "totalExplainedVarianceRatio")) + $root.google.protobuf.DoubleValue.encode(message.totalExplainedVarianceRatio, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DimensionalityReductionMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics} message DimensionalityReductionMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionalityReductionMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DimensionalityReductionMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics} DimensionalityReductionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionalityReductionMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalExplainedVarianceRatio = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionalityReductionMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics} DimensionalityReductionMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionalityReductionMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionalityReductionMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionalityReductionMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.totalExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "totalExplainedVarianceRatio")) { + var error = $root.google.protobuf.DoubleValue.verify(message.totalExplainedVarianceRatio, long + 1); + if (error) + return "totalExplainedVarianceRatio." + error; + } + return null; + }; + + /** + * Creates a DimensionalityReductionMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics} DimensionalityReductionMetrics + */ + DimensionalityReductionMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics(); + if (object.totalExplainedVarianceRatio != null) { + if (!$util.isObject(object.totalExplainedVarianceRatio)) + throw TypeError(".google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.totalExplainedVarianceRatio: object expected"); + message.totalExplainedVarianceRatio = $root.google.protobuf.DoubleValue.fromObject(object.totalExplainedVarianceRatio, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DimensionalityReductionMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics} message DimensionalityReductionMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionalityReductionMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.totalExplainedVarianceRatio = null; + if (message.totalExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "totalExplainedVarianceRatio")) + object.totalExplainedVarianceRatio = $root.google.protobuf.DoubleValue.toObject(message.totalExplainedVarianceRatio, options, q + 1); + return object; + }; + + /** + * Converts this DimensionalityReductionMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @instance + * @returns {Object.} JSON object + */ + DimensionalityReductionMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionalityReductionMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionalityReductionMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics"; + }; + + return DimensionalityReductionMetrics; + })(); + + Model.EvaluationMetrics = (function() { + + /** + * Properties of an EvaluationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IEvaluationMetrics + * @property {google.cloud.bigquery.v2.Model.IRegressionMetrics|null} [regressionMetrics] EvaluationMetrics regressionMetrics + * @property {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics|null} [binaryClassificationMetrics] EvaluationMetrics binaryClassificationMetrics + * @property {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics|null} [multiClassClassificationMetrics] EvaluationMetrics multiClassClassificationMetrics + * @property {google.cloud.bigquery.v2.Model.IClusteringMetrics|null} [clusteringMetrics] EvaluationMetrics clusteringMetrics + * @property {google.cloud.bigquery.v2.Model.IRankingMetrics|null} [rankingMetrics] EvaluationMetrics rankingMetrics + * @property {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics|null} [arimaForecastingMetrics] EvaluationMetrics arimaForecastingMetrics + * @property {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics|null} [dimensionalityReductionMetrics] EvaluationMetrics dimensionalityReductionMetrics + */ + + /** + * Constructs a new EvaluationMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an EvaluationMetrics. + * @implements IEvaluationMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IEvaluationMetrics=} [properties] Properties to set + */ + function EvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationMetrics regressionMetrics. + * @member {google.cloud.bigquery.v2.Model.IRegressionMetrics|null|undefined} regressionMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.regressionMetrics = null; + + /** + * EvaluationMetrics binaryClassificationMetrics. + * @member {google.cloud.bigquery.v2.Model.IBinaryClassificationMetrics|null|undefined} binaryClassificationMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.binaryClassificationMetrics = null; + + /** + * EvaluationMetrics multiClassClassificationMetrics. + * @member {google.cloud.bigquery.v2.Model.IMultiClassClassificationMetrics|null|undefined} multiClassClassificationMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.multiClassClassificationMetrics = null; + + /** + * EvaluationMetrics clusteringMetrics. + * @member {google.cloud.bigquery.v2.Model.IClusteringMetrics|null|undefined} clusteringMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.clusteringMetrics = null; + + /** + * EvaluationMetrics rankingMetrics. + * @member {google.cloud.bigquery.v2.Model.IRankingMetrics|null|undefined} rankingMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.rankingMetrics = null; + + /** + * EvaluationMetrics arimaForecastingMetrics. + * @member {google.cloud.bigquery.v2.Model.IArimaForecastingMetrics|null|undefined} arimaForecastingMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.arimaForecastingMetrics = null; + + /** + * EvaluationMetrics dimensionalityReductionMetrics. + * @member {google.cloud.bigquery.v2.Model.IDimensionalityReductionMetrics|null|undefined} dimensionalityReductionMetrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + EvaluationMetrics.prototype.dimensionalityReductionMetrics = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationMetrics metrics. + * @member {"regressionMetrics"|"binaryClassificationMetrics"|"multiClassClassificationMetrics"|"clusteringMetrics"|"rankingMetrics"|"arimaForecastingMetrics"|"dimensionalityReductionMetrics"|undefined} metrics + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + */ + Object.defineProperty(EvaluationMetrics.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["regressionMetrics", "binaryClassificationMetrics", "multiClassClassificationMetrics", "clusteringMetrics", "rankingMetrics", "arimaForecastingMetrics", "dimensionalityReductionMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.EvaluationMetrics} EvaluationMetrics instance + */ + EvaluationMetrics.create = function create(properties) { + return new EvaluationMetrics(properties); + }; + + /** + * Encodes the specified EvaluationMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.EvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IEvaluationMetrics} message EvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.regressionMetrics != null && Object.hasOwnProperty.call(message, "regressionMetrics")) + $root.google.cloud.bigquery.v2.Model.RegressionMetrics.encode(message.regressionMetrics, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.binaryClassificationMetrics != null && Object.hasOwnProperty.call(message, "binaryClassificationMetrics")) + $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.encode(message.binaryClassificationMetrics, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.multiClassClassificationMetrics != null && Object.hasOwnProperty.call(message, "multiClassClassificationMetrics")) + $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.encode(message.multiClassClassificationMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.clusteringMetrics != null && Object.hasOwnProperty.call(message, "clusteringMetrics")) + $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.encode(message.clusteringMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.rankingMetrics != null && Object.hasOwnProperty.call(message, "rankingMetrics")) + $root.google.cloud.bigquery.v2.Model.RankingMetrics.encode(message.rankingMetrics, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.arimaForecastingMetrics != null && Object.hasOwnProperty.call(message, "arimaForecastingMetrics")) + $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.encode(message.arimaForecastingMetrics, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.dimensionalityReductionMetrics != null && Object.hasOwnProperty.call(message, "dimensionalityReductionMetrics")) + $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.encode(message.dimensionalityReductionMetrics, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.EvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IEvaluationMetrics} message EvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.EvaluationMetrics} EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.EvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.regressionMetrics = $root.google.cloud.bigquery.v2.Model.RegressionMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.binaryClassificationMetrics = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.multiClassClassificationMetrics = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.clusteringMetrics = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.rankingMetrics = $root.google.cloud.bigquery.v2.Model.RankingMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.arimaForecastingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.dimensionalityReductionMetrics = $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.EvaluationMetrics} EvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.regressionMetrics != null && Object.hasOwnProperty.call(message, "regressionMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.RegressionMetrics.verify(message.regressionMetrics, long + 1); + if (error) + return "regressionMetrics." + error; + } + } + if (message.binaryClassificationMetrics != null && Object.hasOwnProperty.call(message, "binaryClassificationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.verify(message.binaryClassificationMetrics, long + 1); + if (error) + return "binaryClassificationMetrics." + error; + } + } + if (message.multiClassClassificationMetrics != null && Object.hasOwnProperty.call(message, "multiClassClassificationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.verify(message.multiClassClassificationMetrics, long + 1); + if (error) + return "multiClassClassificationMetrics." + error; + } + } + if (message.clusteringMetrics != null && Object.hasOwnProperty.call(message, "clusteringMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.verify(message.clusteringMetrics, long + 1); + if (error) + return "clusteringMetrics." + error; + } + } + if (message.rankingMetrics != null && Object.hasOwnProperty.call(message, "rankingMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.RankingMetrics.verify(message.rankingMetrics, long + 1); + if (error) + return "rankingMetrics." + error; + } + } + if (message.arimaForecastingMetrics != null && Object.hasOwnProperty.call(message, "arimaForecastingMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.verify(message.arimaForecastingMetrics, long + 1); + if (error) + return "arimaForecastingMetrics." + error; + } + } + if (message.dimensionalityReductionMetrics != null && Object.hasOwnProperty.call(message, "dimensionalityReductionMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.verify(message.dimensionalityReductionMetrics, long + 1); + if (error) + return "dimensionalityReductionMetrics." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.EvaluationMetrics} EvaluationMetrics + */ + EvaluationMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.EvaluationMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.EvaluationMetrics(); + if (object.regressionMetrics != null) { + if (!$util.isObject(object.regressionMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.regressionMetrics: object expected"); + message.regressionMetrics = $root.google.cloud.bigquery.v2.Model.RegressionMetrics.fromObject(object.regressionMetrics, long + 1); + } + if (object.binaryClassificationMetrics != null) { + if (!$util.isObject(object.binaryClassificationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.binaryClassificationMetrics: object expected"); + message.binaryClassificationMetrics = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.fromObject(object.binaryClassificationMetrics, long + 1); + } + if (object.multiClassClassificationMetrics != null) { + if (!$util.isObject(object.multiClassClassificationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.multiClassClassificationMetrics: object expected"); + message.multiClassClassificationMetrics = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.fromObject(object.multiClassClassificationMetrics, long + 1); + } + if (object.clusteringMetrics != null) { + if (!$util.isObject(object.clusteringMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.clusteringMetrics: object expected"); + message.clusteringMetrics = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.fromObject(object.clusteringMetrics, long + 1); + } + if (object.rankingMetrics != null) { + if (!$util.isObject(object.rankingMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.rankingMetrics: object expected"); + message.rankingMetrics = $root.google.cloud.bigquery.v2.Model.RankingMetrics.fromObject(object.rankingMetrics, long + 1); + } + if (object.arimaForecastingMetrics != null) { + if (!$util.isObject(object.arimaForecastingMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.arimaForecastingMetrics: object expected"); + message.arimaForecastingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.fromObject(object.arimaForecastingMetrics, long + 1); + } + if (object.dimensionalityReductionMetrics != null) { + if (!$util.isObject(object.dimensionalityReductionMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.EvaluationMetrics.dimensionalityReductionMetrics: object expected"); + message.dimensionalityReductionMetrics = $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.fromObject(object.dimensionalityReductionMetrics, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.EvaluationMetrics} message EvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.regressionMetrics != null && Object.hasOwnProperty.call(message, "regressionMetrics")) { + object.regressionMetrics = $root.google.cloud.bigquery.v2.Model.RegressionMetrics.toObject(message.regressionMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "regressionMetrics"; + } + if (message.binaryClassificationMetrics != null && Object.hasOwnProperty.call(message, "binaryClassificationMetrics")) { + object.binaryClassificationMetrics = $root.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.toObject(message.binaryClassificationMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "binaryClassificationMetrics"; + } + if (message.multiClassClassificationMetrics != null && Object.hasOwnProperty.call(message, "multiClassClassificationMetrics")) { + object.multiClassClassificationMetrics = $root.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.toObject(message.multiClassClassificationMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "multiClassClassificationMetrics"; + } + if (message.clusteringMetrics != null && Object.hasOwnProperty.call(message, "clusteringMetrics")) { + object.clusteringMetrics = $root.google.cloud.bigquery.v2.Model.ClusteringMetrics.toObject(message.clusteringMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "clusteringMetrics"; + } + if (message.rankingMetrics != null && Object.hasOwnProperty.call(message, "rankingMetrics")) { + object.rankingMetrics = $root.google.cloud.bigquery.v2.Model.RankingMetrics.toObject(message.rankingMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "rankingMetrics"; + } + if (message.arimaForecastingMetrics != null && Object.hasOwnProperty.call(message, "arimaForecastingMetrics")) { + object.arimaForecastingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaForecastingMetrics.toObject(message.arimaForecastingMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "arimaForecastingMetrics"; + } + if (message.dimensionalityReductionMetrics != null && Object.hasOwnProperty.call(message, "dimensionalityReductionMetrics")) { + object.dimensionalityReductionMetrics = $root.google.cloud.bigquery.v2.Model.DimensionalityReductionMetrics.toObject(message.dimensionalityReductionMetrics, options, q + 1); + if (options.oneofs) + object.metrics = "dimensionalityReductionMetrics"; + } + return object; + }; + + /** + * Converts this EvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + EvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.EvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.EvaluationMetrics"; + }; + + return EvaluationMetrics; + })(); + + Model.DataSplitResult = (function() { + + /** + * Properties of a DataSplitResult. + * @memberof google.cloud.bigquery.v2.Model + * @interface IDataSplitResult + * @property {google.cloud.bigquery.v2.ITableReference|null} [trainingTable] DataSplitResult trainingTable + * @property {google.cloud.bigquery.v2.ITableReference|null} [evaluationTable] DataSplitResult evaluationTable + * @property {google.cloud.bigquery.v2.ITableReference|null} [testTable] DataSplitResult testTable + */ + + /** + * Constructs a new DataSplitResult. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a DataSplitResult. + * @implements IDataSplitResult + * @constructor + * @param {google.cloud.bigquery.v2.Model.IDataSplitResult=} [properties] Properties to set + */ + function DataSplitResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSplitResult trainingTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} trainingTable + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @instance + */ + DataSplitResult.prototype.trainingTable = null; + + /** + * DataSplitResult evaluationTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} evaluationTable + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @instance + */ + DataSplitResult.prototype.evaluationTable = null; + + /** + * DataSplitResult testTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} testTable + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @instance + */ + DataSplitResult.prototype.testTable = null; + + /** + * Creates a new DataSplitResult instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {google.cloud.bigquery.v2.Model.IDataSplitResult=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.DataSplitResult} DataSplitResult instance + */ + DataSplitResult.create = function create(properties) { + return new DataSplitResult(properties); + }; + + /** + * Encodes the specified DataSplitResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DataSplitResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {google.cloud.bigquery.v2.Model.IDataSplitResult} message DataSplitResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSplitResult.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.trainingTable != null && Object.hasOwnProperty.call(message, "trainingTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.trainingTable, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.evaluationTable != null && Object.hasOwnProperty.call(message, "evaluationTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.evaluationTable, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.testTable != null && Object.hasOwnProperty.call(message, "testTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.testTable, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSplitResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DataSplitResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {google.cloud.bigquery.v2.Model.IDataSplitResult} message DataSplitResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSplitResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DataSplitResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.DataSplitResult} DataSplitResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSplitResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.DataSplitResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trainingTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.evaluationTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.testTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DataSplitResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.DataSplitResult} DataSplitResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSplitResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSplitResult message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSplitResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trainingTable != null && Object.hasOwnProperty.call(message, "trainingTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.trainingTable, long + 1); + if (error) + return "trainingTable." + error; + } + if (message.evaluationTable != null && Object.hasOwnProperty.call(message, "evaluationTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.evaluationTable, long + 1); + if (error) + return "evaluationTable." + error; + } + if (message.testTable != null && Object.hasOwnProperty.call(message, "testTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.testTable, long + 1); + if (error) + return "testTable." + error; + } + return null; + }; + + /** + * Creates a DataSplitResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.DataSplitResult} DataSplitResult + */ + DataSplitResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.DataSplitResult) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.DataSplitResult: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.DataSplitResult(); + if (object.trainingTable != null) { + if (!$util.isObject(object.trainingTable)) + throw TypeError(".google.cloud.bigquery.v2.Model.DataSplitResult.trainingTable: object expected"); + message.trainingTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.trainingTable, long + 1); + } + if (object.evaluationTable != null) { + if (!$util.isObject(object.evaluationTable)) + throw TypeError(".google.cloud.bigquery.v2.Model.DataSplitResult.evaluationTable: object expected"); + message.evaluationTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.evaluationTable, long + 1); + } + if (object.testTable != null) { + if (!$util.isObject(object.testTable)) + throw TypeError(".google.cloud.bigquery.v2.Model.DataSplitResult.testTable: object expected"); + message.testTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.testTable, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DataSplitResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {google.cloud.bigquery.v2.Model.DataSplitResult} message DataSplitResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSplitResult.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.trainingTable = null; + object.evaluationTable = null; + object.testTable = null; + } + if (message.trainingTable != null && Object.hasOwnProperty.call(message, "trainingTable")) + object.trainingTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.trainingTable, options, q + 1); + if (message.evaluationTable != null && Object.hasOwnProperty.call(message, "evaluationTable")) + object.evaluationTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.evaluationTable, options, q + 1); + if (message.testTable != null && Object.hasOwnProperty.call(message, "testTable")) + object.testTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.testTable, options, q + 1); + return object; + }; + + /** + * Converts this DataSplitResult to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @instance + * @returns {Object.} JSON object + */ + DataSplitResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSplitResult + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.DataSplitResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSplitResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.DataSplitResult"; + }; + + return DataSplitResult; + })(); + + Model.ArimaOrder = (function() { + + /** + * Properties of an ArimaOrder. + * @memberof google.cloud.bigquery.v2.Model + * @interface IArimaOrder + * @property {google.protobuf.IInt64Value|null} [p] ArimaOrder p + * @property {google.protobuf.IInt64Value|null} [d] ArimaOrder d + * @property {google.protobuf.IInt64Value|null} [q] ArimaOrder q + */ + + /** + * Constructs a new ArimaOrder. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an ArimaOrder. + * @implements IArimaOrder + * @constructor + * @param {google.cloud.bigquery.v2.Model.IArimaOrder=} [properties] Properties to set + */ + function ArimaOrder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaOrder p. + * @member {google.protobuf.IInt64Value|null|undefined} p + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @instance + */ + ArimaOrder.prototype.p = null; + + /** + * ArimaOrder d. + * @member {google.protobuf.IInt64Value|null|undefined} d + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @instance + */ + ArimaOrder.prototype.d = null; + + /** + * ArimaOrder q. + * @member {google.protobuf.IInt64Value|null|undefined} q + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @instance + */ + ArimaOrder.prototype.q = null; + + /** + * Creates a new ArimaOrder instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaOrder=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ArimaOrder} ArimaOrder instance + */ + ArimaOrder.create = function create(properties) { + return new ArimaOrder(properties); + }; + + /** + * Encodes the specified ArimaOrder message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaOrder.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaOrder} message ArimaOrder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaOrder.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.p != null && Object.hasOwnProperty.call(message, "p")) + $root.google.protobuf.Int64Value.encode(message.p, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.d != null && Object.hasOwnProperty.call(message, "d")) + $root.google.protobuf.Int64Value.encode(message.d, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.q != null && Object.hasOwnProperty.call(message, "q")) + $root.google.protobuf.Int64Value.encode(message.q, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArimaOrder message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaOrder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaOrder} message ArimaOrder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaOrder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaOrder message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ArimaOrder} ArimaOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaOrder.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ArimaOrder(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.p = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.d = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.q = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaOrder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ArimaOrder} ArimaOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaOrder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaOrder message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaOrder.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.p != null && Object.hasOwnProperty.call(message, "p")) { + var error = $root.google.protobuf.Int64Value.verify(message.p, long + 1); + if (error) + return "p." + error; + } + if (message.d != null && Object.hasOwnProperty.call(message, "d")) { + var error = $root.google.protobuf.Int64Value.verify(message.d, long + 1); + if (error) + return "d." + error; + } + if (message.q != null && Object.hasOwnProperty.call(message, "q")) { + var error = $root.google.protobuf.Int64Value.verify(message.q, long + 1); + if (error) + return "q." + error; + } + return null; + }; + + /** + * Creates an ArimaOrder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ArimaOrder} ArimaOrder + */ + ArimaOrder.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ArimaOrder) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaOrder: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ArimaOrder(); + if (object.p != null) { + if (!$util.isObject(object.p)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaOrder.p: object expected"); + message.p = $root.google.protobuf.Int64Value.fromObject(object.p, long + 1); + } + if (object.d != null) { + if (!$util.isObject(object.d)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaOrder.d: object expected"); + message.d = $root.google.protobuf.Int64Value.fromObject(object.d, long + 1); + } + if (object.q != null) { + if (!$util.isObject(object.q)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaOrder.q: object expected"); + message.q = $root.google.protobuf.Int64Value.fromObject(object.q, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ArimaOrder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaOrder} message ArimaOrder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaOrder.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.p = null; + object.d = null; + object.q = null; + } + if (message.p != null && Object.hasOwnProperty.call(message, "p")) + object.p = $root.google.protobuf.Int64Value.toObject(message.p, options, q + 1); + if (message.d != null && Object.hasOwnProperty.call(message, "d")) + object.d = $root.google.protobuf.Int64Value.toObject(message.d, options, q + 1); + if (message.q != null && Object.hasOwnProperty.call(message, "q")) + object.q = $root.google.protobuf.Int64Value.toObject(message.q, options, q + 1); + return object; + }; + + /** + * Converts this ArimaOrder to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @instance + * @returns {Object.} JSON object + */ + ArimaOrder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaOrder + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ArimaOrder + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ArimaOrder"; + }; + + return ArimaOrder; + })(); + + Model.ArimaFittingMetrics = (function() { + + /** + * Properties of an ArimaFittingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @interface IArimaFittingMetrics + * @property {google.protobuf.IDoubleValue|null} [logLikelihood] ArimaFittingMetrics logLikelihood + * @property {google.protobuf.IDoubleValue|null} [aic] ArimaFittingMetrics aic + * @property {google.protobuf.IDoubleValue|null} [variance] ArimaFittingMetrics variance + */ + + /** + * Constructs a new ArimaFittingMetrics. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an ArimaFittingMetrics. + * @implements IArimaFittingMetrics + * @constructor + * @param {google.cloud.bigquery.v2.Model.IArimaFittingMetrics=} [properties] Properties to set + */ + function ArimaFittingMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaFittingMetrics logLikelihood. + * @member {google.protobuf.IDoubleValue|null|undefined} logLikelihood + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @instance + */ + ArimaFittingMetrics.prototype.logLikelihood = null; + + /** + * ArimaFittingMetrics aic. + * @member {google.protobuf.IDoubleValue|null|undefined} aic + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @instance + */ + ArimaFittingMetrics.prototype.aic = null; + + /** + * ArimaFittingMetrics variance. + * @member {google.protobuf.IDoubleValue|null|undefined} variance + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @instance + */ + ArimaFittingMetrics.prototype.variance = null; + + /** + * Creates a new ArimaFittingMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaFittingMetrics=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ArimaFittingMetrics} ArimaFittingMetrics instance + */ + ArimaFittingMetrics.create = function create(properties) { + return new ArimaFittingMetrics(properties); + }; + + /** + * Encodes the specified ArimaFittingMetrics message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaFittingMetrics} message ArimaFittingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaFittingMetrics.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logLikelihood != null && Object.hasOwnProperty.call(message, "logLikelihood")) + $root.google.protobuf.DoubleValue.encode(message.logLikelihood, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.aic != null && Object.hasOwnProperty.call(message, "aic")) + $root.google.protobuf.DoubleValue.encode(message.aic, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.variance != null && Object.hasOwnProperty.call(message, "variance")) + $root.google.protobuf.DoubleValue.encode(message.variance, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArimaFittingMetrics message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.IArimaFittingMetrics} message ArimaFittingMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaFittingMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaFittingMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ArimaFittingMetrics} ArimaFittingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaFittingMetrics.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logLikelihood = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.aic = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.variance = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaFittingMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ArimaFittingMetrics} ArimaFittingMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaFittingMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaFittingMetrics message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaFittingMetrics.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logLikelihood != null && Object.hasOwnProperty.call(message, "logLikelihood")) { + var error = $root.google.protobuf.DoubleValue.verify(message.logLikelihood, long + 1); + if (error) + return "logLikelihood." + error; + } + if (message.aic != null && Object.hasOwnProperty.call(message, "aic")) { + var error = $root.google.protobuf.DoubleValue.verify(message.aic, long + 1); + if (error) + return "aic." + error; + } + if (message.variance != null && Object.hasOwnProperty.call(message, "variance")) { + var error = $root.google.protobuf.DoubleValue.verify(message.variance, long + 1); + if (error) + return "variance." + error; + } + return null; + }; + + /** + * Creates an ArimaFittingMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ArimaFittingMetrics} ArimaFittingMetrics + */ + ArimaFittingMetrics.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaFittingMetrics: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics(); + if (object.logLikelihood != null) { + if (!$util.isObject(object.logLikelihood)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaFittingMetrics.logLikelihood: object expected"); + message.logLikelihood = $root.google.protobuf.DoubleValue.fromObject(object.logLikelihood, long + 1); + } + if (object.aic != null) { + if (!$util.isObject(object.aic)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaFittingMetrics.aic: object expected"); + message.aic = $root.google.protobuf.DoubleValue.fromObject(object.aic, long + 1); + } + if (object.variance != null) { + if (!$util.isObject(object.variance)) + throw TypeError(".google.cloud.bigquery.v2.Model.ArimaFittingMetrics.variance: object expected"); + message.variance = $root.google.protobuf.DoubleValue.fromObject(object.variance, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ArimaFittingMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {google.cloud.bigquery.v2.Model.ArimaFittingMetrics} message ArimaFittingMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaFittingMetrics.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.logLikelihood = null; + object.aic = null; + object.variance = null; + } + if (message.logLikelihood != null && Object.hasOwnProperty.call(message, "logLikelihood")) + object.logLikelihood = $root.google.protobuf.DoubleValue.toObject(message.logLikelihood, options, q + 1); + if (message.aic != null && Object.hasOwnProperty.call(message, "aic")) + object.aic = $root.google.protobuf.DoubleValue.toObject(message.aic, options, q + 1); + if (message.variance != null && Object.hasOwnProperty.call(message, "variance")) + object.variance = $root.google.protobuf.DoubleValue.toObject(message.variance, options, q + 1); + return object; + }; + + /** + * Converts this ArimaFittingMetrics to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @instance + * @returns {Object.} JSON object + */ + ArimaFittingMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaFittingMetrics + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ArimaFittingMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaFittingMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ArimaFittingMetrics"; + }; + + return ArimaFittingMetrics; + })(); + + Model.GlobalExplanation = (function() { + + /** + * Properties of a GlobalExplanation. + * @memberof google.cloud.bigquery.v2.Model + * @interface IGlobalExplanation + * @property {Array.|null} [explanations] GlobalExplanation explanations + * @property {string|null} [classLabel] GlobalExplanation classLabel + */ + + /** + * Constructs a new GlobalExplanation. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a GlobalExplanation. + * @implements IGlobalExplanation + * @constructor + * @param {google.cloud.bigquery.v2.Model.IGlobalExplanation=} [properties] Properties to set + */ + function GlobalExplanation(properties) { + this.explanations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalExplanation explanations. + * @member {Array.} explanations + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @instance + */ + GlobalExplanation.prototype.explanations = $util.emptyArray; + + /** + * GlobalExplanation classLabel. + * @member {string} classLabel + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @instance + */ + GlobalExplanation.prototype.classLabel = ""; + + /** + * Creates a new GlobalExplanation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {google.cloud.bigquery.v2.Model.IGlobalExplanation=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation} GlobalExplanation instance + */ + GlobalExplanation.create = function create(properties) { + return new GlobalExplanation(properties); + }; + + /** + * Encodes the specified GlobalExplanation message. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {google.cloud.bigquery.v2.Model.IGlobalExplanation} message GlobalExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalExplanation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.explanations != null && message.explanations.length) + for (var i = 0; i < message.explanations.length; ++i) + $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.encode(message.explanations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.classLabel != null && Object.hasOwnProperty.call(message, "classLabel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.classLabel); + return writer; + }; + + /** + * Encodes the specified GlobalExplanation message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {google.cloud.bigquery.v2.Model.IGlobalExplanation} message GlobalExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalExplanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GlobalExplanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation} GlobalExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalExplanation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.GlobalExplanation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.explanations && message.explanations.length)) + message.explanations = []; + message.explanations.push($root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.classLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalExplanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation} GlobalExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalExplanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalExplanation message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalExplanation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.explanations != null && Object.hasOwnProperty.call(message, "explanations")) { + if (!Array.isArray(message.explanations)) + return "explanations: array expected"; + for (var i = 0; i < message.explanations.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.verify(message.explanations[i], long + 1); + if (error) + return "explanations." + error; + } + } + if (message.classLabel != null && Object.hasOwnProperty.call(message, "classLabel")) + if (!$util.isString(message.classLabel)) + return "classLabel: string expected"; + return null; + }; + + /** + * Creates a GlobalExplanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation} GlobalExplanation + */ + GlobalExplanation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.GlobalExplanation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.GlobalExplanation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.GlobalExplanation(); + if (object.explanations) { + if (!Array.isArray(object.explanations)) + throw TypeError(".google.cloud.bigquery.v2.Model.GlobalExplanation.explanations: array expected"); + message.explanations = []; + for (var i = 0; i < object.explanations.length; ++i) { + if (!$util.isObject(object.explanations[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.GlobalExplanation.explanations: object expected"); + message.explanations[i] = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.fromObject(object.explanations[i], long + 1); + } + } + if (object.classLabel != null) + message.classLabel = String(object.classLabel); + return message; + }; + + /** + * Creates a plain object from a GlobalExplanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation} message GlobalExplanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalExplanation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.explanations = []; + if (options.defaults) + object.classLabel = ""; + if (message.explanations && message.explanations.length) { + object.explanations = []; + for (var j = 0; j < message.explanations.length; ++j) + object.explanations[j] = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.toObject(message.explanations[j], options, q + 1); + } + if (message.classLabel != null && Object.hasOwnProperty.call(message, "classLabel")) + object.classLabel = message.classLabel; + return object; + }; + + /** + * Converts this GlobalExplanation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @instance + * @returns {Object.} JSON object + */ + GlobalExplanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GlobalExplanation + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GlobalExplanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.GlobalExplanation"; + }; + + GlobalExplanation.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @interface IExplanation + * @property {string|null} [featureName] Explanation featureName + * @property {google.protobuf.IDoubleValue|null} [attribution] Explanation attribution + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Explanation featureName. + * @member {string} featureName + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @instance + */ + Explanation.prototype.featureName = ""; + + /** + * Explanation attribution. + * @member {google.protobuf.IDoubleValue|null|undefined} attribution + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @instance + */ + Explanation.prototype.attribution = null; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.featureName != null && Object.hasOwnProperty.call(message, "featureName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureName); + if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution")) + $root.google.protobuf.DoubleValue.encode(message.attribution, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.featureName = reader.string(); + break; + } + case 2: { + message.attribution = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.featureName != null && Object.hasOwnProperty.call(message, "featureName")) + if (!$util.isString(message.featureName)) + return "featureName: string expected"; + if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution")) { + var error = $root.google.protobuf.DoubleValue.verify(message.attribution, long + 1); + if (error) + return "attribution." + error; + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation(); + if (object.featureName != null) + message.featureName = String(object.featureName); + if (object.attribution != null) { + if (!$util.isObject(object.attribution)) + throw TypeError(".google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation.attribution: object expected"); + message.attribution = $root.google.protobuf.DoubleValue.fromObject(object.attribution, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.featureName = ""; + object.attribution = null; + } + if (message.featureName != null && Object.hasOwnProperty.call(message, "featureName")) + object.featureName = message.featureName; + if (message.attribution != null && Object.hasOwnProperty.call(message, "attribution")) + object.attribution = $root.google.protobuf.DoubleValue.toObject(message.attribution, options, q + 1); + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Explanation + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.GlobalExplanation.Explanation"; + }; + + return Explanation; + })(); + + return GlobalExplanation; + })(); + + Model.CategoryEncodingMethod = (function() { + + /** + * Properties of a CategoryEncodingMethod. + * @memberof google.cloud.bigquery.v2.Model + * @interface ICategoryEncodingMethod + */ + + /** + * Constructs a new CategoryEncodingMethod. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a CategoryEncodingMethod. + * @implements ICategoryEncodingMethod + * @constructor + * @param {google.cloud.bigquery.v2.Model.ICategoryEncodingMethod=} [properties] Properties to set + */ + function CategoryEncodingMethod(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CategoryEncodingMethod instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {google.cloud.bigquery.v2.Model.ICategoryEncodingMethod=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.CategoryEncodingMethod} CategoryEncodingMethod instance + */ + CategoryEncodingMethod.create = function create(properties) { + return new CategoryEncodingMethod(properties); + }; + + /** + * Encodes the specified CategoryEncodingMethod message. Does not implicitly {@link google.cloud.bigquery.v2.Model.CategoryEncodingMethod.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {google.cloud.bigquery.v2.Model.ICategoryEncodingMethod} message CategoryEncodingMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryEncodingMethod.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified CategoryEncodingMethod message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.CategoryEncodingMethod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {google.cloud.bigquery.v2.Model.ICategoryEncodingMethod} message CategoryEncodingMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryEncodingMethod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CategoryEncodingMethod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.CategoryEncodingMethod} CategoryEncodingMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryEncodingMethod.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.CategoryEncodingMethod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryEncodingMethod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.CategoryEncodingMethod} CategoryEncodingMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryEncodingMethod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryEncodingMethod message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryEncodingMethod.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a CategoryEncodingMethod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.CategoryEncodingMethod} CategoryEncodingMethod + */ + CategoryEncodingMethod.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.CategoryEncodingMethod) + return object; + return new $root.google.cloud.bigquery.v2.Model.CategoryEncodingMethod(); + }; + + /** + * Creates a plain object from a CategoryEncodingMethod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {google.cloud.bigquery.v2.Model.CategoryEncodingMethod} message CategoryEncodingMethod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryEncodingMethod.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CategoryEncodingMethod to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @instance + * @returns {Object.} JSON object + */ + CategoryEncodingMethod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryEncodingMethod + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.CategoryEncodingMethod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryEncodingMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.CategoryEncodingMethod"; + }; + + /** + * EncodingMethod enum. + * @name google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod + * @enum {number} + * @property {number} ENCODING_METHOD_UNSPECIFIED=0 ENCODING_METHOD_UNSPECIFIED value + * @property {number} ONE_HOT_ENCODING=1 ONE_HOT_ENCODING value + * @property {number} LABEL_ENCODING=2 LABEL_ENCODING value + * @property {number} DUMMY_ENCODING=3 DUMMY_ENCODING value + */ + CategoryEncodingMethod.EncodingMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCODING_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_HOT_ENCODING"] = 1; + values[valuesById[2] = "LABEL_ENCODING"] = 2; + values[valuesById[3] = "DUMMY_ENCODING"] = 3; + return values; + })(); + + return CategoryEncodingMethod; + })(); + + Model.PcaSolverOptionEnums = (function() { + + /** + * Properties of a PcaSolverOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @interface IPcaSolverOptionEnums + */ + + /** + * Constructs a new PcaSolverOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a PcaSolverOptionEnums. + * @implements IPcaSolverOptionEnums + * @constructor + * @param {google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums=} [properties] Properties to set + */ + function PcaSolverOptionEnums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new PcaSolverOptionEnums instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums} PcaSolverOptionEnums instance + */ + PcaSolverOptionEnums.create = function create(properties) { + return new PcaSolverOptionEnums(properties); + }; + + /** + * Encodes the specified PcaSolverOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums} message PcaSolverOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PcaSolverOptionEnums.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified PcaSolverOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IPcaSolverOptionEnums} message PcaSolverOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PcaSolverOptionEnums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PcaSolverOptionEnums message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums} PcaSolverOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PcaSolverOptionEnums.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.PcaSolverOptionEnums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PcaSolverOptionEnums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums} PcaSolverOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PcaSolverOptionEnums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PcaSolverOptionEnums message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PcaSolverOptionEnums.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a PcaSolverOptionEnums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums} PcaSolverOptionEnums + */ + PcaSolverOptionEnums.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.PcaSolverOptionEnums) + return object; + return new $root.google.cloud.bigquery.v2.Model.PcaSolverOptionEnums(); + }; + + /** + * Creates a plain object from a PcaSolverOptionEnums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums} message PcaSolverOptionEnums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PcaSolverOptionEnums.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PcaSolverOptionEnums to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @instance + * @returns {Object.} JSON object + */ + PcaSolverOptionEnums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PcaSolverOptionEnums + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.PcaSolverOptionEnums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PcaSolverOptionEnums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.PcaSolverOptionEnums"; + }; + + /** + * PcaSolver enum. + * @name google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} RANDOMIZED=2 RANDOMIZED value + * @property {number} AUTO=3 AUTO value + */ + PcaSolverOptionEnums.PcaSolver = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "RANDOMIZED"] = 2; + values[valuesById[3] = "AUTO"] = 3; + return values; + })(); + + return PcaSolverOptionEnums; + })(); + + Model.ModelRegistryOptionEnums = (function() { + + /** + * Properties of a ModelRegistryOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @interface IModelRegistryOptionEnums + */ + + /** + * Constructs a new ModelRegistryOptionEnums. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a ModelRegistryOptionEnums. + * @implements IModelRegistryOptionEnums + * @constructor + * @param {google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums=} [properties] Properties to set + */ + function ModelRegistryOptionEnums(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ModelRegistryOptionEnums instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums} ModelRegistryOptionEnums instance + */ + ModelRegistryOptionEnums.create = function create(properties) { + return new ModelRegistryOptionEnums(properties); + }; + + /** + * Encodes the specified ModelRegistryOptionEnums message. Does not implicitly {@link google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums} message ModelRegistryOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelRegistryOptionEnums.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified ModelRegistryOptionEnums message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.IModelRegistryOptionEnums} message ModelRegistryOptionEnums message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelRegistryOptionEnums.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ModelRegistryOptionEnums message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums} ModelRegistryOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelRegistryOptionEnums.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ModelRegistryOptionEnums message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums} ModelRegistryOptionEnums + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelRegistryOptionEnums.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelRegistryOptionEnums message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelRegistryOptionEnums.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ModelRegistryOptionEnums message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums} ModelRegistryOptionEnums + */ + ModelRegistryOptionEnums.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums) + return object; + return new $root.google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums(); + }; + + /** + * Creates a plain object from a ModelRegistryOptionEnums message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums} message ModelRegistryOptionEnums + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelRegistryOptionEnums.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ModelRegistryOptionEnums to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @instance + * @returns {Object.} JSON object + */ + ModelRegistryOptionEnums.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelRegistryOptionEnums + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelRegistryOptionEnums.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums"; + }; + + /** + * ModelRegistry enum. + * @name google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry + * @enum {number} + * @property {number} MODEL_REGISTRY_UNSPECIFIED=0 MODEL_REGISTRY_UNSPECIFIED value + * @property {number} VERTEX_AI=1 VERTEX_AI value + */ + ModelRegistryOptionEnums.ModelRegistry = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_REGISTRY_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERTEX_AI"] = 1; + return values; + })(); + + return ModelRegistryOptionEnums; + })(); + + Model.TrainingRun = (function() { + + /** + * Properties of a TrainingRun. + * @memberof google.cloud.bigquery.v2.Model + * @interface ITrainingRun + * @property {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null} [trainingOptions] TrainingRun trainingOptions + * @property {google.protobuf.ITimestamp|null} [startTime] TrainingRun startTime + * @property {Array.|null} [results] TrainingRun results + * @property {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null} [evaluationMetrics] TrainingRun evaluationMetrics + * @property {google.cloud.bigquery.v2.Model.IDataSplitResult|null} [dataSplitResult] TrainingRun dataSplitResult + * @property {google.cloud.bigquery.v2.Model.IGlobalExplanation|null} [modelLevelGlobalExplanation] TrainingRun modelLevelGlobalExplanation + * @property {Array.|null} [classLevelGlobalExplanations] TrainingRun classLevelGlobalExplanations + * @property {string|null} [vertexAiModelId] TrainingRun vertexAiModelId + * @property {string|null} [vertexAiModelVersion] TrainingRun vertexAiModelVersion + */ + + /** + * Constructs a new TrainingRun. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a TrainingRun. + * @implements ITrainingRun + * @constructor + * @param {google.cloud.bigquery.v2.Model.ITrainingRun=} [properties] Properties to set + */ + function TrainingRun(properties) { + this.results = []; + this.classLevelGlobalExplanations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainingRun trainingOptions. + * @member {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null|undefined} trainingOptions + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.trainingOptions = null; + + /** + * TrainingRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.startTime = null; + + /** + * TrainingRun results. + * @member {Array.} results + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.results = $util.emptyArray; + + /** + * TrainingRun evaluationMetrics. + * @member {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null|undefined} evaluationMetrics + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.evaluationMetrics = null; + + /** + * TrainingRun dataSplitResult. + * @member {google.cloud.bigquery.v2.Model.IDataSplitResult|null|undefined} dataSplitResult + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.dataSplitResult = null; + + /** + * TrainingRun modelLevelGlobalExplanation. + * @member {google.cloud.bigquery.v2.Model.IGlobalExplanation|null|undefined} modelLevelGlobalExplanation + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.modelLevelGlobalExplanation = null; + + /** + * TrainingRun classLevelGlobalExplanations. + * @member {Array.} classLevelGlobalExplanations + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.classLevelGlobalExplanations = $util.emptyArray; + + /** + * TrainingRun vertexAiModelId. + * @member {string} vertexAiModelId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.vertexAiModelId = ""; + + /** + * TrainingRun vertexAiModelVersion. + * @member {string} vertexAiModelVersion + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + */ + TrainingRun.prototype.vertexAiModelVersion = ""; + + /** + * Creates a new TrainingRun instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {google.cloud.bigquery.v2.Model.ITrainingRun=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun} TrainingRun instance + */ + TrainingRun.create = function create(properties) { + return new TrainingRun(properties); + }; + + /** + * Encodes the specified TrainingRun message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {google.cloud.bigquery.v2.Model.ITrainingRun} message TrainingRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingRun.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.trainingOptions != null && Object.hasOwnProperty.call(message, "trainingOptions")) + $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.encode(message.trainingOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.encode(message.results[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) + $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.encode(message.evaluationMetrics, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.dataSplitResult != null && Object.hasOwnProperty.call(message, "dataSplitResult")) + $root.google.cloud.bigquery.v2.Model.DataSplitResult.encode(message.dataSplitResult, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.modelLevelGlobalExplanation != null && Object.hasOwnProperty.call(message, "modelLevelGlobalExplanation")) + $root.google.cloud.bigquery.v2.Model.GlobalExplanation.encode(message.modelLevelGlobalExplanation, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.classLevelGlobalExplanations != null && message.classLevelGlobalExplanations.length) + for (var i = 0; i < message.classLevelGlobalExplanations.length; ++i) + $root.google.cloud.bigquery.v2.Model.GlobalExplanation.encode(message.classLevelGlobalExplanations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.vertexAiModelId != null && Object.hasOwnProperty.call(message, "vertexAiModelId")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.vertexAiModelId); + if (message.vertexAiModelVersion != null && Object.hasOwnProperty.call(message, "vertexAiModelVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.vertexAiModelVersion); + return writer; + }; + + /** + * Encodes the specified TrainingRun message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {google.cloud.bigquery.v2.Model.ITrainingRun} message TrainingRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TrainingRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun} TrainingRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingRun.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trainingOptions = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.dataSplitResult = $root.google.cloud.bigquery.v2.Model.DataSplitResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.modelLevelGlobalExplanation = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + if (!(message.classLevelGlobalExplanations && message.classLevelGlobalExplanations.length)) + message.classLevelGlobalExplanations = []; + message.classLevelGlobalExplanations.push($root.google.cloud.bigquery.v2.Model.GlobalExplanation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 14: { + message.vertexAiModelId = reader.string(); + break; + } + case 15: { + message.vertexAiModelVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainingRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun} TrainingRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainingRun message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingRun.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trainingOptions != null && Object.hasOwnProperty.call(message, "trainingOptions")) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify(message.trainingOptions, long + 1); + if (error) + return "trainingOptions." + error; + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.results != null && Object.hasOwnProperty.call(message, "results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify(message.results[i], long + 1); + if (error) + return "results." + error; + } + } + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.verify(message.evaluationMetrics, long + 1); + if (error) + return "evaluationMetrics." + error; + } + if (message.dataSplitResult != null && Object.hasOwnProperty.call(message, "dataSplitResult")) { + var error = $root.google.cloud.bigquery.v2.Model.DataSplitResult.verify(message.dataSplitResult, long + 1); + if (error) + return "dataSplitResult." + error; + } + if (message.modelLevelGlobalExplanation != null && Object.hasOwnProperty.call(message, "modelLevelGlobalExplanation")) { + var error = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.verify(message.modelLevelGlobalExplanation, long + 1); + if (error) + return "modelLevelGlobalExplanation." + error; + } + if (message.classLevelGlobalExplanations != null && Object.hasOwnProperty.call(message, "classLevelGlobalExplanations")) { + if (!Array.isArray(message.classLevelGlobalExplanations)) + return "classLevelGlobalExplanations: array expected"; + for (var i = 0; i < message.classLevelGlobalExplanations.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.verify(message.classLevelGlobalExplanations[i], long + 1); + if (error) + return "classLevelGlobalExplanations." + error; + } + } + if (message.vertexAiModelId != null && Object.hasOwnProperty.call(message, "vertexAiModelId")) + if (!$util.isString(message.vertexAiModelId)) + return "vertexAiModelId: string expected"; + if (message.vertexAiModelVersion != null && Object.hasOwnProperty.call(message, "vertexAiModelVersion")) + if (!$util.isString(message.vertexAiModelVersion)) + return "vertexAiModelVersion: string expected"; + return null; + }; + + /** + * Creates a TrainingRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun} TrainingRun + */ + TrainingRun.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun(); + if (object.trainingOptions != null) { + if (!$util.isObject(object.trainingOptions)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.trainingOptions: object expected"); + message.trainingOptions = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.fromObject(object.trainingOptions, long + 1); + } + if (object.startTime != null) { + if (!$util.isObject(object.startTime)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (!$util.isObject(object.results[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.results: object expected"); + message.results[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.fromObject(object.results[i], long + 1); + } + } + if (object.evaluationMetrics != null) { + if (!$util.isObject(object.evaluationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.evaluationMetrics: object expected"); + message.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.fromObject(object.evaluationMetrics, long + 1); + } + if (object.dataSplitResult != null) { + if (!$util.isObject(object.dataSplitResult)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.dataSplitResult: object expected"); + message.dataSplitResult = $root.google.cloud.bigquery.v2.Model.DataSplitResult.fromObject(object.dataSplitResult, long + 1); + } + if (object.modelLevelGlobalExplanation != null) { + if (!$util.isObject(object.modelLevelGlobalExplanation)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.modelLevelGlobalExplanation: object expected"); + message.modelLevelGlobalExplanation = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.fromObject(object.modelLevelGlobalExplanation, long + 1); + } + if (object.classLevelGlobalExplanations) { + if (!Array.isArray(object.classLevelGlobalExplanations)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.classLevelGlobalExplanations: array expected"); + message.classLevelGlobalExplanations = []; + for (var i = 0; i < object.classLevelGlobalExplanations.length; ++i) { + if (!$util.isObject(object.classLevelGlobalExplanations[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.classLevelGlobalExplanations: object expected"); + message.classLevelGlobalExplanations[i] = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.fromObject(object.classLevelGlobalExplanations[i], long + 1); + } + } + if (object.vertexAiModelId != null) + message.vertexAiModelId = String(object.vertexAiModelId); + if (object.vertexAiModelVersion != null) + message.vertexAiModelVersion = String(object.vertexAiModelVersion); + return message; + }; + + /** + * Creates a plain object from a TrainingRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun} message TrainingRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingRun.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.classLevelGlobalExplanations = []; + } + if (options.defaults) { + object.trainingOptions = null; + object.evaluationMetrics = null; + object.startTime = null; + object.dataSplitResult = null; + object.modelLevelGlobalExplanation = null; + object.vertexAiModelId = ""; + object.vertexAiModelVersion = ""; + } + if (message.trainingOptions != null && Object.hasOwnProperty.call(message, "trainingOptions")) + object.trainingOptions = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.toObject(message.trainingOptions, options, q + 1); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.toObject(message.results[j], options, q + 1); + } + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) + object.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.toObject(message.evaluationMetrics, options, q + 1); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.dataSplitResult != null && Object.hasOwnProperty.call(message, "dataSplitResult")) + object.dataSplitResult = $root.google.cloud.bigquery.v2.Model.DataSplitResult.toObject(message.dataSplitResult, options, q + 1); + if (message.modelLevelGlobalExplanation != null && Object.hasOwnProperty.call(message, "modelLevelGlobalExplanation")) + object.modelLevelGlobalExplanation = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.toObject(message.modelLevelGlobalExplanation, options, q + 1); + if (message.classLevelGlobalExplanations && message.classLevelGlobalExplanations.length) { + object.classLevelGlobalExplanations = []; + for (var j = 0; j < message.classLevelGlobalExplanations.length; ++j) + object.classLevelGlobalExplanations[j] = $root.google.cloud.bigquery.v2.Model.GlobalExplanation.toObject(message.classLevelGlobalExplanations[j], options, q + 1); + } + if (message.vertexAiModelId != null && Object.hasOwnProperty.call(message, "vertexAiModelId")) + object.vertexAiModelId = message.vertexAiModelId; + if (message.vertexAiModelVersion != null && Object.hasOwnProperty.call(message, "vertexAiModelVersion")) + object.vertexAiModelVersion = message.vertexAiModelVersion; + return object; + }; + + /** + * Converts this TrainingRun to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @instance + * @returns {Object.} JSON object + */ + TrainingRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainingRun + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainingRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun"; + }; + + TrainingRun.TrainingOptions = (function() { + + /** + * Properties of a TrainingOptions. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @interface ITrainingOptions + * @property {number|Long|null} [maxIterations] TrainingOptions maxIterations + * @property {google.cloud.bigquery.v2.Model.LossType|null} [lossType] TrainingOptions lossType + * @property {number|null} [learnRate] TrainingOptions learnRate + * @property {google.protobuf.IDoubleValue|null} [l1Regularization] TrainingOptions l1Regularization + * @property {google.protobuf.IDoubleValue|null} [l2Regularization] TrainingOptions l2Regularization + * @property {google.protobuf.IDoubleValue|null} [minRelativeProgress] TrainingOptions minRelativeProgress + * @property {google.protobuf.IBoolValue|null} [warmStart] TrainingOptions warmStart + * @property {google.protobuf.IBoolValue|null} [earlyStop] TrainingOptions earlyStop + * @property {Array.|null} [inputLabelColumns] TrainingOptions inputLabelColumns + * @property {google.cloud.bigquery.v2.Model.DataSplitMethod|null} [dataSplitMethod] TrainingOptions dataSplitMethod + * @property {number|null} [dataSplitEvalFraction] TrainingOptions dataSplitEvalFraction + * @property {string|null} [dataSplitColumn] TrainingOptions dataSplitColumn + * @property {google.cloud.bigquery.v2.Model.LearnRateStrategy|null} [learnRateStrategy] TrainingOptions learnRateStrategy + * @property {number|null} [initialLearnRate] TrainingOptions initialLearnRate + * @property {Object.|null} [labelClassWeights] TrainingOptions labelClassWeights + * @property {string|null} [userColumn] TrainingOptions userColumn + * @property {string|null} [itemColumn] TrainingOptions itemColumn + * @property {google.cloud.bigquery.v2.Model.DistanceType|null} [distanceType] TrainingOptions distanceType + * @property {number|Long|null} [numClusters] TrainingOptions numClusters + * @property {string|null} [modelUri] TrainingOptions modelUri + * @property {google.cloud.bigquery.v2.Model.OptimizationStrategy|null} [optimizationStrategy] TrainingOptions optimizationStrategy + * @property {Array.|null} [hiddenUnits] TrainingOptions hiddenUnits + * @property {number|Long|null} [batchSize] TrainingOptions batchSize + * @property {google.protobuf.IDoubleValue|null} [dropout] TrainingOptions dropout + * @property {number|Long|null} [maxTreeDepth] TrainingOptions maxTreeDepth + * @property {number|null} [subsample] TrainingOptions subsample + * @property {google.protobuf.IDoubleValue|null} [minSplitLoss] TrainingOptions minSplitLoss + * @property {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType|null} [boosterType] TrainingOptions boosterType + * @property {google.protobuf.IInt64Value|null} [numParallelTree] TrainingOptions numParallelTree + * @property {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType|null} [dartNormalizeType] TrainingOptions dartNormalizeType + * @property {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod|null} [treeMethod] TrainingOptions treeMethod + * @property {google.protobuf.IInt64Value|null} [minTreeChildWeight] TrainingOptions minTreeChildWeight + * @property {google.protobuf.IDoubleValue|null} [colsampleBytree] TrainingOptions colsampleBytree + * @property {google.protobuf.IDoubleValue|null} [colsampleBylevel] TrainingOptions colsampleBylevel + * @property {google.protobuf.IDoubleValue|null} [colsampleBynode] TrainingOptions colsampleBynode + * @property {number|Long|null} [numFactors] TrainingOptions numFactors + * @property {google.cloud.bigquery.v2.Model.FeedbackType|null} [feedbackType] TrainingOptions feedbackType + * @property {google.protobuf.IDoubleValue|null} [walsAlpha] TrainingOptions walsAlpha + * @property {google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod|null} [kmeansInitializationMethod] TrainingOptions kmeansInitializationMethod + * @property {string|null} [kmeansInitializationColumn] TrainingOptions kmeansInitializationColumn + * @property {string|null} [timeSeriesTimestampColumn] TrainingOptions timeSeriesTimestampColumn + * @property {string|null} [timeSeriesDataColumn] TrainingOptions timeSeriesDataColumn + * @property {google.protobuf.IBoolValue|null} [autoArima] TrainingOptions autoArima + * @property {google.cloud.bigquery.v2.Model.IArimaOrder|null} [nonSeasonalOrder] TrainingOptions nonSeasonalOrder + * @property {google.cloud.bigquery.v2.Model.DataFrequency|null} [dataFrequency] TrainingOptions dataFrequency + * @property {google.protobuf.IBoolValue|null} [calculatePValues] TrainingOptions calculatePValues + * @property {google.protobuf.IBoolValue|null} [includeDrift] TrainingOptions includeDrift + * @property {google.cloud.bigquery.v2.Model.HolidayRegion|null} [holidayRegion] TrainingOptions holidayRegion + * @property {Array.|null} [holidayRegions] TrainingOptions holidayRegions + * @property {string|null} [timeSeriesIdColumn] TrainingOptions timeSeriesIdColumn + * @property {Array.|null} [timeSeriesIdColumns] TrainingOptions timeSeriesIdColumns + * @property {number|null} [forecastLimitLowerBound] TrainingOptions forecastLimitLowerBound + * @property {number|null} [forecastLimitUpperBound] TrainingOptions forecastLimitUpperBound + * @property {number|Long|null} [horizon] TrainingOptions horizon + * @property {number|Long|null} [autoArimaMaxOrder] TrainingOptions autoArimaMaxOrder + * @property {number|Long|null} [autoArimaMinOrder] TrainingOptions autoArimaMinOrder + * @property {number|Long|null} [numTrials] TrainingOptions numTrials + * @property {number|Long|null} [maxParallelTrials] TrainingOptions maxParallelTrials + * @property {Array.|null} [hparamTuningObjectives] TrainingOptions hparamTuningObjectives + * @property {google.protobuf.IBoolValue|null} [decomposeTimeSeries] TrainingOptions decomposeTimeSeries + * @property {google.protobuf.IBoolValue|null} [cleanSpikesAndDips] TrainingOptions cleanSpikesAndDips + * @property {google.protobuf.IBoolValue|null} [adjustStepChanges] TrainingOptions adjustStepChanges + * @property {google.protobuf.IBoolValue|null} [enableGlobalExplain] TrainingOptions enableGlobalExplain + * @property {number|Long|null} [sampledShapleyNumPaths] TrainingOptions sampledShapleyNumPaths + * @property {number|Long|null} [integratedGradientsNumSteps] TrainingOptions integratedGradientsNumSteps + * @property {google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod|null} [categoryEncodingMethod] TrainingOptions categoryEncodingMethod + * @property {string|null} [tfVersion] TrainingOptions tfVersion + * @property {google.cloud.bigquery.v2.Model.ColorSpace|null} [colorSpace] TrainingOptions colorSpace + * @property {string|null} [instanceWeightColumn] TrainingOptions instanceWeightColumn + * @property {number|Long|null} [trendSmoothingWindowSize] TrainingOptions trendSmoothingWindowSize + * @property {number|null} [timeSeriesLengthFraction] TrainingOptions timeSeriesLengthFraction + * @property {number|Long|null} [minTimeSeriesLength] TrainingOptions minTimeSeriesLength + * @property {number|Long|null} [maxTimeSeriesLength] TrainingOptions maxTimeSeriesLength + * @property {string|null} [xgboostVersion] TrainingOptions xgboostVersion + * @property {google.protobuf.IBoolValue|null} [approxGlobalFeatureContrib] TrainingOptions approxGlobalFeatureContrib + * @property {google.protobuf.IBoolValue|null} [fitIntercept] TrainingOptions fitIntercept + * @property {number|Long|null} [numPrincipalComponents] TrainingOptions numPrincipalComponents + * @property {number|null} [pcaExplainedVarianceRatio] TrainingOptions pcaExplainedVarianceRatio + * @property {google.protobuf.IBoolValue|null} [scaleFeatures] TrainingOptions scaleFeatures + * @property {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver|null} [pcaSolver] TrainingOptions pcaSolver + * @property {google.protobuf.IBoolValue|null} [autoClassWeights] TrainingOptions autoClassWeights + * @property {string|null} [activationFn] TrainingOptions activationFn + * @property {string|null} [optimizer] TrainingOptions optimizer + * @property {number|null} [budgetHours] TrainingOptions budgetHours + * @property {google.protobuf.IBoolValue|null} [standardizeFeatures] TrainingOptions standardizeFeatures + * @property {number|null} [l1RegActivation] TrainingOptions l1RegActivation + * @property {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry|null} [modelRegistry] TrainingOptions modelRegistry + * @property {Array.|null} [vertexAiModelVersionAliases] TrainingOptions vertexAiModelVersionAliases + * @property {Array.|null} [dimensionIdColumns] TrainingOptions dimensionIdColumns + * @property {string|null} [contributionMetric] TrainingOptions contributionMetric + * @property {string|null} [isTestColumn] TrainingOptions isTestColumn + * @property {number|null} [minAprioriSupport] TrainingOptions minAprioriSupport + * @property {string|null} [huggingFaceModelId] TrainingOptions huggingFaceModelId + * @property {string|null} [modelGardenModelName] TrainingOptions modelGardenModelName + * @property {google.protobuf.IDuration|null} [endpointIdleTtl] TrainingOptions endpointIdleTtl + * @property {string|null} [machineType] TrainingOptions machineType + * @property {number|Long|null} [minReplicaCount] TrainingOptions minReplicaCount + * @property {number|Long|null} [maxReplicaCount] TrainingOptions maxReplicaCount + * @property {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|null} [reservationAffinityType] TrainingOptions reservationAffinityType + * @property {string|null} [reservationAffinityKey] TrainingOptions reservationAffinityKey + * @property {Array.|null} [reservationAffinityValues] TrainingOptions reservationAffinityValues + */ + + /** + * Constructs a new TrainingOptions. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @classdesc Represents a TrainingOptions. + * @implements ITrainingOptions + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions=} [properties] Properties to set + */ + function TrainingOptions(properties) { + this.inputLabelColumns = []; + this.labelClassWeights = {}; + this.hiddenUnits = []; + this.holidayRegions = []; + this.timeSeriesIdColumns = []; + this.hparamTuningObjectives = []; + this.vertexAiModelVersionAliases = []; + this.dimensionIdColumns = []; + this.reservationAffinityValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainingOptions maxIterations. + * @member {number|Long} maxIterations + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.maxIterations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions lossType. + * @member {google.cloud.bigquery.v2.Model.LossType} lossType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.lossType = 0; + + /** + * TrainingOptions learnRate. + * @member {number} learnRate + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.learnRate = 0; + + /** + * TrainingOptions l1Regularization. + * @member {google.protobuf.IDoubleValue|null|undefined} l1Regularization + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.l1Regularization = null; + + /** + * TrainingOptions l2Regularization. + * @member {google.protobuf.IDoubleValue|null|undefined} l2Regularization + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.l2Regularization = null; + + /** + * TrainingOptions minRelativeProgress. + * @member {google.protobuf.IDoubleValue|null|undefined} minRelativeProgress + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minRelativeProgress = null; + + /** + * TrainingOptions warmStart. + * @member {google.protobuf.IBoolValue|null|undefined} warmStart + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.warmStart = null; + + /** + * TrainingOptions earlyStop. + * @member {google.protobuf.IBoolValue|null|undefined} earlyStop + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.earlyStop = null; + + /** + * TrainingOptions inputLabelColumns. + * @member {Array.} inputLabelColumns + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.inputLabelColumns = $util.emptyArray; + + /** + * TrainingOptions dataSplitMethod. + * @member {google.cloud.bigquery.v2.Model.DataSplitMethod} dataSplitMethod + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dataSplitMethod = 0; + + /** + * TrainingOptions dataSplitEvalFraction. + * @member {number} dataSplitEvalFraction + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dataSplitEvalFraction = 0; + + /** + * TrainingOptions dataSplitColumn. + * @member {string} dataSplitColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dataSplitColumn = ""; + + /** + * TrainingOptions learnRateStrategy. + * @member {google.cloud.bigquery.v2.Model.LearnRateStrategy} learnRateStrategy + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.learnRateStrategy = 0; + + /** + * TrainingOptions initialLearnRate. + * @member {number} initialLearnRate + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.initialLearnRate = 0; + + /** + * TrainingOptions labelClassWeights. + * @member {Object.} labelClassWeights + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.labelClassWeights = $util.emptyObject; + + /** + * TrainingOptions userColumn. + * @member {string} userColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.userColumn = ""; + + /** + * TrainingOptions itemColumn. + * @member {string} itemColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.itemColumn = ""; + + /** + * TrainingOptions distanceType. + * @member {google.cloud.bigquery.v2.Model.DistanceType} distanceType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.distanceType = 0; + + /** + * TrainingOptions numClusters. + * @member {number|Long} numClusters + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.numClusters = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions modelUri. + * @member {string} modelUri + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.modelUri = ""; + + /** + * TrainingOptions optimizationStrategy. + * @member {google.cloud.bigquery.v2.Model.OptimizationStrategy} optimizationStrategy + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.optimizationStrategy = 0; + + /** + * TrainingOptions hiddenUnits. + * @member {Array.} hiddenUnits + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.hiddenUnits = $util.emptyArray; + + /** + * TrainingOptions batchSize. + * @member {number|Long} batchSize + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.batchSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions dropout. + * @member {google.protobuf.IDoubleValue|null|undefined} dropout + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dropout = null; + + /** + * TrainingOptions maxTreeDepth. + * @member {number|Long} maxTreeDepth + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.maxTreeDepth = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions subsample. + * @member {number} subsample + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.subsample = 0; + + /** + * TrainingOptions minSplitLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} minSplitLoss + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minSplitLoss = null; + + /** + * TrainingOptions boosterType. + * @member {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType} boosterType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.boosterType = 0; + + /** + * TrainingOptions numParallelTree. + * @member {google.protobuf.IInt64Value|null|undefined} numParallelTree + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.numParallelTree = null; + + /** + * TrainingOptions dartNormalizeType. + * @member {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType} dartNormalizeType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dartNormalizeType = 0; + + /** + * TrainingOptions treeMethod. + * @member {google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod} treeMethod + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.treeMethod = 0; + + /** + * TrainingOptions minTreeChildWeight. + * @member {google.protobuf.IInt64Value|null|undefined} minTreeChildWeight + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minTreeChildWeight = null; + + /** + * TrainingOptions colsampleBytree. + * @member {google.protobuf.IDoubleValue|null|undefined} colsampleBytree + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.colsampleBytree = null; + + /** + * TrainingOptions colsampleBylevel. + * @member {google.protobuf.IDoubleValue|null|undefined} colsampleBylevel + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.colsampleBylevel = null; + + /** + * TrainingOptions colsampleBynode. + * @member {google.protobuf.IDoubleValue|null|undefined} colsampleBynode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.colsampleBynode = null; + + /** + * TrainingOptions numFactors. + * @member {number|Long} numFactors + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.numFactors = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions feedbackType. + * @member {google.cloud.bigquery.v2.Model.FeedbackType} feedbackType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.feedbackType = 0; + + /** + * TrainingOptions walsAlpha. + * @member {google.protobuf.IDoubleValue|null|undefined} walsAlpha + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.walsAlpha = null; + + /** + * TrainingOptions kmeansInitializationMethod. + * @member {google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod} kmeansInitializationMethod + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.kmeansInitializationMethod = 0; + + /** + * TrainingOptions kmeansInitializationColumn. + * @member {string} kmeansInitializationColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.kmeansInitializationColumn = ""; + + /** + * TrainingOptions timeSeriesTimestampColumn. + * @member {string} timeSeriesTimestampColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.timeSeriesTimestampColumn = ""; + + /** + * TrainingOptions timeSeriesDataColumn. + * @member {string} timeSeriesDataColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.timeSeriesDataColumn = ""; + + /** + * TrainingOptions autoArima. + * @member {google.protobuf.IBoolValue|null|undefined} autoArima + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.autoArima = null; + + /** + * TrainingOptions nonSeasonalOrder. + * @member {google.cloud.bigquery.v2.Model.IArimaOrder|null|undefined} nonSeasonalOrder + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.nonSeasonalOrder = null; + + /** + * TrainingOptions dataFrequency. + * @member {google.cloud.bigquery.v2.Model.DataFrequency} dataFrequency + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dataFrequency = 0; + + /** + * TrainingOptions calculatePValues. + * @member {google.protobuf.IBoolValue|null|undefined} calculatePValues + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.calculatePValues = null; + + /** + * TrainingOptions includeDrift. + * @member {google.protobuf.IBoolValue|null|undefined} includeDrift + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.includeDrift = null; + + /** + * TrainingOptions holidayRegion. + * @member {google.cloud.bigquery.v2.Model.HolidayRegion} holidayRegion + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.holidayRegion = 0; + + /** + * TrainingOptions holidayRegions. + * @member {Array.} holidayRegions + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.holidayRegions = $util.emptyArray; + + /** + * TrainingOptions timeSeriesIdColumn. + * @member {string} timeSeriesIdColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.timeSeriesIdColumn = ""; + + /** + * TrainingOptions timeSeriesIdColumns. + * @member {Array.} timeSeriesIdColumns + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.timeSeriesIdColumns = $util.emptyArray; + + /** + * TrainingOptions forecastLimitLowerBound. + * @member {number} forecastLimitLowerBound + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.forecastLimitLowerBound = 0; + + /** + * TrainingOptions forecastLimitUpperBound. + * @member {number} forecastLimitUpperBound + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.forecastLimitUpperBound = 0; + + /** + * TrainingOptions horizon. + * @member {number|Long} horizon + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.horizon = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions autoArimaMaxOrder. + * @member {number|Long} autoArimaMaxOrder + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.autoArimaMaxOrder = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions autoArimaMinOrder. + * @member {number|Long} autoArimaMinOrder + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.autoArimaMinOrder = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions numTrials. + * @member {number|Long} numTrials + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.numTrials = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions maxParallelTrials. + * @member {number|Long} maxParallelTrials + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.maxParallelTrials = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions hparamTuningObjectives. + * @member {Array.} hparamTuningObjectives + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.hparamTuningObjectives = $util.emptyArray; + + /** + * TrainingOptions decomposeTimeSeries. + * @member {google.protobuf.IBoolValue|null|undefined} decomposeTimeSeries + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.decomposeTimeSeries = null; + + /** + * TrainingOptions cleanSpikesAndDips. + * @member {google.protobuf.IBoolValue|null|undefined} cleanSpikesAndDips + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.cleanSpikesAndDips = null; + + /** + * TrainingOptions adjustStepChanges. + * @member {google.protobuf.IBoolValue|null|undefined} adjustStepChanges + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.adjustStepChanges = null; + + /** + * TrainingOptions enableGlobalExplain. + * @member {google.protobuf.IBoolValue|null|undefined} enableGlobalExplain + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.enableGlobalExplain = null; + + /** + * TrainingOptions sampledShapleyNumPaths. + * @member {number|Long} sampledShapleyNumPaths + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.sampledShapleyNumPaths = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions integratedGradientsNumSteps. + * @member {number|Long} integratedGradientsNumSteps + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.integratedGradientsNumSteps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions categoryEncodingMethod. + * @member {google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod} categoryEncodingMethod + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.categoryEncodingMethod = 0; + + /** + * TrainingOptions tfVersion. + * @member {string} tfVersion + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.tfVersion = ""; + + /** + * TrainingOptions colorSpace. + * @member {google.cloud.bigquery.v2.Model.ColorSpace} colorSpace + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.colorSpace = 0; + + /** + * TrainingOptions instanceWeightColumn. + * @member {string} instanceWeightColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.instanceWeightColumn = ""; + + /** + * TrainingOptions trendSmoothingWindowSize. + * @member {number|Long} trendSmoothingWindowSize + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.trendSmoothingWindowSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions timeSeriesLengthFraction. + * @member {number} timeSeriesLengthFraction + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.timeSeriesLengthFraction = 0; + + /** + * TrainingOptions minTimeSeriesLength. + * @member {number|Long} minTimeSeriesLength + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minTimeSeriesLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions maxTimeSeriesLength. + * @member {number|Long} maxTimeSeriesLength + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.maxTimeSeriesLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions xgboostVersion. + * @member {string} xgboostVersion + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.xgboostVersion = ""; + + /** + * TrainingOptions approxGlobalFeatureContrib. + * @member {google.protobuf.IBoolValue|null|undefined} approxGlobalFeatureContrib + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.approxGlobalFeatureContrib = null; + + /** + * TrainingOptions fitIntercept. + * @member {google.protobuf.IBoolValue|null|undefined} fitIntercept + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.fitIntercept = null; + + /** + * TrainingOptions numPrincipalComponents. + * @member {number|Long} numPrincipalComponents + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.numPrincipalComponents = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TrainingOptions pcaExplainedVarianceRatio. + * @member {number} pcaExplainedVarianceRatio + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.pcaExplainedVarianceRatio = 0; + + /** + * TrainingOptions scaleFeatures. + * @member {google.protobuf.IBoolValue|null|undefined} scaleFeatures + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.scaleFeatures = null; + + /** + * TrainingOptions pcaSolver. + * @member {google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver} pcaSolver + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.pcaSolver = 0; + + /** + * TrainingOptions autoClassWeights. + * @member {google.protobuf.IBoolValue|null|undefined} autoClassWeights + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.autoClassWeights = null; + + /** + * TrainingOptions activationFn. + * @member {string} activationFn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.activationFn = ""; + + /** + * TrainingOptions optimizer. + * @member {string} optimizer + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.optimizer = ""; + + /** + * TrainingOptions budgetHours. + * @member {number} budgetHours + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.budgetHours = 0; + + /** + * TrainingOptions standardizeFeatures. + * @member {google.protobuf.IBoolValue|null|undefined} standardizeFeatures + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.standardizeFeatures = null; + + /** + * TrainingOptions l1RegActivation. + * @member {number} l1RegActivation + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.l1RegActivation = 0; + + /** + * TrainingOptions modelRegistry. + * @member {google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry} modelRegistry + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.modelRegistry = 0; + + /** + * TrainingOptions vertexAiModelVersionAliases. + * @member {Array.} vertexAiModelVersionAliases + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.vertexAiModelVersionAliases = $util.emptyArray; + + /** + * TrainingOptions dimensionIdColumns. + * @member {Array.} dimensionIdColumns + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.dimensionIdColumns = $util.emptyArray; + + /** + * TrainingOptions contributionMetric. + * @member {string|null|undefined} contributionMetric + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.contributionMetric = null; + + /** + * TrainingOptions isTestColumn. + * @member {string|null|undefined} isTestColumn + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.isTestColumn = null; + + /** + * TrainingOptions minAprioriSupport. + * @member {number|null|undefined} minAprioriSupport + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minAprioriSupport = null; + + /** + * TrainingOptions huggingFaceModelId. + * @member {string|null|undefined} huggingFaceModelId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.huggingFaceModelId = null; + + /** + * TrainingOptions modelGardenModelName. + * @member {string|null|undefined} modelGardenModelName + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.modelGardenModelName = null; + + /** + * TrainingOptions endpointIdleTtl. + * @member {google.protobuf.IDuration|null|undefined} endpointIdleTtl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.endpointIdleTtl = null; + + /** + * TrainingOptions machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.machineType = null; + + /** + * TrainingOptions minReplicaCount. + * @member {number|Long|null|undefined} minReplicaCount + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.minReplicaCount = null; + + /** + * TrainingOptions maxReplicaCount. + * @member {number|Long|null|undefined} maxReplicaCount + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.maxReplicaCount = null; + + /** + * TrainingOptions reservationAffinityType. + * @member {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType|null|undefined} reservationAffinityType + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.reservationAffinityType = null; + + /** + * TrainingOptions reservationAffinityKey. + * @member {string|null|undefined} reservationAffinityKey + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.reservationAffinityKey = null; + + /** + * TrainingOptions reservationAffinityValues. + * @member {Array.} reservationAffinityValues + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + TrainingOptions.prototype.reservationAffinityValues = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_contributionMetric", { + get: $util.oneOfGetter($oneOfFields = ["contributionMetric"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_isTestColumn", { + get: $util.oneOfGetter($oneOfFields = ["isTestColumn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_minAprioriSupport", { + get: $util.oneOfGetter($oneOfFields = ["minAprioriSupport"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TrainingOptions externalModelId. + * @member {"huggingFaceModelId"|"modelGardenModelName"|undefined} externalModelId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + */ + Object.defineProperty(TrainingOptions.prototype, "externalModelId", { + get: $util.oneOfGetter($oneOfFields = ["huggingFaceModelId", "modelGardenModelName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_endpointIdleTtl", { + get: $util.oneOfGetter($oneOfFields = ["endpointIdleTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_minReplicaCount", { + get: $util.oneOfGetter($oneOfFields = ["minReplicaCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_maxReplicaCount", { + get: $util.oneOfGetter($oneOfFields = ["maxReplicaCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_reservationAffinityType", { + get: $util.oneOfGetter($oneOfFields = ["reservationAffinityType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TrainingOptions.prototype, "_reservationAffinityKey", { + get: $util.oneOfGetter($oneOfFields = ["reservationAffinityKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TrainingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions} TrainingOptions instance + */ + TrainingOptions.create = function create(properties) { + return new TrainingOptions(properties); + }; + + /** + * Encodes the specified TrainingOptions message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions} message TrainingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxIterations); + if (message.lossType != null && Object.hasOwnProperty.call(message, "lossType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lossType); + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.learnRate); + if (message.l1Regularization != null && Object.hasOwnProperty.call(message, "l1Regularization")) + $root.google.protobuf.DoubleValue.encode(message.l1Regularization, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.l2Regularization != null && Object.hasOwnProperty.call(message, "l2Regularization")) + $root.google.protobuf.DoubleValue.encode(message.l2Regularization, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.minRelativeProgress != null && Object.hasOwnProperty.call(message, "minRelativeProgress")) + $root.google.protobuf.DoubleValue.encode(message.minRelativeProgress, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.warmStart != null && Object.hasOwnProperty.call(message, "warmStart")) + $root.google.protobuf.BoolValue.encode(message.warmStart, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.earlyStop != null && Object.hasOwnProperty.call(message, "earlyStop")) + $root.google.protobuf.BoolValue.encode(message.earlyStop, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.inputLabelColumns != null && message.inputLabelColumns.length) + for (var i = 0; i < message.inputLabelColumns.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.inputLabelColumns[i]); + if (message.dataSplitMethod != null && Object.hasOwnProperty.call(message, "dataSplitMethod")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.dataSplitMethod); + if (message.dataSplitEvalFraction != null && Object.hasOwnProperty.call(message, "dataSplitEvalFraction")) + writer.uint32(/* id 11, wireType 1 =*/89).double(message.dataSplitEvalFraction); + if (message.dataSplitColumn != null && Object.hasOwnProperty.call(message, "dataSplitColumn")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.dataSplitColumn); + if (message.learnRateStrategy != null && Object.hasOwnProperty.call(message, "learnRateStrategy")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.learnRateStrategy); + if (message.initialLearnRate != null && Object.hasOwnProperty.call(message, "initialLearnRate")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.initialLearnRate); + if (message.labelClassWeights != null && Object.hasOwnProperty.call(message, "labelClassWeights")) + for (var keys = Object.keys(message.labelClassWeights), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.labelClassWeights[keys[i]]).ldelim(); + if (message.userColumn != null && Object.hasOwnProperty.call(message, "userColumn")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.userColumn); + if (message.itemColumn != null && Object.hasOwnProperty.call(message, "itemColumn")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.itemColumn); + if (message.distanceType != null && Object.hasOwnProperty.call(message, "distanceType")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.distanceType); + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) + writer.uint32(/* id 21, wireType 0 =*/168).int64(message.numClusters); + if (message.modelUri != null && Object.hasOwnProperty.call(message, "modelUri")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.modelUri); + if (message.optimizationStrategy != null && Object.hasOwnProperty.call(message, "optimizationStrategy")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.optimizationStrategy); + if (message.hiddenUnits != null && message.hiddenUnits.length) { + writer.uint32(/* id 24, wireType 2 =*/194).fork(); + for (var i = 0; i < message.hiddenUnits.length; ++i) + writer.int64(message.hiddenUnits[i]); + writer.ldelim(); + } + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + writer.uint32(/* id 25, wireType 0 =*/200).int64(message.batchSize); + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) + $root.google.protobuf.DoubleValue.encode(message.dropout, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) + writer.uint32(/* id 27, wireType 0 =*/216).int64(message.maxTreeDepth); + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) + writer.uint32(/* id 28, wireType 1 =*/225).double(message.subsample); + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) + $root.google.protobuf.DoubleValue.encode(message.minSplitLoss, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) + writer.uint32(/* id 30, wireType 0 =*/240).int64(message.numFactors); + if (message.feedbackType != null && Object.hasOwnProperty.call(message, "feedbackType")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.feedbackType); + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) + $root.google.protobuf.DoubleValue.encode(message.walsAlpha, writer.uint32(/* id 32, wireType 2 =*/258).fork(), q + 1).ldelim(); + if (message.kmeansInitializationMethod != null && Object.hasOwnProperty.call(message, "kmeansInitializationMethod")) + writer.uint32(/* id 33, wireType 0 =*/264).int32(message.kmeansInitializationMethod); + if (message.kmeansInitializationColumn != null && Object.hasOwnProperty.call(message, "kmeansInitializationColumn")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.kmeansInitializationColumn); + if (message.timeSeriesTimestampColumn != null && Object.hasOwnProperty.call(message, "timeSeriesTimestampColumn")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.timeSeriesTimestampColumn); + if (message.timeSeriesDataColumn != null && Object.hasOwnProperty.call(message, "timeSeriesDataColumn")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.timeSeriesDataColumn); + if (message.autoArima != null && Object.hasOwnProperty.call(message, "autoArima")) + $root.google.protobuf.BoolValue.encode(message.autoArima, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + $root.google.cloud.bigquery.v2.Model.ArimaOrder.encode(message.nonSeasonalOrder, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); + if (message.dataFrequency != null && Object.hasOwnProperty.call(message, "dataFrequency")) + writer.uint32(/* id 39, wireType 0 =*/312).int32(message.dataFrequency); + if (message.calculatePValues != null && Object.hasOwnProperty.call(message, "calculatePValues")) + $root.google.protobuf.BoolValue.encode(message.calculatePValues, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); + if (message.includeDrift != null && Object.hasOwnProperty.call(message, "includeDrift")) + $root.google.protobuf.BoolValue.encode(message.includeDrift, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); + if (message.holidayRegion != null && Object.hasOwnProperty.call(message, "holidayRegion")) + writer.uint32(/* id 42, wireType 0 =*/336).int32(message.holidayRegion); + if (message.timeSeriesIdColumn != null && Object.hasOwnProperty.call(message, "timeSeriesIdColumn")) + writer.uint32(/* id 43, wireType 2 =*/346).string(message.timeSeriesIdColumn); + if (message.horizon != null && Object.hasOwnProperty.call(message, "horizon")) + writer.uint32(/* id 44, wireType 0 =*/352).int64(message.horizon); + if (message.autoArimaMaxOrder != null && Object.hasOwnProperty.call(message, "autoArimaMaxOrder")) + writer.uint32(/* id 46, wireType 0 =*/368).int64(message.autoArimaMaxOrder); + if (message.numTrials != null && Object.hasOwnProperty.call(message, "numTrials")) + writer.uint32(/* id 47, wireType 0 =*/376).int64(message.numTrials); + if (message.maxParallelTrials != null && Object.hasOwnProperty.call(message, "maxParallelTrials")) + writer.uint32(/* id 48, wireType 0 =*/384).int64(message.maxParallelTrials); + if (message.decomposeTimeSeries != null && Object.hasOwnProperty.call(message, "decomposeTimeSeries")) + $root.google.protobuf.BoolValue.encode(message.decomposeTimeSeries, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + if (message.timeSeriesIdColumns != null && message.timeSeriesIdColumns.length) + for (var i = 0; i < message.timeSeriesIdColumns.length; ++i) + writer.uint32(/* id 51, wireType 2 =*/410).string(message.timeSeriesIdColumns[i]); + if (message.cleanSpikesAndDips != null && Object.hasOwnProperty.call(message, "cleanSpikesAndDips")) + $root.google.protobuf.BoolValue.encode(message.cleanSpikesAndDips, writer.uint32(/* id 52, wireType 2 =*/418).fork(), q + 1).ldelim(); + if (message.adjustStepChanges != null && Object.hasOwnProperty.call(message, "adjustStepChanges")) + $root.google.protobuf.BoolValue.encode(message.adjustStepChanges, writer.uint32(/* id 53, wireType 2 =*/426).fork(), q + 1).ldelim(); + if (message.hparamTuningObjectives != null && message.hparamTuningObjectives.length) { + writer.uint32(/* id 54, wireType 2 =*/434).fork(); + for (var i = 0; i < message.hparamTuningObjectives.length; ++i) + writer.int32(message.hparamTuningObjectives[i]); + writer.ldelim(); + } + if (message.enableGlobalExplain != null && Object.hasOwnProperty.call(message, "enableGlobalExplain")) + $root.google.protobuf.BoolValue.encode(message.enableGlobalExplain, writer.uint32(/* id 55, wireType 2 =*/442).fork(), q + 1).ldelim(); + if (message.sampledShapleyNumPaths != null && Object.hasOwnProperty.call(message, "sampledShapleyNumPaths")) + writer.uint32(/* id 56, wireType 0 =*/448).int64(message.sampledShapleyNumPaths); + if (message.integratedGradientsNumSteps != null && Object.hasOwnProperty.call(message, "integratedGradientsNumSteps")) + writer.uint32(/* id 57, wireType 0 =*/456).int64(message.integratedGradientsNumSteps); + if (message.categoryEncodingMethod != null && Object.hasOwnProperty.call(message, "categoryEncodingMethod")) + writer.uint32(/* id 58, wireType 0 =*/464).int32(message.categoryEncodingMethod); + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) + writer.uint32(/* id 60, wireType 0 =*/480).int32(message.boosterType); + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) + $root.google.protobuf.Int64Value.encode(message.numParallelTree, writer.uint32(/* id 61, wireType 2 =*/490).fork(), q + 1).ldelim(); + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) + writer.uint32(/* id 62, wireType 0 =*/496).int32(message.dartNormalizeType); + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) + writer.uint32(/* id 63, wireType 0 =*/504).int32(message.treeMethod); + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) + $root.google.protobuf.Int64Value.encode(message.minTreeChildWeight, writer.uint32(/* id 64, wireType 2 =*/514).fork(), q + 1).ldelim(); + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) + $root.google.protobuf.DoubleValue.encode(message.colsampleBytree, writer.uint32(/* id 65, wireType 2 =*/522).fork(), q + 1).ldelim(); + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) + $root.google.protobuf.DoubleValue.encode(message.colsampleBylevel, writer.uint32(/* id 66, wireType 2 =*/530).fork(), q + 1).ldelim(); + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) + $root.google.protobuf.DoubleValue.encode(message.colsampleBynode, writer.uint32(/* id 67, wireType 2 =*/538).fork(), q + 1).ldelim(); + if (message.tfVersion != null && Object.hasOwnProperty.call(message, "tfVersion")) + writer.uint32(/* id 70, wireType 2 =*/562).string(message.tfVersion); + if (message.holidayRegions != null && message.holidayRegions.length) { + writer.uint32(/* id 71, wireType 2 =*/570).fork(); + for (var i = 0; i < message.holidayRegions.length; ++i) + writer.int32(message.holidayRegions[i]); + writer.ldelim(); + } + if (message.colorSpace != null && Object.hasOwnProperty.call(message, "colorSpace")) + writer.uint32(/* id 72, wireType 0 =*/576).int32(message.colorSpace); + if (message.instanceWeightColumn != null && Object.hasOwnProperty.call(message, "instanceWeightColumn")) + writer.uint32(/* id 73, wireType 2 =*/586).string(message.instanceWeightColumn); + if (message.trendSmoothingWindowSize != null && Object.hasOwnProperty.call(message, "trendSmoothingWindowSize")) + writer.uint32(/* id 74, wireType 0 =*/592).int64(message.trendSmoothingWindowSize); + if (message.timeSeriesLengthFraction != null && Object.hasOwnProperty.call(message, "timeSeriesLengthFraction")) + writer.uint32(/* id 75, wireType 1 =*/601).double(message.timeSeriesLengthFraction); + if (message.minTimeSeriesLength != null && Object.hasOwnProperty.call(message, "minTimeSeriesLength")) + writer.uint32(/* id 76, wireType 0 =*/608).int64(message.minTimeSeriesLength); + if (message.maxTimeSeriesLength != null && Object.hasOwnProperty.call(message, "maxTimeSeriesLength")) + writer.uint32(/* id 77, wireType 0 =*/616).int64(message.maxTimeSeriesLength); + if (message.xgboostVersion != null && Object.hasOwnProperty.call(message, "xgboostVersion")) + writer.uint32(/* id 78, wireType 2 =*/626).string(message.xgboostVersion); + if (message.autoArimaMinOrder != null && Object.hasOwnProperty.call(message, "autoArimaMinOrder")) + writer.uint32(/* id 83, wireType 0 =*/664).int64(message.autoArimaMinOrder); + if (message.approxGlobalFeatureContrib != null && Object.hasOwnProperty.call(message, "approxGlobalFeatureContrib")) + $root.google.protobuf.BoolValue.encode(message.approxGlobalFeatureContrib, writer.uint32(/* id 84, wireType 2 =*/674).fork(), q + 1).ldelim(); + if (message.fitIntercept != null && Object.hasOwnProperty.call(message, "fitIntercept")) + $root.google.protobuf.BoolValue.encode(message.fitIntercept, writer.uint32(/* id 85, wireType 2 =*/682).fork(), q + 1).ldelim(); + if (message.numPrincipalComponents != null && Object.hasOwnProperty.call(message, "numPrincipalComponents")) + writer.uint32(/* id 86, wireType 0 =*/688).int64(message.numPrincipalComponents); + if (message.pcaExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "pcaExplainedVarianceRatio")) + writer.uint32(/* id 87, wireType 1 =*/697).double(message.pcaExplainedVarianceRatio); + if (message.scaleFeatures != null && Object.hasOwnProperty.call(message, "scaleFeatures")) + $root.google.protobuf.BoolValue.encode(message.scaleFeatures, writer.uint32(/* id 88, wireType 2 =*/706).fork(), q + 1).ldelim(); + if (message.pcaSolver != null && Object.hasOwnProperty.call(message, "pcaSolver")) + writer.uint32(/* id 89, wireType 0 =*/712).int32(message.pcaSolver); + if (message.autoClassWeights != null && Object.hasOwnProperty.call(message, "autoClassWeights")) + $root.google.protobuf.BoolValue.encode(message.autoClassWeights, writer.uint32(/* id 90, wireType 2 =*/722).fork(), q + 1).ldelim(); + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) + writer.uint32(/* id 91, wireType 2 =*/730).string(message.activationFn); + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) + writer.uint32(/* id 92, wireType 2 =*/738).string(message.optimizer); + if (message.budgetHours != null && Object.hasOwnProperty.call(message, "budgetHours")) + writer.uint32(/* id 93, wireType 1 =*/745).double(message.budgetHours); + if (message.standardizeFeatures != null && Object.hasOwnProperty.call(message, "standardizeFeatures")) + $root.google.protobuf.BoolValue.encode(message.standardizeFeatures, writer.uint32(/* id 94, wireType 2 =*/754).fork(), q + 1).ldelim(); + if (message.l1RegActivation != null && Object.hasOwnProperty.call(message, "l1RegActivation")) + writer.uint32(/* id 95, wireType 1 =*/761).double(message.l1RegActivation); + if (message.modelRegistry != null && Object.hasOwnProperty.call(message, "modelRegistry")) + writer.uint32(/* id 96, wireType 0 =*/768).int32(message.modelRegistry); + if (message.vertexAiModelVersionAliases != null && message.vertexAiModelVersionAliases.length) + for (var i = 0; i < message.vertexAiModelVersionAliases.length; ++i) + writer.uint32(/* id 97, wireType 2 =*/778).string(message.vertexAiModelVersionAliases[i]); + if (message.forecastLimitLowerBound != null && Object.hasOwnProperty.call(message, "forecastLimitLowerBound")) + writer.uint32(/* id 99, wireType 1 =*/793).double(message.forecastLimitLowerBound); + if (message.forecastLimitUpperBound != null && Object.hasOwnProperty.call(message, "forecastLimitUpperBound")) + writer.uint32(/* id 100, wireType 1 =*/801).double(message.forecastLimitUpperBound); + if (message.dimensionIdColumns != null && message.dimensionIdColumns.length) + for (var i = 0; i < message.dimensionIdColumns.length; ++i) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.dimensionIdColumns[i]); + if (message.contributionMetric != null && Object.hasOwnProperty.call(message, "contributionMetric")) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.contributionMetric); + if (message.isTestColumn != null && Object.hasOwnProperty.call(message, "isTestColumn")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.isTestColumn); + if (message.minAprioriSupport != null && Object.hasOwnProperty.call(message, "minAprioriSupport")) + writer.uint32(/* id 107, wireType 1 =*/857).double(message.minAprioriSupport); + if (message.huggingFaceModelId != null && Object.hasOwnProperty.call(message, "huggingFaceModelId")) + writer.uint32(/* id 113, wireType 2 =*/906).string(message.huggingFaceModelId); + if (message.modelGardenModelName != null && Object.hasOwnProperty.call(message, "modelGardenModelName")) + writer.uint32(/* id 114, wireType 2 =*/914).string(message.modelGardenModelName); + if (message.endpointIdleTtl != null && Object.hasOwnProperty.call(message, "endpointIdleTtl")) + $root.google.protobuf.Duration.encode(message.endpointIdleTtl, writer.uint32(/* id 115, wireType 2 =*/922).fork(), q + 1).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 117, wireType 2 =*/938).string(message.machineType); + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) + writer.uint32(/* id 118, wireType 0 =*/944).int64(message.minReplicaCount); + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) + writer.uint32(/* id 119, wireType 0 =*/952).int64(message.maxReplicaCount); + if (message.reservationAffinityType != null && Object.hasOwnProperty.call(message, "reservationAffinityType")) + writer.uint32(/* id 120, wireType 0 =*/960).int32(message.reservationAffinityType); + if (message.reservationAffinityKey != null && Object.hasOwnProperty.call(message, "reservationAffinityKey")) + writer.uint32(/* id 121, wireType 2 =*/970).string(message.reservationAffinityKey); + if (message.reservationAffinityValues != null && message.reservationAffinityValues.length) + for (var i = 0; i < message.reservationAffinityValues.length; ++i) + writer.uint32(/* id 122, wireType 2 =*/978).string(message.reservationAffinityValues[i]); + return writer; + }; + + /** + * Encodes the specified TrainingOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions} message TrainingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TrainingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions} TrainingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxIterations = reader.int64(); + break; + } + case 2: { + message.lossType = reader.int32(); + break; + } + case 3: { + message.learnRate = reader.double(); + break; + } + case 4: { + message.l1Regularization = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.l2Regularization = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.minRelativeProgress = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.warmStart = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.earlyStop = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.inputLabelColumns && message.inputLabelColumns.length)) + message.inputLabelColumns = []; + message.inputLabelColumns.push(reader.string()); + break; + } + case 10: { + message.dataSplitMethod = reader.int32(); + break; + } + case 11: { + message.dataSplitEvalFraction = reader.double(); + break; + } + case 12: { + message.dataSplitColumn = reader.string(); + break; + } + case 13: { + message.learnRateStrategy = reader.int32(); + break; + } + case 16: { + message.initialLearnRate = reader.double(); + break; + } + case 17: { + if (message.labelClassWeights === $util.emptyObject) + message.labelClassWeights = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.double(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labelClassWeights, key); + message.labelClassWeights[key] = value; + break; + } + case 18: { + message.userColumn = reader.string(); + break; + } + case 19: { + message.itemColumn = reader.string(); + break; + } + case 20: { + message.distanceType = reader.int32(); + break; + } + case 21: { + message.numClusters = reader.int64(); + break; + } + case 22: { + message.modelUri = reader.string(); + break; + } + case 23: { + message.optimizationStrategy = reader.int32(); + break; + } + case 24: { + if (!(message.hiddenUnits && message.hiddenUnits.length)) + message.hiddenUnits = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.hiddenUnits.push(reader.int64()); + } else + message.hiddenUnits.push(reader.int64()); + break; + } + case 25: { + message.batchSize = reader.int64(); + break; + } + case 26: { + message.dropout = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.maxTreeDepth = reader.int64(); + break; + } + case 28: { + message.subsample = reader.double(); + break; + } + case 29: { + message.minSplitLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 60: { + message.boosterType = reader.int32(); + break; + } + case 61: { + message.numParallelTree = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 62: { + message.dartNormalizeType = reader.int32(); + break; + } + case 63: { + message.treeMethod = reader.int32(); + break; + } + case 64: { + message.minTreeChildWeight = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 65: { + message.colsampleBytree = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 66: { + message.colsampleBylevel = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 67: { + message.colsampleBynode = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.numFactors = reader.int64(); + break; + } + case 31: { + message.feedbackType = reader.int32(); + break; + } + case 32: { + message.walsAlpha = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.kmeansInitializationMethod = reader.int32(); + break; + } + case 34: { + message.kmeansInitializationColumn = reader.string(); + break; + } + case 35: { + message.timeSeriesTimestampColumn = reader.string(); + break; + } + case 36: { + message.timeSeriesDataColumn = reader.string(); + break; + } + case 37: { + message.autoArima = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 39: { + message.dataFrequency = reader.int32(); + break; + } + case 40: { + message.calculatePValues = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 41: { + message.includeDrift = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.holidayRegion = reader.int32(); + break; + } + case 71: { + if (!(message.holidayRegions && message.holidayRegions.length)) + message.holidayRegions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.holidayRegions.push(reader.int32()); + } else + message.holidayRegions.push(reader.int32()); + break; + } + case 43: { + message.timeSeriesIdColumn = reader.string(); + break; + } + case 51: { + if (!(message.timeSeriesIdColumns && message.timeSeriesIdColumns.length)) + message.timeSeriesIdColumns = []; + message.timeSeriesIdColumns.push(reader.string()); + break; + } + case 99: { + message.forecastLimitLowerBound = reader.double(); + break; + } + case 100: { + message.forecastLimitUpperBound = reader.double(); + break; + } + case 44: { + message.horizon = reader.int64(); + break; + } + case 46: { + message.autoArimaMaxOrder = reader.int64(); + break; + } + case 83: { + message.autoArimaMinOrder = reader.int64(); + break; + } + case 47: { + message.numTrials = reader.int64(); + break; + } + case 48: { + message.maxParallelTrials = reader.int64(); + break; + } + case 54: { + if (!(message.hparamTuningObjectives && message.hparamTuningObjectives.length)) + message.hparamTuningObjectives = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.hparamTuningObjectives.push(reader.int32()); + } else + message.hparamTuningObjectives.push(reader.int32()); + break; + } + case 50: { + message.decomposeTimeSeries = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 52: { + message.cleanSpikesAndDips = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 53: { + message.adjustStepChanges = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 55: { + message.enableGlobalExplain = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 56: { + message.sampledShapleyNumPaths = reader.int64(); + break; + } + case 57: { + message.integratedGradientsNumSteps = reader.int64(); + break; + } + case 58: { + message.categoryEncodingMethod = reader.int32(); + break; + } + case 70: { + message.tfVersion = reader.string(); + break; + } + case 72: { + message.colorSpace = reader.int32(); + break; + } + case 73: { + message.instanceWeightColumn = reader.string(); + break; + } + case 74: { + message.trendSmoothingWindowSize = reader.int64(); + break; + } + case 75: { + message.timeSeriesLengthFraction = reader.double(); + break; + } + case 76: { + message.minTimeSeriesLength = reader.int64(); + break; + } + case 77: { + message.maxTimeSeriesLength = reader.int64(); + break; + } + case 78: { + message.xgboostVersion = reader.string(); + break; + } + case 84: { + message.approxGlobalFeatureContrib = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 85: { + message.fitIntercept = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 86: { + message.numPrincipalComponents = reader.int64(); + break; + } + case 87: { + message.pcaExplainedVarianceRatio = reader.double(); + break; + } + case 88: { + message.scaleFeatures = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 89: { + message.pcaSolver = reader.int32(); + break; + } + case 90: { + message.autoClassWeights = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 91: { + message.activationFn = reader.string(); + break; + } + case 92: { + message.optimizer = reader.string(); + break; + } + case 93: { + message.budgetHours = reader.double(); + break; + } + case 94: { + message.standardizeFeatures = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 95: { + message.l1RegActivation = reader.double(); + break; + } + case 96: { + message.modelRegistry = reader.int32(); + break; + } + case 97: { + if (!(message.vertexAiModelVersionAliases && message.vertexAiModelVersionAliases.length)) + message.vertexAiModelVersionAliases = []; + message.vertexAiModelVersionAliases.push(reader.string()); + break; + } + case 104: { + if (!(message.dimensionIdColumns && message.dimensionIdColumns.length)) + message.dimensionIdColumns = []; + message.dimensionIdColumns.push(reader.string()); + break; + } + case 105: { + message.contributionMetric = reader.string(); + break; + } + case 106: { + message.isTestColumn = reader.string(); + break; + } + case 107: { + message.minAprioriSupport = reader.double(); + break; + } + case 113: { + message.huggingFaceModelId = reader.string(); + break; + } + case 114: { + message.modelGardenModelName = reader.string(); + break; + } + case 115: { + message.endpointIdleTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 117: { + message.machineType = reader.string(); + break; + } + case 118: { + message.minReplicaCount = reader.int64(); + break; + } + case 119: { + message.maxReplicaCount = reader.int64(); + break; + } + case 120: { + message.reservationAffinityType = reader.int32(); + break; + } + case 121: { + message.reservationAffinityKey = reader.string(); + break; + } + case 122: { + if (!(message.reservationAffinityValues && message.reservationAffinityValues.length)) + message.reservationAffinityValues = []; + message.reservationAffinityValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TrainingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions} TrainingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainingOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + if (!$util.isInteger(message.maxIterations) && !(message.maxIterations && $util.isInteger(message.maxIterations.low) && $util.isInteger(message.maxIterations.high))) + return "maxIterations: integer|Long expected"; + if (message.lossType != null && Object.hasOwnProperty.call(message, "lossType")) + switch (message.lossType) { + default: + return "lossType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + if (typeof message.learnRate !== "number") + return "learnRate: number expected"; + if (message.l1Regularization != null && Object.hasOwnProperty.call(message, "l1Regularization")) { + var error = $root.google.protobuf.DoubleValue.verify(message.l1Regularization, long + 1); + if (error) + return "l1Regularization." + error; + } + if (message.l2Regularization != null && Object.hasOwnProperty.call(message, "l2Regularization")) { + var error = $root.google.protobuf.DoubleValue.verify(message.l2Regularization, long + 1); + if (error) + return "l2Regularization." + error; + } + if (message.minRelativeProgress != null && Object.hasOwnProperty.call(message, "minRelativeProgress")) { + var error = $root.google.protobuf.DoubleValue.verify(message.minRelativeProgress, long + 1); + if (error) + return "minRelativeProgress." + error; + } + if (message.warmStart != null && Object.hasOwnProperty.call(message, "warmStart")) { + var error = $root.google.protobuf.BoolValue.verify(message.warmStart, long + 1); + if (error) + return "warmStart." + error; + } + if (message.earlyStop != null && Object.hasOwnProperty.call(message, "earlyStop")) { + var error = $root.google.protobuf.BoolValue.verify(message.earlyStop, long + 1); + if (error) + return "earlyStop." + error; + } + if (message.inputLabelColumns != null && Object.hasOwnProperty.call(message, "inputLabelColumns")) { + if (!Array.isArray(message.inputLabelColumns)) + return "inputLabelColumns: array expected"; + for (var i = 0; i < message.inputLabelColumns.length; ++i) + if (!$util.isString(message.inputLabelColumns[i])) + return "inputLabelColumns: string[] expected"; + } + if (message.dataSplitMethod != null && Object.hasOwnProperty.call(message, "dataSplitMethod")) + switch (message.dataSplitMethod) { + default: + return "dataSplitMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.dataSplitEvalFraction != null && Object.hasOwnProperty.call(message, "dataSplitEvalFraction")) + if (typeof message.dataSplitEvalFraction !== "number") + return "dataSplitEvalFraction: number expected"; + if (message.dataSplitColumn != null && Object.hasOwnProperty.call(message, "dataSplitColumn")) + if (!$util.isString(message.dataSplitColumn)) + return "dataSplitColumn: string expected"; + if (message.learnRateStrategy != null && Object.hasOwnProperty.call(message, "learnRateStrategy")) + switch (message.learnRateStrategy) { + default: + return "learnRateStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.initialLearnRate != null && Object.hasOwnProperty.call(message, "initialLearnRate")) + if (typeof message.initialLearnRate !== "number") + return "initialLearnRate: number expected"; + if (message.labelClassWeights != null && Object.hasOwnProperty.call(message, "labelClassWeights")) { + if (!$util.isObject(message.labelClassWeights)) + return "labelClassWeights: object expected"; + var key = Object.keys(message.labelClassWeights); + for (var i = 0; i < key.length; ++i) + if (typeof message.labelClassWeights[key[i]] !== "number") + return "labelClassWeights: number{k:string} expected"; + } + if (message.userColumn != null && Object.hasOwnProperty.call(message, "userColumn")) + if (!$util.isString(message.userColumn)) + return "userColumn: string expected"; + if (message.itemColumn != null && Object.hasOwnProperty.call(message, "itemColumn")) + if (!$util.isString(message.itemColumn)) + return "itemColumn: string expected"; + if (message.distanceType != null && Object.hasOwnProperty.call(message, "distanceType")) + switch (message.distanceType) { + default: + return "distanceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) + if (!$util.isInteger(message.numClusters) && !(message.numClusters && $util.isInteger(message.numClusters.low) && $util.isInteger(message.numClusters.high))) + return "numClusters: integer|Long expected"; + if (message.modelUri != null && Object.hasOwnProperty.call(message, "modelUri")) + if (!$util.isString(message.modelUri)) + return "modelUri: string expected"; + if (message.optimizationStrategy != null && Object.hasOwnProperty.call(message, "optimizationStrategy")) + switch (message.optimizationStrategy) { + default: + return "optimizationStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.hiddenUnits != null && Object.hasOwnProperty.call(message, "hiddenUnits")) { + if (!Array.isArray(message.hiddenUnits)) + return "hiddenUnits: array expected"; + for (var i = 0; i < message.hiddenUnits.length; ++i) + if (!$util.isInteger(message.hiddenUnits[i]) && !(message.hiddenUnits[i] && $util.isInteger(message.hiddenUnits[i].low) && $util.isInteger(message.hiddenUnits[i].high))) + return "hiddenUnits: integer|Long[] expected"; + } + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + if (!$util.isInteger(message.batchSize) && !(message.batchSize && $util.isInteger(message.batchSize.low) && $util.isInteger(message.batchSize.high))) + return "batchSize: integer|Long expected"; + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) { + var error = $root.google.protobuf.DoubleValue.verify(message.dropout, long + 1); + if (error) + return "dropout." + error; + } + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) + if (!$util.isInteger(message.maxTreeDepth) && !(message.maxTreeDepth && $util.isInteger(message.maxTreeDepth.low) && $util.isInteger(message.maxTreeDepth.high))) + return "maxTreeDepth: integer|Long expected"; + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) + if (typeof message.subsample !== "number") + return "subsample: number expected"; + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.minSplitLoss, long + 1); + if (error) + return "minSplitLoss." + error; + } + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) + switch (message.boosterType) { + default: + return "boosterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) { + var error = $root.google.protobuf.Int64Value.verify(message.numParallelTree, long + 1); + if (error) + return "numParallelTree." + error; + } + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) + switch (message.dartNormalizeType) { + default: + return "dartNormalizeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) + switch (message.treeMethod) { + default: + return "treeMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) { + var error = $root.google.protobuf.Int64Value.verify(message.minTreeChildWeight, long + 1); + if (error) + return "minTreeChildWeight." + error; + } + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) { + var error = $root.google.protobuf.DoubleValue.verify(message.colsampleBytree, long + 1); + if (error) + return "colsampleBytree." + error; + } + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) { + var error = $root.google.protobuf.DoubleValue.verify(message.colsampleBylevel, long + 1); + if (error) + return "colsampleBylevel." + error; + } + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) { + var error = $root.google.protobuf.DoubleValue.verify(message.colsampleBynode, long + 1); + if (error) + return "colsampleBynode." + error; + } + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) + if (!$util.isInteger(message.numFactors) && !(message.numFactors && $util.isInteger(message.numFactors.low) && $util.isInteger(message.numFactors.high))) + return "numFactors: integer|Long expected"; + if (message.feedbackType != null && Object.hasOwnProperty.call(message, "feedbackType")) + switch (message.feedbackType) { + default: + return "feedbackType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) { + var error = $root.google.protobuf.DoubleValue.verify(message.walsAlpha, long + 1); + if (error) + return "walsAlpha." + error; + } + if (message.kmeansInitializationMethod != null && Object.hasOwnProperty.call(message, "kmeansInitializationMethod")) + switch (message.kmeansInitializationMethod) { + default: + return "kmeansInitializationMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.kmeansInitializationColumn != null && Object.hasOwnProperty.call(message, "kmeansInitializationColumn")) + if (!$util.isString(message.kmeansInitializationColumn)) + return "kmeansInitializationColumn: string expected"; + if (message.timeSeriesTimestampColumn != null && Object.hasOwnProperty.call(message, "timeSeriesTimestampColumn")) + if (!$util.isString(message.timeSeriesTimestampColumn)) + return "timeSeriesTimestampColumn: string expected"; + if (message.timeSeriesDataColumn != null && Object.hasOwnProperty.call(message, "timeSeriesDataColumn")) + if (!$util.isString(message.timeSeriesDataColumn)) + return "timeSeriesDataColumn: string expected"; + if (message.autoArima != null && Object.hasOwnProperty.call(message, "autoArima")) { + var error = $root.google.protobuf.BoolValue.verify(message.autoArima, long + 1); + if (error) + return "autoArima." + error; + } + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaOrder.verify(message.nonSeasonalOrder, long + 1); + if (error) + return "nonSeasonalOrder." + error; + } + if (message.dataFrequency != null && Object.hasOwnProperty.call(message, "dataFrequency")) + switch (message.dataFrequency) { + default: + return "dataFrequency: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.calculatePValues != null && Object.hasOwnProperty.call(message, "calculatePValues")) { + var error = $root.google.protobuf.BoolValue.verify(message.calculatePValues, long + 1); + if (error) + return "calculatePValues." + error; + } + if (message.includeDrift != null && Object.hasOwnProperty.call(message, "includeDrift")) { + var error = $root.google.protobuf.BoolValue.verify(message.includeDrift, long + 1); + if (error) + return "includeDrift." + error; + } + if (message.holidayRegion != null && Object.hasOwnProperty.call(message, "holidayRegion")) + switch (message.holidayRegion) { + default: + return "holidayRegion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + break; + } + if (message.holidayRegions != null && Object.hasOwnProperty.call(message, "holidayRegions")) { + if (!Array.isArray(message.holidayRegions)) + return "holidayRegions: array expected"; + for (var i = 0; i < message.holidayRegions.length; ++i) + switch (message.holidayRegions[i]) { + default: + return "holidayRegions: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + break; + } + } + if (message.timeSeriesIdColumn != null && Object.hasOwnProperty.call(message, "timeSeriesIdColumn")) + if (!$util.isString(message.timeSeriesIdColumn)) + return "timeSeriesIdColumn: string expected"; + if (message.timeSeriesIdColumns != null && Object.hasOwnProperty.call(message, "timeSeriesIdColumns")) { + if (!Array.isArray(message.timeSeriesIdColumns)) + return "timeSeriesIdColumns: array expected"; + for (var i = 0; i < message.timeSeriesIdColumns.length; ++i) + if (!$util.isString(message.timeSeriesIdColumns[i])) + return "timeSeriesIdColumns: string[] expected"; + } + if (message.forecastLimitLowerBound != null && Object.hasOwnProperty.call(message, "forecastLimitLowerBound")) + if (typeof message.forecastLimitLowerBound !== "number") + return "forecastLimitLowerBound: number expected"; + if (message.forecastLimitUpperBound != null && Object.hasOwnProperty.call(message, "forecastLimitUpperBound")) + if (typeof message.forecastLimitUpperBound !== "number") + return "forecastLimitUpperBound: number expected"; + if (message.horizon != null && Object.hasOwnProperty.call(message, "horizon")) + if (!$util.isInteger(message.horizon) && !(message.horizon && $util.isInteger(message.horizon.low) && $util.isInteger(message.horizon.high))) + return "horizon: integer|Long expected"; + if (message.autoArimaMaxOrder != null && Object.hasOwnProperty.call(message, "autoArimaMaxOrder")) + if (!$util.isInteger(message.autoArimaMaxOrder) && !(message.autoArimaMaxOrder && $util.isInteger(message.autoArimaMaxOrder.low) && $util.isInteger(message.autoArimaMaxOrder.high))) + return "autoArimaMaxOrder: integer|Long expected"; + if (message.autoArimaMinOrder != null && Object.hasOwnProperty.call(message, "autoArimaMinOrder")) + if (!$util.isInteger(message.autoArimaMinOrder) && !(message.autoArimaMinOrder && $util.isInteger(message.autoArimaMinOrder.low) && $util.isInteger(message.autoArimaMinOrder.high))) + return "autoArimaMinOrder: integer|Long expected"; + if (message.numTrials != null && Object.hasOwnProperty.call(message, "numTrials")) + if (!$util.isInteger(message.numTrials) && !(message.numTrials && $util.isInteger(message.numTrials.low) && $util.isInteger(message.numTrials.high))) + return "numTrials: integer|Long expected"; + if (message.maxParallelTrials != null && Object.hasOwnProperty.call(message, "maxParallelTrials")) + if (!$util.isInteger(message.maxParallelTrials) && !(message.maxParallelTrials && $util.isInteger(message.maxParallelTrials.low) && $util.isInteger(message.maxParallelTrials.high))) + return "maxParallelTrials: integer|Long expected"; + if (message.hparamTuningObjectives != null && Object.hasOwnProperty.call(message, "hparamTuningObjectives")) { + if (!Array.isArray(message.hparamTuningObjectives)) + return "hparamTuningObjectives: array expected"; + for (var i = 0; i < message.hparamTuningObjectives.length; ++i) + switch (message.hparamTuningObjectives[i]) { + default: + return "hparamTuningObjectives: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + break; + } + } + if (message.decomposeTimeSeries != null && Object.hasOwnProperty.call(message, "decomposeTimeSeries")) { + var error = $root.google.protobuf.BoolValue.verify(message.decomposeTimeSeries, long + 1); + if (error) + return "decomposeTimeSeries." + error; + } + if (message.cleanSpikesAndDips != null && Object.hasOwnProperty.call(message, "cleanSpikesAndDips")) { + var error = $root.google.protobuf.BoolValue.verify(message.cleanSpikesAndDips, long + 1); + if (error) + return "cleanSpikesAndDips." + error; + } + if (message.adjustStepChanges != null && Object.hasOwnProperty.call(message, "adjustStepChanges")) { + var error = $root.google.protobuf.BoolValue.verify(message.adjustStepChanges, long + 1); + if (error) + return "adjustStepChanges." + error; + } + if (message.enableGlobalExplain != null && Object.hasOwnProperty.call(message, "enableGlobalExplain")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableGlobalExplain, long + 1); + if (error) + return "enableGlobalExplain." + error; + } + if (message.sampledShapleyNumPaths != null && Object.hasOwnProperty.call(message, "sampledShapleyNumPaths")) + if (!$util.isInteger(message.sampledShapleyNumPaths) && !(message.sampledShapleyNumPaths && $util.isInteger(message.sampledShapleyNumPaths.low) && $util.isInteger(message.sampledShapleyNumPaths.high))) + return "sampledShapleyNumPaths: integer|Long expected"; + if (message.integratedGradientsNumSteps != null && Object.hasOwnProperty.call(message, "integratedGradientsNumSteps")) + if (!$util.isInteger(message.integratedGradientsNumSteps) && !(message.integratedGradientsNumSteps && $util.isInteger(message.integratedGradientsNumSteps.low) && $util.isInteger(message.integratedGradientsNumSteps.high))) + return "integratedGradientsNumSteps: integer|Long expected"; + if (message.categoryEncodingMethod != null && Object.hasOwnProperty.call(message, "categoryEncodingMethod")) + switch (message.categoryEncodingMethod) { + default: + return "categoryEncodingMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.tfVersion != null && Object.hasOwnProperty.call(message, "tfVersion")) + if (!$util.isString(message.tfVersion)) + return "tfVersion: string expected"; + if (message.colorSpace != null && Object.hasOwnProperty.call(message, "colorSpace")) + switch (message.colorSpace) { + default: + return "colorSpace: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.instanceWeightColumn != null && Object.hasOwnProperty.call(message, "instanceWeightColumn")) + if (!$util.isString(message.instanceWeightColumn)) + return "instanceWeightColumn: string expected"; + if (message.trendSmoothingWindowSize != null && Object.hasOwnProperty.call(message, "trendSmoothingWindowSize")) + if (!$util.isInteger(message.trendSmoothingWindowSize) && !(message.trendSmoothingWindowSize && $util.isInteger(message.trendSmoothingWindowSize.low) && $util.isInteger(message.trendSmoothingWindowSize.high))) + return "trendSmoothingWindowSize: integer|Long expected"; + if (message.timeSeriesLengthFraction != null && Object.hasOwnProperty.call(message, "timeSeriesLengthFraction")) + if (typeof message.timeSeriesLengthFraction !== "number") + return "timeSeriesLengthFraction: number expected"; + if (message.minTimeSeriesLength != null && Object.hasOwnProperty.call(message, "minTimeSeriesLength")) + if (!$util.isInteger(message.minTimeSeriesLength) && !(message.minTimeSeriesLength && $util.isInteger(message.minTimeSeriesLength.low) && $util.isInteger(message.minTimeSeriesLength.high))) + return "minTimeSeriesLength: integer|Long expected"; + if (message.maxTimeSeriesLength != null && Object.hasOwnProperty.call(message, "maxTimeSeriesLength")) + if (!$util.isInteger(message.maxTimeSeriesLength) && !(message.maxTimeSeriesLength && $util.isInteger(message.maxTimeSeriesLength.low) && $util.isInteger(message.maxTimeSeriesLength.high))) + return "maxTimeSeriesLength: integer|Long expected"; + if (message.xgboostVersion != null && Object.hasOwnProperty.call(message, "xgboostVersion")) + if (!$util.isString(message.xgboostVersion)) + return "xgboostVersion: string expected"; + if (message.approxGlobalFeatureContrib != null && Object.hasOwnProperty.call(message, "approxGlobalFeatureContrib")) { + var error = $root.google.protobuf.BoolValue.verify(message.approxGlobalFeatureContrib, long + 1); + if (error) + return "approxGlobalFeatureContrib." + error; + } + if (message.fitIntercept != null && Object.hasOwnProperty.call(message, "fitIntercept")) { + var error = $root.google.protobuf.BoolValue.verify(message.fitIntercept, long + 1); + if (error) + return "fitIntercept." + error; + } + if (message.numPrincipalComponents != null && Object.hasOwnProperty.call(message, "numPrincipalComponents")) + if (!$util.isInteger(message.numPrincipalComponents) && !(message.numPrincipalComponents && $util.isInteger(message.numPrincipalComponents.low) && $util.isInteger(message.numPrincipalComponents.high))) + return "numPrincipalComponents: integer|Long expected"; + if (message.pcaExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "pcaExplainedVarianceRatio")) + if (typeof message.pcaExplainedVarianceRatio !== "number") + return "pcaExplainedVarianceRatio: number expected"; + if (message.scaleFeatures != null && Object.hasOwnProperty.call(message, "scaleFeatures")) { + var error = $root.google.protobuf.BoolValue.verify(message.scaleFeatures, long + 1); + if (error) + return "scaleFeatures." + error; + } + if (message.pcaSolver != null && Object.hasOwnProperty.call(message, "pcaSolver")) + switch (message.pcaSolver) { + default: + return "pcaSolver: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.autoClassWeights != null && Object.hasOwnProperty.call(message, "autoClassWeights")) { + var error = $root.google.protobuf.BoolValue.verify(message.autoClassWeights, long + 1); + if (error) + return "autoClassWeights." + error; + } + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) + if (!$util.isString(message.activationFn)) + return "activationFn: string expected"; + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) + if (!$util.isString(message.optimizer)) + return "optimizer: string expected"; + if (message.budgetHours != null && Object.hasOwnProperty.call(message, "budgetHours")) + if (typeof message.budgetHours !== "number") + return "budgetHours: number expected"; + if (message.standardizeFeatures != null && Object.hasOwnProperty.call(message, "standardizeFeatures")) { + var error = $root.google.protobuf.BoolValue.verify(message.standardizeFeatures, long + 1); + if (error) + return "standardizeFeatures." + error; + } + if (message.l1RegActivation != null && Object.hasOwnProperty.call(message, "l1RegActivation")) + if (typeof message.l1RegActivation !== "number") + return "l1RegActivation: number expected"; + if (message.modelRegistry != null && Object.hasOwnProperty.call(message, "modelRegistry")) + switch (message.modelRegistry) { + default: + return "modelRegistry: enum value expected"; + case 0: + case 1: + break; + } + if (message.vertexAiModelVersionAliases != null && Object.hasOwnProperty.call(message, "vertexAiModelVersionAliases")) { + if (!Array.isArray(message.vertexAiModelVersionAliases)) + return "vertexAiModelVersionAliases: array expected"; + for (var i = 0; i < message.vertexAiModelVersionAliases.length; ++i) + if (!$util.isString(message.vertexAiModelVersionAliases[i])) + return "vertexAiModelVersionAliases: string[] expected"; + } + if (message.dimensionIdColumns != null && Object.hasOwnProperty.call(message, "dimensionIdColumns")) { + if (!Array.isArray(message.dimensionIdColumns)) + return "dimensionIdColumns: array expected"; + for (var i = 0; i < message.dimensionIdColumns.length; ++i) + if (!$util.isString(message.dimensionIdColumns[i])) + return "dimensionIdColumns: string[] expected"; + } + if (message.contributionMetric != null && Object.hasOwnProperty.call(message, "contributionMetric")) { + properties._contributionMetric = 1; + if (!$util.isString(message.contributionMetric)) + return "contributionMetric: string expected"; + } + if (message.isTestColumn != null && Object.hasOwnProperty.call(message, "isTestColumn")) { + properties._isTestColumn = 1; + if (!$util.isString(message.isTestColumn)) + return "isTestColumn: string expected"; + } + if (message.minAprioriSupport != null && Object.hasOwnProperty.call(message, "minAprioriSupport")) { + properties._minAprioriSupport = 1; + if (typeof message.minAprioriSupport !== "number") + return "minAprioriSupport: number expected"; + } + if (message.huggingFaceModelId != null && Object.hasOwnProperty.call(message, "huggingFaceModelId")) { + properties.externalModelId = 1; + if (!$util.isString(message.huggingFaceModelId)) + return "huggingFaceModelId: string expected"; + } + if (message.modelGardenModelName != null && Object.hasOwnProperty.call(message, "modelGardenModelName")) { + if (properties.externalModelId === 1) + return "externalModelId: multiple values"; + properties.externalModelId = 1; + if (!$util.isString(message.modelGardenModelName)) + return "modelGardenModelName: string expected"; + } + if (message.endpointIdleTtl != null && Object.hasOwnProperty.call(message, "endpointIdleTtl")) { + properties._endpointIdleTtl = 1; + { + var error = $root.google.protobuf.Duration.verify(message.endpointIdleTtl, long + 1); + if (error) + return "endpointIdleTtl." + error; + } + } + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) { + properties._minReplicaCount = 1; + if (!$util.isInteger(message.minReplicaCount) && !(message.minReplicaCount && $util.isInteger(message.minReplicaCount.low) && $util.isInteger(message.minReplicaCount.high))) + return "minReplicaCount: integer|Long expected"; + } + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) { + properties._maxReplicaCount = 1; + if (!$util.isInteger(message.maxReplicaCount) && !(message.maxReplicaCount && $util.isInteger(message.maxReplicaCount.low) && $util.isInteger(message.maxReplicaCount.high))) + return "maxReplicaCount: integer|Long expected"; + } + if (message.reservationAffinityType != null && Object.hasOwnProperty.call(message, "reservationAffinityType")) { + properties._reservationAffinityType = 1; + switch (message.reservationAffinityType) { + default: + return "reservationAffinityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.reservationAffinityKey != null && Object.hasOwnProperty.call(message, "reservationAffinityKey")) { + properties._reservationAffinityKey = 1; + if (!$util.isString(message.reservationAffinityKey)) + return "reservationAffinityKey: string expected"; + } + if (message.reservationAffinityValues != null && Object.hasOwnProperty.call(message, "reservationAffinityValues")) { + if (!Array.isArray(message.reservationAffinityValues)) + return "reservationAffinityValues: array expected"; + for (var i = 0; i < message.reservationAffinityValues.length; ++i) + if (!$util.isString(message.reservationAffinityValues[i])) + return "reservationAffinityValues: string[] expected"; + } + return null; + }; + + /** + * Creates a TrainingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions} TrainingOptions + */ + TrainingOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions(); + if (object.maxIterations != null) + if ($util.Long) + message.maxIterations = $util.Long.fromValue(object.maxIterations, false); + else if (typeof object.maxIterations === "string") + message.maxIterations = parseInt(object.maxIterations, 10); + else if (typeof object.maxIterations === "number") + message.maxIterations = object.maxIterations; + else if (typeof object.maxIterations === "object") + message.maxIterations = new $util.LongBits(object.maxIterations.low >>> 0, object.maxIterations.high >>> 0).toNumber(); + switch (object.lossType) { + default: + if (typeof object.lossType === "number") { + message.lossType = object.lossType; + break; + } + break; + case "LOSS_TYPE_UNSPECIFIED": + case 0: + message.lossType = 0; + break; + case "MEAN_SQUARED_LOSS": + case 1: + message.lossType = 1; + break; + case "MEAN_LOG_LOSS": + case 2: + message.lossType = 2; + break; + } + if (object.learnRate != null) + message.learnRate = Number(object.learnRate); + if (object.l1Regularization != null) { + if (!$util.isObject(object.l1Regularization)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.l1Regularization: object expected"); + message.l1Regularization = $root.google.protobuf.DoubleValue.fromObject(object.l1Regularization, long + 1); + } + if (object.l2Regularization != null) { + if (!$util.isObject(object.l2Regularization)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.l2Regularization: object expected"); + message.l2Regularization = $root.google.protobuf.DoubleValue.fromObject(object.l2Regularization, long + 1); + } + if (object.minRelativeProgress != null) { + if (!$util.isObject(object.minRelativeProgress)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.minRelativeProgress: object expected"); + message.minRelativeProgress = $root.google.protobuf.DoubleValue.fromObject(object.minRelativeProgress, long + 1); + } + if (object.warmStart != null) { + if (!$util.isObject(object.warmStart)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.warmStart: object expected"); + message.warmStart = $root.google.protobuf.BoolValue.fromObject(object.warmStart, long + 1); + } + if (object.earlyStop != null) { + if (!$util.isObject(object.earlyStop)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.earlyStop: object expected"); + message.earlyStop = $root.google.protobuf.BoolValue.fromObject(object.earlyStop, long + 1); + } + if (object.inputLabelColumns) { + if (!Array.isArray(object.inputLabelColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.inputLabelColumns: array expected"); + message.inputLabelColumns = []; + for (var i = 0; i < object.inputLabelColumns.length; ++i) + message.inputLabelColumns[i] = String(object.inputLabelColumns[i]); + } + switch (object.dataSplitMethod) { + default: + if (typeof object.dataSplitMethod === "number") { + message.dataSplitMethod = object.dataSplitMethod; + break; + } + break; + case "DATA_SPLIT_METHOD_UNSPECIFIED": + case 0: + message.dataSplitMethod = 0; + break; + case "RANDOM": + case 1: + message.dataSplitMethod = 1; + break; + case "CUSTOM": + case 2: + message.dataSplitMethod = 2; + break; + case "SEQUENTIAL": + case 3: + message.dataSplitMethod = 3; + break; + case "NO_SPLIT": + case 4: + message.dataSplitMethod = 4; + break; + case "AUTO_SPLIT": + case 5: + message.dataSplitMethod = 5; + break; + } + if (object.dataSplitEvalFraction != null) + message.dataSplitEvalFraction = Number(object.dataSplitEvalFraction); + if (object.dataSplitColumn != null) + message.dataSplitColumn = String(object.dataSplitColumn); + switch (object.learnRateStrategy) { + default: + if (typeof object.learnRateStrategy === "number") { + message.learnRateStrategy = object.learnRateStrategy; + break; + } + break; + case "LEARN_RATE_STRATEGY_UNSPECIFIED": + case 0: + message.learnRateStrategy = 0; + break; + case "LINE_SEARCH": + case 1: + message.learnRateStrategy = 1; + break; + case "CONSTANT": + case 2: + message.learnRateStrategy = 2; + break; + } + if (object.initialLearnRate != null) + message.initialLearnRate = Number(object.initialLearnRate); + if (object.labelClassWeights) { + if (!$util.isObject(object.labelClassWeights)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.labelClassWeights: object expected"); + message.labelClassWeights = {}; + for (var keys = Object.keys(object.labelClassWeights), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labelClassWeights, keys[i]); + message.labelClassWeights[keys[i]] = Number(object.labelClassWeights[keys[i]]); + } + } + if (object.userColumn != null) + message.userColumn = String(object.userColumn); + if (object.itemColumn != null) + message.itemColumn = String(object.itemColumn); + switch (object.distanceType) { + default: + if (typeof object.distanceType === "number") { + message.distanceType = object.distanceType; + break; + } + break; + case "DISTANCE_TYPE_UNSPECIFIED": + case 0: + message.distanceType = 0; + break; + case "EUCLIDEAN": + case 1: + message.distanceType = 1; + break; + case "COSINE": + case 2: + message.distanceType = 2; + break; + } + if (object.numClusters != null) + if ($util.Long) + message.numClusters = $util.Long.fromValue(object.numClusters, false); + else if (typeof object.numClusters === "string") + message.numClusters = parseInt(object.numClusters, 10); + else if (typeof object.numClusters === "number") + message.numClusters = object.numClusters; + else if (typeof object.numClusters === "object") + message.numClusters = new $util.LongBits(object.numClusters.low >>> 0, object.numClusters.high >>> 0).toNumber(); + if (object.modelUri != null) + message.modelUri = String(object.modelUri); + switch (object.optimizationStrategy) { + default: + if (typeof object.optimizationStrategy === "number") { + message.optimizationStrategy = object.optimizationStrategy; + break; + } + break; + case "OPTIMIZATION_STRATEGY_UNSPECIFIED": + case 0: + message.optimizationStrategy = 0; + break; + case "BATCH_GRADIENT_DESCENT": + case 1: + message.optimizationStrategy = 1; + break; + case "NORMAL_EQUATION": + case 2: + message.optimizationStrategy = 2; + break; + } + if (object.hiddenUnits) { + if (!Array.isArray(object.hiddenUnits)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.hiddenUnits: array expected"); + message.hiddenUnits = []; + for (var i = 0; i < object.hiddenUnits.length; ++i) + if ($util.Long) + message.hiddenUnits[i] = $util.Long.fromValue(object.hiddenUnits[i], false); + else if (typeof object.hiddenUnits[i] === "string") + message.hiddenUnits[i] = parseInt(object.hiddenUnits[i], 10); + else if (typeof object.hiddenUnits[i] === "number") + message.hiddenUnits[i] = object.hiddenUnits[i]; + else if (typeof object.hiddenUnits[i] === "object") + message.hiddenUnits[i] = new $util.LongBits(object.hiddenUnits[i].low >>> 0, object.hiddenUnits[i].high >>> 0).toNumber(); + } + if (object.batchSize != null) + if ($util.Long) + message.batchSize = $util.Long.fromValue(object.batchSize, false); + else if (typeof object.batchSize === "string") + message.batchSize = parseInt(object.batchSize, 10); + else if (typeof object.batchSize === "number") + message.batchSize = object.batchSize; + else if (typeof object.batchSize === "object") + message.batchSize = new $util.LongBits(object.batchSize.low >>> 0, object.batchSize.high >>> 0).toNumber(); + if (object.dropout != null) { + if (!$util.isObject(object.dropout)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.dropout: object expected"); + message.dropout = $root.google.protobuf.DoubleValue.fromObject(object.dropout, long + 1); + } + if (object.maxTreeDepth != null) + if ($util.Long) + message.maxTreeDepth = $util.Long.fromValue(object.maxTreeDepth, false); + else if (typeof object.maxTreeDepth === "string") + message.maxTreeDepth = parseInt(object.maxTreeDepth, 10); + else if (typeof object.maxTreeDepth === "number") + message.maxTreeDepth = object.maxTreeDepth; + else if (typeof object.maxTreeDepth === "object") + message.maxTreeDepth = new $util.LongBits(object.maxTreeDepth.low >>> 0, object.maxTreeDepth.high >>> 0).toNumber(); + if (object.subsample != null) + message.subsample = Number(object.subsample); + if (object.minSplitLoss != null) { + if (!$util.isObject(object.minSplitLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.minSplitLoss: object expected"); + message.minSplitLoss = $root.google.protobuf.DoubleValue.fromObject(object.minSplitLoss, long + 1); + } + switch (object.boosterType) { + default: + if (typeof object.boosterType === "number") { + message.boosterType = object.boosterType; + break; + } + break; + case "BOOSTER_TYPE_UNSPECIFIED": + case 0: + message.boosterType = 0; + break; + case "GBTREE": + case 1: + message.boosterType = 1; + break; + case "DART": + case 2: + message.boosterType = 2; + break; + } + if (object.numParallelTree != null) { + if (!$util.isObject(object.numParallelTree)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.numParallelTree: object expected"); + message.numParallelTree = $root.google.protobuf.Int64Value.fromObject(object.numParallelTree, long + 1); + } + switch (object.dartNormalizeType) { + default: + if (typeof object.dartNormalizeType === "number") { + message.dartNormalizeType = object.dartNormalizeType; + break; + } + break; + case "DART_NORMALIZE_TYPE_UNSPECIFIED": + case 0: + message.dartNormalizeType = 0; + break; + case "TREE": + case 1: + message.dartNormalizeType = 1; + break; + case "FOREST": + case 2: + message.dartNormalizeType = 2; + break; + } + switch (object.treeMethod) { + default: + if (typeof object.treeMethod === "number") { + message.treeMethod = object.treeMethod; + break; + } + break; + case "TREE_METHOD_UNSPECIFIED": + case 0: + message.treeMethod = 0; + break; + case "AUTO": + case 1: + message.treeMethod = 1; + break; + case "EXACT": + case 2: + message.treeMethod = 2; + break; + case "APPROX": + case 3: + message.treeMethod = 3; + break; + case "HIST": + case 4: + message.treeMethod = 4; + break; + } + if (object.minTreeChildWeight != null) { + if (!$util.isObject(object.minTreeChildWeight)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.minTreeChildWeight: object expected"); + message.minTreeChildWeight = $root.google.protobuf.Int64Value.fromObject(object.minTreeChildWeight, long + 1); + } + if (object.colsampleBytree != null) { + if (!$util.isObject(object.colsampleBytree)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.colsampleBytree: object expected"); + message.colsampleBytree = $root.google.protobuf.DoubleValue.fromObject(object.colsampleBytree, long + 1); + } + if (object.colsampleBylevel != null) { + if (!$util.isObject(object.colsampleBylevel)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.colsampleBylevel: object expected"); + message.colsampleBylevel = $root.google.protobuf.DoubleValue.fromObject(object.colsampleBylevel, long + 1); + } + if (object.colsampleBynode != null) { + if (!$util.isObject(object.colsampleBynode)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.colsampleBynode: object expected"); + message.colsampleBynode = $root.google.protobuf.DoubleValue.fromObject(object.colsampleBynode, long + 1); + } + if (object.numFactors != null) + if ($util.Long) + message.numFactors = $util.Long.fromValue(object.numFactors, false); + else if (typeof object.numFactors === "string") + message.numFactors = parseInt(object.numFactors, 10); + else if (typeof object.numFactors === "number") + message.numFactors = object.numFactors; + else if (typeof object.numFactors === "object") + message.numFactors = new $util.LongBits(object.numFactors.low >>> 0, object.numFactors.high >>> 0).toNumber(); + switch (object.feedbackType) { + default: + if (typeof object.feedbackType === "number") { + message.feedbackType = object.feedbackType; + break; + } + break; + case "FEEDBACK_TYPE_UNSPECIFIED": + case 0: + message.feedbackType = 0; + break; + case "IMPLICIT": + case 1: + message.feedbackType = 1; + break; + case "EXPLICIT": + case 2: + message.feedbackType = 2; + break; + } + if (object.walsAlpha != null) { + if (!$util.isObject(object.walsAlpha)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.walsAlpha: object expected"); + message.walsAlpha = $root.google.protobuf.DoubleValue.fromObject(object.walsAlpha, long + 1); + } + switch (object.kmeansInitializationMethod) { + default: + if (typeof object.kmeansInitializationMethod === "number") { + message.kmeansInitializationMethod = object.kmeansInitializationMethod; + break; + } + break; + case "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED": + case 0: + message.kmeansInitializationMethod = 0; + break; + case "RANDOM": + case 1: + message.kmeansInitializationMethod = 1; + break; + case "CUSTOM": + case 2: + message.kmeansInitializationMethod = 2; + break; + case "KMEANS_PLUS_PLUS": + case 3: + message.kmeansInitializationMethod = 3; + break; + } + if (object.kmeansInitializationColumn != null) + message.kmeansInitializationColumn = String(object.kmeansInitializationColumn); + if (object.timeSeriesTimestampColumn != null) + message.timeSeriesTimestampColumn = String(object.timeSeriesTimestampColumn); + if (object.timeSeriesDataColumn != null) + message.timeSeriesDataColumn = String(object.timeSeriesDataColumn); + if (object.autoArima != null) { + if (!$util.isObject(object.autoArima)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.autoArima: object expected"); + message.autoArima = $root.google.protobuf.BoolValue.fromObject(object.autoArima, long + 1); + } + if (object.nonSeasonalOrder != null) { + if (!$util.isObject(object.nonSeasonalOrder)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.nonSeasonalOrder: object expected"); + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.fromObject(object.nonSeasonalOrder, long + 1); + } + switch (object.dataFrequency) { + default: + if (typeof object.dataFrequency === "number") { + message.dataFrequency = object.dataFrequency; + break; + } + break; + case "DATA_FREQUENCY_UNSPECIFIED": + case 0: + message.dataFrequency = 0; + break; + case "AUTO_FREQUENCY": + case 1: + message.dataFrequency = 1; + break; + case "YEARLY": + case 2: + message.dataFrequency = 2; + break; + case "QUARTERLY": + case 3: + message.dataFrequency = 3; + break; + case "MONTHLY": + case 4: + message.dataFrequency = 4; + break; + case "WEEKLY": + case 5: + message.dataFrequency = 5; + break; + case "DAILY": + case 6: + message.dataFrequency = 6; + break; + case "HOURLY": + case 7: + message.dataFrequency = 7; + break; + case "PER_MINUTE": + case 8: + message.dataFrequency = 8; + break; + } + if (object.calculatePValues != null) { + if (!$util.isObject(object.calculatePValues)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.calculatePValues: object expected"); + message.calculatePValues = $root.google.protobuf.BoolValue.fromObject(object.calculatePValues, long + 1); + } + if (object.includeDrift != null) { + if (!$util.isObject(object.includeDrift)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.includeDrift: object expected"); + message.includeDrift = $root.google.protobuf.BoolValue.fromObject(object.includeDrift, long + 1); + } + switch (object.holidayRegion) { + default: + if (typeof object.holidayRegion === "number") { + message.holidayRegion = object.holidayRegion; + break; + } + break; + case "HOLIDAY_REGION_UNSPECIFIED": + case 0: + message.holidayRegion = 0; + break; + case "GLOBAL": + case 1: + message.holidayRegion = 1; + break; + case "NA": + case 2: + message.holidayRegion = 2; + break; + case "JAPAC": + case 3: + message.holidayRegion = 3; + break; + case "EMEA": + case 4: + message.holidayRegion = 4; + break; + case "LAC": + case 5: + message.holidayRegion = 5; + break; + case "AE": + case 6: + message.holidayRegion = 6; + break; + case "AR": + case 7: + message.holidayRegion = 7; + break; + case "AT": + case 8: + message.holidayRegion = 8; + break; + case "AU": + case 9: + message.holidayRegion = 9; + break; + case "BE": + case 10: + message.holidayRegion = 10; + break; + case "BR": + case 11: + message.holidayRegion = 11; + break; + case "CA": + case 12: + message.holidayRegion = 12; + break; + case "CH": + case 13: + message.holidayRegion = 13; + break; + case "CL": + case 14: + message.holidayRegion = 14; + break; + case "CN": + case 15: + message.holidayRegion = 15; + break; + case "CO": + case 16: + message.holidayRegion = 16; + break; + case "CS": + case 17: + message.holidayRegion = 17; + break; + case "CZ": + case 18: + message.holidayRegion = 18; + break; + case "DE": + case 19: + message.holidayRegion = 19; + break; + case "DK": + case 20: + message.holidayRegion = 20; + break; + case "DZ": + case 21: + message.holidayRegion = 21; + break; + case "EC": + case 22: + message.holidayRegion = 22; + break; + case "EE": + case 23: + message.holidayRegion = 23; + break; + case "EG": + case 24: + message.holidayRegion = 24; + break; + case "ES": + case 25: + message.holidayRegion = 25; + break; + case "FI": + case 26: + message.holidayRegion = 26; + break; + case "FR": + case 27: + message.holidayRegion = 27; + break; + case "GB": + case 28: + message.holidayRegion = 28; + break; + case "GR": + case 29: + message.holidayRegion = 29; + break; + case "HK": + case 30: + message.holidayRegion = 30; + break; + case "HU": + case 31: + message.holidayRegion = 31; + break; + case "ID": + case 32: + message.holidayRegion = 32; + break; + case "IE": + case 33: + message.holidayRegion = 33; + break; + case "IL": + case 34: + message.holidayRegion = 34; + break; + case "IN": + case 35: + message.holidayRegion = 35; + break; + case "IR": + case 36: + message.holidayRegion = 36; + break; + case "IT": + case 37: + message.holidayRegion = 37; + break; + case "JP": + case 38: + message.holidayRegion = 38; + break; + case "KR": + case 39: + message.holidayRegion = 39; + break; + case "LV": + case 40: + message.holidayRegion = 40; + break; + case "MA": + case 41: + message.holidayRegion = 41; + break; + case "MX": + case 42: + message.holidayRegion = 42; + break; + case "MY": + case 43: + message.holidayRegion = 43; + break; + case "NG": + case 44: + message.holidayRegion = 44; + break; + case "NL": + case 45: + message.holidayRegion = 45; + break; + case "NO": + case 46: + message.holidayRegion = 46; + break; + case "NZ": + case 47: + message.holidayRegion = 47; + break; + case "PE": + case 48: + message.holidayRegion = 48; + break; + case "PH": + case 49: + message.holidayRegion = 49; + break; + case "PK": + case 50: + message.holidayRegion = 50; + break; + case "PL": + case 51: + message.holidayRegion = 51; + break; + case "PT": + case 52: + message.holidayRegion = 52; + break; + case "RO": + case 53: + message.holidayRegion = 53; + break; + case "RS": + case 54: + message.holidayRegion = 54; + break; + case "RU": + case 55: + message.holidayRegion = 55; + break; + case "SA": + case 56: + message.holidayRegion = 56; + break; + case "SE": + case 57: + message.holidayRegion = 57; + break; + case "SG": + case 58: + message.holidayRegion = 58; + break; + case "SI": + case 59: + message.holidayRegion = 59; + break; + case "SK": + case 60: + message.holidayRegion = 60; + break; + case "TH": + case 61: + message.holidayRegion = 61; + break; + case "TR": + case 62: + message.holidayRegion = 62; + break; + case "TW": + case 63: + message.holidayRegion = 63; + break; + case "UA": + case 64: + message.holidayRegion = 64; + break; + case "US": + case 65: + message.holidayRegion = 65; + break; + case "VE": + case 66: + message.holidayRegion = 66; + break; + case "VN": + case 67: + message.holidayRegion = 67; + break; + case "ZA": + case 68: + message.holidayRegion = 68; + break; + } + if (object.holidayRegions) { + if (!Array.isArray(object.holidayRegions)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.holidayRegions: array expected"); + message.holidayRegions = []; + for (var i = 0; i < object.holidayRegions.length; ++i) + switch (object.holidayRegions[i]) { + default: + if (typeof object.holidayRegions[i] === "number") { + message.holidayRegions[i] = object.holidayRegions[i]; + break; + } + case "HOLIDAY_REGION_UNSPECIFIED": + case 0: + message.holidayRegions[i] = 0; + break; + case "GLOBAL": + case 1: + message.holidayRegions[i] = 1; + break; + case "NA": + case 2: + message.holidayRegions[i] = 2; + break; + case "JAPAC": + case 3: + message.holidayRegions[i] = 3; + break; + case "EMEA": + case 4: + message.holidayRegions[i] = 4; + break; + case "LAC": + case 5: + message.holidayRegions[i] = 5; + break; + case "AE": + case 6: + message.holidayRegions[i] = 6; + break; + case "AR": + case 7: + message.holidayRegions[i] = 7; + break; + case "AT": + case 8: + message.holidayRegions[i] = 8; + break; + case "AU": + case 9: + message.holidayRegions[i] = 9; + break; + case "BE": + case 10: + message.holidayRegions[i] = 10; + break; + case "BR": + case 11: + message.holidayRegions[i] = 11; + break; + case "CA": + case 12: + message.holidayRegions[i] = 12; + break; + case "CH": + case 13: + message.holidayRegions[i] = 13; + break; + case "CL": + case 14: + message.holidayRegions[i] = 14; + break; + case "CN": + case 15: + message.holidayRegions[i] = 15; + break; + case "CO": + case 16: + message.holidayRegions[i] = 16; + break; + case "CS": + case 17: + message.holidayRegions[i] = 17; + break; + case "CZ": + case 18: + message.holidayRegions[i] = 18; + break; + case "DE": + case 19: + message.holidayRegions[i] = 19; + break; + case "DK": + case 20: + message.holidayRegions[i] = 20; + break; + case "DZ": + case 21: + message.holidayRegions[i] = 21; + break; + case "EC": + case 22: + message.holidayRegions[i] = 22; + break; + case "EE": + case 23: + message.holidayRegions[i] = 23; + break; + case "EG": + case 24: + message.holidayRegions[i] = 24; + break; + case "ES": + case 25: + message.holidayRegions[i] = 25; + break; + case "FI": + case 26: + message.holidayRegions[i] = 26; + break; + case "FR": + case 27: + message.holidayRegions[i] = 27; + break; + case "GB": + case 28: + message.holidayRegions[i] = 28; + break; + case "GR": + case 29: + message.holidayRegions[i] = 29; + break; + case "HK": + case 30: + message.holidayRegions[i] = 30; + break; + case "HU": + case 31: + message.holidayRegions[i] = 31; + break; + case "ID": + case 32: + message.holidayRegions[i] = 32; + break; + case "IE": + case 33: + message.holidayRegions[i] = 33; + break; + case "IL": + case 34: + message.holidayRegions[i] = 34; + break; + case "IN": + case 35: + message.holidayRegions[i] = 35; + break; + case "IR": + case 36: + message.holidayRegions[i] = 36; + break; + case "IT": + case 37: + message.holidayRegions[i] = 37; + break; + case "JP": + case 38: + message.holidayRegions[i] = 38; + break; + case "KR": + case 39: + message.holidayRegions[i] = 39; + break; + case "LV": + case 40: + message.holidayRegions[i] = 40; + break; + case "MA": + case 41: + message.holidayRegions[i] = 41; + break; + case "MX": + case 42: + message.holidayRegions[i] = 42; + break; + case "MY": + case 43: + message.holidayRegions[i] = 43; + break; + case "NG": + case 44: + message.holidayRegions[i] = 44; + break; + case "NL": + case 45: + message.holidayRegions[i] = 45; + break; + case "NO": + case 46: + message.holidayRegions[i] = 46; + break; + case "NZ": + case 47: + message.holidayRegions[i] = 47; + break; + case "PE": + case 48: + message.holidayRegions[i] = 48; + break; + case "PH": + case 49: + message.holidayRegions[i] = 49; + break; + case "PK": + case 50: + message.holidayRegions[i] = 50; + break; + case "PL": + case 51: + message.holidayRegions[i] = 51; + break; + case "PT": + case 52: + message.holidayRegions[i] = 52; + break; + case "RO": + case 53: + message.holidayRegions[i] = 53; + break; + case "RS": + case 54: + message.holidayRegions[i] = 54; + break; + case "RU": + case 55: + message.holidayRegions[i] = 55; + break; + case "SA": + case 56: + message.holidayRegions[i] = 56; + break; + case "SE": + case 57: + message.holidayRegions[i] = 57; + break; + case "SG": + case 58: + message.holidayRegions[i] = 58; + break; + case "SI": + case 59: + message.holidayRegions[i] = 59; + break; + case "SK": + case 60: + message.holidayRegions[i] = 60; + break; + case "TH": + case 61: + message.holidayRegions[i] = 61; + break; + case "TR": + case 62: + message.holidayRegions[i] = 62; + break; + case "TW": + case 63: + message.holidayRegions[i] = 63; + break; + case "UA": + case 64: + message.holidayRegions[i] = 64; + break; + case "US": + case 65: + message.holidayRegions[i] = 65; + break; + case "VE": + case 66: + message.holidayRegions[i] = 66; + break; + case "VN": + case 67: + message.holidayRegions[i] = 67; + break; + case "ZA": + case 68: + message.holidayRegions[i] = 68; + break; + } + } + if (object.timeSeriesIdColumn != null) + message.timeSeriesIdColumn = String(object.timeSeriesIdColumn); + if (object.timeSeriesIdColumns) { + if (!Array.isArray(object.timeSeriesIdColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.timeSeriesIdColumns: array expected"); + message.timeSeriesIdColumns = []; + for (var i = 0; i < object.timeSeriesIdColumns.length; ++i) + message.timeSeriesIdColumns[i] = String(object.timeSeriesIdColumns[i]); + } + if (object.forecastLimitLowerBound != null) + message.forecastLimitLowerBound = Number(object.forecastLimitLowerBound); + if (object.forecastLimitUpperBound != null) + message.forecastLimitUpperBound = Number(object.forecastLimitUpperBound); + if (object.horizon != null) + if ($util.Long) + message.horizon = $util.Long.fromValue(object.horizon, false); + else if (typeof object.horizon === "string") + message.horizon = parseInt(object.horizon, 10); + else if (typeof object.horizon === "number") + message.horizon = object.horizon; + else if (typeof object.horizon === "object") + message.horizon = new $util.LongBits(object.horizon.low >>> 0, object.horizon.high >>> 0).toNumber(); + if (object.autoArimaMaxOrder != null) + if ($util.Long) + message.autoArimaMaxOrder = $util.Long.fromValue(object.autoArimaMaxOrder, false); + else if (typeof object.autoArimaMaxOrder === "string") + message.autoArimaMaxOrder = parseInt(object.autoArimaMaxOrder, 10); + else if (typeof object.autoArimaMaxOrder === "number") + message.autoArimaMaxOrder = object.autoArimaMaxOrder; + else if (typeof object.autoArimaMaxOrder === "object") + message.autoArimaMaxOrder = new $util.LongBits(object.autoArimaMaxOrder.low >>> 0, object.autoArimaMaxOrder.high >>> 0).toNumber(); + if (object.autoArimaMinOrder != null) + if ($util.Long) + message.autoArimaMinOrder = $util.Long.fromValue(object.autoArimaMinOrder, false); + else if (typeof object.autoArimaMinOrder === "string") + message.autoArimaMinOrder = parseInt(object.autoArimaMinOrder, 10); + else if (typeof object.autoArimaMinOrder === "number") + message.autoArimaMinOrder = object.autoArimaMinOrder; + else if (typeof object.autoArimaMinOrder === "object") + message.autoArimaMinOrder = new $util.LongBits(object.autoArimaMinOrder.low >>> 0, object.autoArimaMinOrder.high >>> 0).toNumber(); + if (object.numTrials != null) + if ($util.Long) + message.numTrials = $util.Long.fromValue(object.numTrials, false); + else if (typeof object.numTrials === "string") + message.numTrials = parseInt(object.numTrials, 10); + else if (typeof object.numTrials === "number") + message.numTrials = object.numTrials; + else if (typeof object.numTrials === "object") + message.numTrials = new $util.LongBits(object.numTrials.low >>> 0, object.numTrials.high >>> 0).toNumber(); + if (object.maxParallelTrials != null) + if ($util.Long) + message.maxParallelTrials = $util.Long.fromValue(object.maxParallelTrials, false); + else if (typeof object.maxParallelTrials === "string") + message.maxParallelTrials = parseInt(object.maxParallelTrials, 10); + else if (typeof object.maxParallelTrials === "number") + message.maxParallelTrials = object.maxParallelTrials; + else if (typeof object.maxParallelTrials === "object") + message.maxParallelTrials = new $util.LongBits(object.maxParallelTrials.low >>> 0, object.maxParallelTrials.high >>> 0).toNumber(); + if (object.hparamTuningObjectives) { + if (!Array.isArray(object.hparamTuningObjectives)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.hparamTuningObjectives: array expected"); + message.hparamTuningObjectives = []; + for (var i = 0; i < object.hparamTuningObjectives.length; ++i) + switch (object.hparamTuningObjectives[i]) { + default: + if (typeof object.hparamTuningObjectives[i] === "number") { + message.hparamTuningObjectives[i] = object.hparamTuningObjectives[i]; + break; + } + case "HPARAM_TUNING_OBJECTIVE_UNSPECIFIED": + case 0: + message.hparamTuningObjectives[i] = 0; + break; + case "MEAN_ABSOLUTE_ERROR": + case 1: + message.hparamTuningObjectives[i] = 1; + break; + case "MEAN_SQUARED_ERROR": + case 2: + message.hparamTuningObjectives[i] = 2; + break; + case "MEAN_SQUARED_LOG_ERROR": + case 3: + message.hparamTuningObjectives[i] = 3; + break; + case "MEDIAN_ABSOLUTE_ERROR": + case 4: + message.hparamTuningObjectives[i] = 4; + break; + case "R_SQUARED": + case 5: + message.hparamTuningObjectives[i] = 5; + break; + case "EXPLAINED_VARIANCE": + case 6: + message.hparamTuningObjectives[i] = 6; + break; + case "PRECISION": + case 7: + message.hparamTuningObjectives[i] = 7; + break; + case "RECALL": + case 8: + message.hparamTuningObjectives[i] = 8; + break; + case "ACCURACY": + case 9: + message.hparamTuningObjectives[i] = 9; + break; + case "F1_SCORE": + case 10: + message.hparamTuningObjectives[i] = 10; + break; + case "LOG_LOSS": + case 11: + message.hparamTuningObjectives[i] = 11; + break; + case "ROC_AUC": + case 12: + message.hparamTuningObjectives[i] = 12; + break; + case "DAVIES_BOULDIN_INDEX": + case 13: + message.hparamTuningObjectives[i] = 13; + break; + case "MEAN_AVERAGE_PRECISION": + case 14: + message.hparamTuningObjectives[i] = 14; + break; + case "NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN": + case 15: + message.hparamTuningObjectives[i] = 15; + break; + case "AVERAGE_RANK": + case 16: + message.hparamTuningObjectives[i] = 16; + break; + } + } + if (object.decomposeTimeSeries != null) { + if (!$util.isObject(object.decomposeTimeSeries)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.decomposeTimeSeries: object expected"); + message.decomposeTimeSeries = $root.google.protobuf.BoolValue.fromObject(object.decomposeTimeSeries, long + 1); + } + if (object.cleanSpikesAndDips != null) { + if (!$util.isObject(object.cleanSpikesAndDips)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.cleanSpikesAndDips: object expected"); + message.cleanSpikesAndDips = $root.google.protobuf.BoolValue.fromObject(object.cleanSpikesAndDips, long + 1); + } + if (object.adjustStepChanges != null) { + if (!$util.isObject(object.adjustStepChanges)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.adjustStepChanges: object expected"); + message.adjustStepChanges = $root.google.protobuf.BoolValue.fromObject(object.adjustStepChanges, long + 1); + } + if (object.enableGlobalExplain != null) { + if (!$util.isObject(object.enableGlobalExplain)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.enableGlobalExplain: object expected"); + message.enableGlobalExplain = $root.google.protobuf.BoolValue.fromObject(object.enableGlobalExplain, long + 1); + } + if (object.sampledShapleyNumPaths != null) + if ($util.Long) + message.sampledShapleyNumPaths = $util.Long.fromValue(object.sampledShapleyNumPaths, false); + else if (typeof object.sampledShapleyNumPaths === "string") + message.sampledShapleyNumPaths = parseInt(object.sampledShapleyNumPaths, 10); + else if (typeof object.sampledShapleyNumPaths === "number") + message.sampledShapleyNumPaths = object.sampledShapleyNumPaths; + else if (typeof object.sampledShapleyNumPaths === "object") + message.sampledShapleyNumPaths = new $util.LongBits(object.sampledShapleyNumPaths.low >>> 0, object.sampledShapleyNumPaths.high >>> 0).toNumber(); + if (object.integratedGradientsNumSteps != null) + if ($util.Long) + message.integratedGradientsNumSteps = $util.Long.fromValue(object.integratedGradientsNumSteps, false); + else if (typeof object.integratedGradientsNumSteps === "string") + message.integratedGradientsNumSteps = parseInt(object.integratedGradientsNumSteps, 10); + else if (typeof object.integratedGradientsNumSteps === "number") + message.integratedGradientsNumSteps = object.integratedGradientsNumSteps; + else if (typeof object.integratedGradientsNumSteps === "object") + message.integratedGradientsNumSteps = new $util.LongBits(object.integratedGradientsNumSteps.low >>> 0, object.integratedGradientsNumSteps.high >>> 0).toNumber(); + switch (object.categoryEncodingMethod) { + default: + if (typeof object.categoryEncodingMethod === "number") { + message.categoryEncodingMethod = object.categoryEncodingMethod; + break; + } + break; + case "ENCODING_METHOD_UNSPECIFIED": + case 0: + message.categoryEncodingMethod = 0; + break; + case "ONE_HOT_ENCODING": + case 1: + message.categoryEncodingMethod = 1; + break; + case "LABEL_ENCODING": + case 2: + message.categoryEncodingMethod = 2; + break; + case "DUMMY_ENCODING": + case 3: + message.categoryEncodingMethod = 3; + break; + } + if (object.tfVersion != null) + message.tfVersion = String(object.tfVersion); + switch (object.colorSpace) { + default: + if (typeof object.colorSpace === "number") { + message.colorSpace = object.colorSpace; + break; + } + break; + case "COLOR_SPACE_UNSPECIFIED": + case 0: + message.colorSpace = 0; + break; + case "RGB": + case 1: + message.colorSpace = 1; + break; + case "HSV": + case 2: + message.colorSpace = 2; + break; + case "YIQ": + case 3: + message.colorSpace = 3; + break; + case "YUV": + case 4: + message.colorSpace = 4; + break; + case "GRAYSCALE": + case 5: + message.colorSpace = 5; + break; + } + if (object.instanceWeightColumn != null) + message.instanceWeightColumn = String(object.instanceWeightColumn); + if (object.trendSmoothingWindowSize != null) + if ($util.Long) + message.trendSmoothingWindowSize = $util.Long.fromValue(object.trendSmoothingWindowSize, false); + else if (typeof object.trendSmoothingWindowSize === "string") + message.trendSmoothingWindowSize = parseInt(object.trendSmoothingWindowSize, 10); + else if (typeof object.trendSmoothingWindowSize === "number") + message.trendSmoothingWindowSize = object.trendSmoothingWindowSize; + else if (typeof object.trendSmoothingWindowSize === "object") + message.trendSmoothingWindowSize = new $util.LongBits(object.trendSmoothingWindowSize.low >>> 0, object.trendSmoothingWindowSize.high >>> 0).toNumber(); + if (object.timeSeriesLengthFraction != null) + message.timeSeriesLengthFraction = Number(object.timeSeriesLengthFraction); + if (object.minTimeSeriesLength != null) + if ($util.Long) + message.minTimeSeriesLength = $util.Long.fromValue(object.minTimeSeriesLength, false); + else if (typeof object.minTimeSeriesLength === "string") + message.minTimeSeriesLength = parseInt(object.minTimeSeriesLength, 10); + else if (typeof object.minTimeSeriesLength === "number") + message.minTimeSeriesLength = object.minTimeSeriesLength; + else if (typeof object.minTimeSeriesLength === "object") + message.minTimeSeriesLength = new $util.LongBits(object.minTimeSeriesLength.low >>> 0, object.minTimeSeriesLength.high >>> 0).toNumber(); + if (object.maxTimeSeriesLength != null) + if ($util.Long) + message.maxTimeSeriesLength = $util.Long.fromValue(object.maxTimeSeriesLength, false); + else if (typeof object.maxTimeSeriesLength === "string") + message.maxTimeSeriesLength = parseInt(object.maxTimeSeriesLength, 10); + else if (typeof object.maxTimeSeriesLength === "number") + message.maxTimeSeriesLength = object.maxTimeSeriesLength; + else if (typeof object.maxTimeSeriesLength === "object") + message.maxTimeSeriesLength = new $util.LongBits(object.maxTimeSeriesLength.low >>> 0, object.maxTimeSeriesLength.high >>> 0).toNumber(); + if (object.xgboostVersion != null) + message.xgboostVersion = String(object.xgboostVersion); + if (object.approxGlobalFeatureContrib != null) { + if (!$util.isObject(object.approxGlobalFeatureContrib)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.approxGlobalFeatureContrib: object expected"); + message.approxGlobalFeatureContrib = $root.google.protobuf.BoolValue.fromObject(object.approxGlobalFeatureContrib, long + 1); + } + if (object.fitIntercept != null) { + if (!$util.isObject(object.fitIntercept)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.fitIntercept: object expected"); + message.fitIntercept = $root.google.protobuf.BoolValue.fromObject(object.fitIntercept, long + 1); + } + if (object.numPrincipalComponents != null) + if ($util.Long) + message.numPrincipalComponents = $util.Long.fromValue(object.numPrincipalComponents, false); + else if (typeof object.numPrincipalComponents === "string") + message.numPrincipalComponents = parseInt(object.numPrincipalComponents, 10); + else if (typeof object.numPrincipalComponents === "number") + message.numPrincipalComponents = object.numPrincipalComponents; + else if (typeof object.numPrincipalComponents === "object") + message.numPrincipalComponents = new $util.LongBits(object.numPrincipalComponents.low >>> 0, object.numPrincipalComponents.high >>> 0).toNumber(); + if (object.pcaExplainedVarianceRatio != null) + message.pcaExplainedVarianceRatio = Number(object.pcaExplainedVarianceRatio); + if (object.scaleFeatures != null) { + if (!$util.isObject(object.scaleFeatures)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.scaleFeatures: object expected"); + message.scaleFeatures = $root.google.protobuf.BoolValue.fromObject(object.scaleFeatures, long + 1); + } + switch (object.pcaSolver) { + default: + if (typeof object.pcaSolver === "number") { + message.pcaSolver = object.pcaSolver; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.pcaSolver = 0; + break; + case "FULL": + case 1: + message.pcaSolver = 1; + break; + case "RANDOMIZED": + case 2: + message.pcaSolver = 2; + break; + case "AUTO": + case 3: + message.pcaSolver = 3; + break; + } + if (object.autoClassWeights != null) { + if (!$util.isObject(object.autoClassWeights)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.autoClassWeights: object expected"); + message.autoClassWeights = $root.google.protobuf.BoolValue.fromObject(object.autoClassWeights, long + 1); + } + if (object.activationFn != null) + message.activationFn = String(object.activationFn); + if (object.optimizer != null) + message.optimizer = String(object.optimizer); + if (object.budgetHours != null) + message.budgetHours = Number(object.budgetHours); + if (object.standardizeFeatures != null) { + if (!$util.isObject(object.standardizeFeatures)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.standardizeFeatures: object expected"); + message.standardizeFeatures = $root.google.protobuf.BoolValue.fromObject(object.standardizeFeatures, long + 1); + } + if (object.l1RegActivation != null) + message.l1RegActivation = Number(object.l1RegActivation); + switch (object.modelRegistry) { + default: + if (typeof object.modelRegistry === "number") { + message.modelRegistry = object.modelRegistry; + break; + } + break; + case "MODEL_REGISTRY_UNSPECIFIED": + case 0: + message.modelRegistry = 0; + break; + case "VERTEX_AI": + case 1: + message.modelRegistry = 1; + break; + } + if (object.vertexAiModelVersionAliases) { + if (!Array.isArray(object.vertexAiModelVersionAliases)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.vertexAiModelVersionAliases: array expected"); + message.vertexAiModelVersionAliases = []; + for (var i = 0; i < object.vertexAiModelVersionAliases.length; ++i) + message.vertexAiModelVersionAliases[i] = String(object.vertexAiModelVersionAliases[i]); + } + if (object.dimensionIdColumns) { + if (!Array.isArray(object.dimensionIdColumns)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.dimensionIdColumns: array expected"); + message.dimensionIdColumns = []; + for (var i = 0; i < object.dimensionIdColumns.length; ++i) + message.dimensionIdColumns[i] = String(object.dimensionIdColumns[i]); + } + if (object.contributionMetric != null) + message.contributionMetric = String(object.contributionMetric); + if (object.isTestColumn != null) + message.isTestColumn = String(object.isTestColumn); + if (object.minAprioriSupport != null) + message.minAprioriSupport = Number(object.minAprioriSupport); + if (object.huggingFaceModelId != null) + message.huggingFaceModelId = String(object.huggingFaceModelId); + if (object.modelGardenModelName != null) + message.modelGardenModelName = String(object.modelGardenModelName); + if (object.endpointIdleTtl != null) { + if (!$util.isObject(object.endpointIdleTtl)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.endpointIdleTtl: object expected"); + message.endpointIdleTtl = $root.google.protobuf.Duration.fromObject(object.endpointIdleTtl, long + 1); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minReplicaCount != null) + if ($util.Long) + message.minReplicaCount = $util.Long.fromValue(object.minReplicaCount, false); + else if (typeof object.minReplicaCount === "string") + message.minReplicaCount = parseInt(object.minReplicaCount, 10); + else if (typeof object.minReplicaCount === "number") + message.minReplicaCount = object.minReplicaCount; + else if (typeof object.minReplicaCount === "object") + message.minReplicaCount = new $util.LongBits(object.minReplicaCount.low >>> 0, object.minReplicaCount.high >>> 0).toNumber(); + if (object.maxReplicaCount != null) + if ($util.Long) + message.maxReplicaCount = $util.Long.fromValue(object.maxReplicaCount, false); + else if (typeof object.maxReplicaCount === "string") + message.maxReplicaCount = parseInt(object.maxReplicaCount, 10); + else if (typeof object.maxReplicaCount === "number") + message.maxReplicaCount = object.maxReplicaCount; + else if (typeof object.maxReplicaCount === "object") + message.maxReplicaCount = new $util.LongBits(object.maxReplicaCount.low >>> 0, object.maxReplicaCount.high >>> 0).toNumber(); + switch (object.reservationAffinityType) { + default: + if (typeof object.reservationAffinityType === "number") { + message.reservationAffinityType = object.reservationAffinityType; + break; + } + break; + case "RESERVATION_AFFINITY_TYPE_UNSPECIFIED": + case 0: + message.reservationAffinityType = 0; + break; + case "NO_RESERVATION": + case 1: + message.reservationAffinityType = 1; + break; + case "ANY_RESERVATION": + case 2: + message.reservationAffinityType = 2; + break; + case "SPECIFIC_RESERVATION": + case 3: + message.reservationAffinityType = 3; + break; + } + if (object.reservationAffinityKey != null) + message.reservationAffinityKey = String(object.reservationAffinityKey); + if (object.reservationAffinityValues) { + if (!Array.isArray(object.reservationAffinityValues)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.reservationAffinityValues: array expected"); + message.reservationAffinityValues = []; + for (var i = 0; i < object.reservationAffinityValues.length; ++i) + message.reservationAffinityValues[i] = String(object.reservationAffinityValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a TrainingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions} message TrainingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.inputLabelColumns = []; + object.hiddenUnits = []; + object.timeSeriesIdColumns = []; + object.hparamTuningObjectives = []; + object.holidayRegions = []; + object.vertexAiModelVersionAliases = []; + object.dimensionIdColumns = []; + object.reservationAffinityValues = []; + } + if (options.objects || options.defaults) + object.labelClassWeights = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxIterations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxIterations = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.lossType = options.enums === String ? "LOSS_TYPE_UNSPECIFIED" : 0; + object.learnRate = 0; + object.l1Regularization = null; + object.l2Regularization = null; + object.minRelativeProgress = null; + object.warmStart = null; + object.earlyStop = null; + object.dataSplitMethod = options.enums === String ? "DATA_SPLIT_METHOD_UNSPECIFIED" : 0; + object.dataSplitEvalFraction = 0; + object.dataSplitColumn = ""; + object.learnRateStrategy = options.enums === String ? "LEARN_RATE_STRATEGY_UNSPECIFIED" : 0; + object.initialLearnRate = 0; + object.userColumn = ""; + object.itemColumn = ""; + object.distanceType = options.enums === String ? "DISTANCE_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numClusters = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numClusters = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.modelUri = ""; + object.optimizationStrategy = options.enums === String ? "OPTIMIZATION_STRATEGY_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.batchSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.batchSize = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.dropout = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxTreeDepth = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxTreeDepth = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.subsample = 0; + object.minSplitLoss = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numFactors = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numFactors = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.feedbackType = options.enums === String ? "FEEDBACK_TYPE_UNSPECIFIED" : 0; + object.walsAlpha = null; + object.kmeansInitializationMethod = options.enums === String ? "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED" : 0; + object.kmeansInitializationColumn = ""; + object.timeSeriesTimestampColumn = ""; + object.timeSeriesDataColumn = ""; + object.autoArima = null; + object.nonSeasonalOrder = null; + object.dataFrequency = options.enums === String ? "DATA_FREQUENCY_UNSPECIFIED" : 0; + object.calculatePValues = null; + object.includeDrift = null; + object.holidayRegion = options.enums === String ? "HOLIDAY_REGION_UNSPECIFIED" : 0; + object.timeSeriesIdColumn = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.horizon = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.horizon = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.autoArimaMaxOrder = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.autoArimaMaxOrder = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numTrials = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numTrials = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxParallelTrials = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxParallelTrials = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.decomposeTimeSeries = null; + object.cleanSpikesAndDips = null; + object.adjustStepChanges = null; + object.enableGlobalExplain = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sampledShapleyNumPaths = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.sampledShapleyNumPaths = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.integratedGradientsNumSteps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.integratedGradientsNumSteps = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.categoryEncodingMethod = options.enums === String ? "ENCODING_METHOD_UNSPECIFIED" : 0; + object.boosterType = options.enums === String ? "BOOSTER_TYPE_UNSPECIFIED" : 0; + object.numParallelTree = null; + object.dartNormalizeType = options.enums === String ? "DART_NORMALIZE_TYPE_UNSPECIFIED" : 0; + object.treeMethod = options.enums === String ? "TREE_METHOD_UNSPECIFIED" : 0; + object.minTreeChildWeight = null; + object.colsampleBytree = null; + object.colsampleBylevel = null; + object.colsampleBynode = null; + object.tfVersion = ""; + object.colorSpace = options.enums === String ? "COLOR_SPACE_UNSPECIFIED" : 0; + object.instanceWeightColumn = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trendSmoothingWindowSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.trendSmoothingWindowSize = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.timeSeriesLengthFraction = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minTimeSeriesLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.minTimeSeriesLength = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxTimeSeriesLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxTimeSeriesLength = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.xgboostVersion = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.autoArimaMinOrder = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.autoArimaMinOrder = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.approxGlobalFeatureContrib = null; + object.fitIntercept = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numPrincipalComponents = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.numPrincipalComponents = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.pcaExplainedVarianceRatio = 0; + object.scaleFeatures = null; + object.pcaSolver = options.enums === String ? "UNSPECIFIED" : 0; + object.autoClassWeights = null; + object.activationFn = ""; + object.optimizer = ""; + object.budgetHours = 0; + object.standardizeFeatures = null; + object.l1RegActivation = 0; + object.modelRegistry = options.enums === String ? "MODEL_REGISTRY_UNSPECIFIED" : 0; + object.forecastLimitLowerBound = 0; + object.forecastLimitUpperBound = 0; + } + if (message.maxIterations != null && Object.hasOwnProperty.call(message, "maxIterations")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxIterations = typeof message.maxIterations === "number" ? BigInt(message.maxIterations) : $util.Long.fromBits(message.maxIterations.low >>> 0, message.maxIterations.high >>> 0, false).toBigInt(); + else if (typeof message.maxIterations === "number") + object.maxIterations = options.longs === String ? String(message.maxIterations) : message.maxIterations; + else + object.maxIterations = options.longs === String ? $util.Long.prototype.toString.call(message.maxIterations) : options.longs === Number ? new $util.LongBits(message.maxIterations.low >>> 0, message.maxIterations.high >>> 0).toNumber() : message.maxIterations; + if (message.lossType != null && Object.hasOwnProperty.call(message, "lossType")) + object.lossType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.LossType[message.lossType] === undefined ? message.lossType : $root.google.cloud.bigquery.v2.Model.LossType[message.lossType] : message.lossType; + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + object.learnRate = options.json && !isFinite(message.learnRate) ? String(message.learnRate) : message.learnRate; + if (message.l1Regularization != null && Object.hasOwnProperty.call(message, "l1Regularization")) + object.l1Regularization = $root.google.protobuf.DoubleValue.toObject(message.l1Regularization, options, q + 1); + if (message.l2Regularization != null && Object.hasOwnProperty.call(message, "l2Regularization")) + object.l2Regularization = $root.google.protobuf.DoubleValue.toObject(message.l2Regularization, options, q + 1); + if (message.minRelativeProgress != null && Object.hasOwnProperty.call(message, "minRelativeProgress")) + object.minRelativeProgress = $root.google.protobuf.DoubleValue.toObject(message.minRelativeProgress, options, q + 1); + if (message.warmStart != null && Object.hasOwnProperty.call(message, "warmStart")) + object.warmStart = $root.google.protobuf.BoolValue.toObject(message.warmStart, options, q + 1); + if (message.earlyStop != null && Object.hasOwnProperty.call(message, "earlyStop")) + object.earlyStop = $root.google.protobuf.BoolValue.toObject(message.earlyStop, options, q + 1); + if (message.inputLabelColumns && message.inputLabelColumns.length) { + object.inputLabelColumns = []; + for (var j = 0; j < message.inputLabelColumns.length; ++j) + object.inputLabelColumns[j] = message.inputLabelColumns[j]; + } + if (message.dataSplitMethod != null && Object.hasOwnProperty.call(message, "dataSplitMethod")) + object.dataSplitMethod = options.enums === String ? $root.google.cloud.bigquery.v2.Model.DataSplitMethod[message.dataSplitMethod] === undefined ? message.dataSplitMethod : $root.google.cloud.bigquery.v2.Model.DataSplitMethod[message.dataSplitMethod] : message.dataSplitMethod; + if (message.dataSplitEvalFraction != null && Object.hasOwnProperty.call(message, "dataSplitEvalFraction")) + object.dataSplitEvalFraction = options.json && !isFinite(message.dataSplitEvalFraction) ? String(message.dataSplitEvalFraction) : message.dataSplitEvalFraction; + if (message.dataSplitColumn != null && Object.hasOwnProperty.call(message, "dataSplitColumn")) + object.dataSplitColumn = message.dataSplitColumn; + if (message.learnRateStrategy != null && Object.hasOwnProperty.call(message, "learnRateStrategy")) + object.learnRateStrategy = options.enums === String ? $root.google.cloud.bigquery.v2.Model.LearnRateStrategy[message.learnRateStrategy] === undefined ? message.learnRateStrategy : $root.google.cloud.bigquery.v2.Model.LearnRateStrategy[message.learnRateStrategy] : message.learnRateStrategy; + if (message.initialLearnRate != null && Object.hasOwnProperty.call(message, "initialLearnRate")) + object.initialLearnRate = options.json && !isFinite(message.initialLearnRate) ? String(message.initialLearnRate) : message.initialLearnRate; + var keys2; + if (message.labelClassWeights && (keys2 = Object.keys(message.labelClassWeights)).length) { + object.labelClassWeights = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labelClassWeights, keys2[j]); + object.labelClassWeights[keys2[j]] = options.json && !isFinite(message.labelClassWeights[keys2[j]]) ? String(message.labelClassWeights[keys2[j]]) : message.labelClassWeights[keys2[j]]; + } + } + if (message.userColumn != null && Object.hasOwnProperty.call(message, "userColumn")) + object.userColumn = message.userColumn; + if (message.itemColumn != null && Object.hasOwnProperty.call(message, "itemColumn")) + object.itemColumn = message.itemColumn; + if (message.distanceType != null && Object.hasOwnProperty.call(message, "distanceType")) + object.distanceType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.DistanceType[message.distanceType] === undefined ? message.distanceType : $root.google.cloud.bigquery.v2.Model.DistanceType[message.distanceType] : message.distanceType; + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numClusters = typeof message.numClusters === "number" ? BigInt(message.numClusters) : $util.Long.fromBits(message.numClusters.low >>> 0, message.numClusters.high >>> 0, false).toBigInt(); + else if (typeof message.numClusters === "number") + object.numClusters = options.longs === String ? String(message.numClusters) : message.numClusters; + else + object.numClusters = options.longs === String ? $util.Long.prototype.toString.call(message.numClusters) : options.longs === Number ? new $util.LongBits(message.numClusters.low >>> 0, message.numClusters.high >>> 0).toNumber() : message.numClusters; + if (message.modelUri != null && Object.hasOwnProperty.call(message, "modelUri")) + object.modelUri = message.modelUri; + if (message.optimizationStrategy != null && Object.hasOwnProperty.call(message, "optimizationStrategy")) + object.optimizationStrategy = options.enums === String ? $root.google.cloud.bigquery.v2.Model.OptimizationStrategy[message.optimizationStrategy] === undefined ? message.optimizationStrategy : $root.google.cloud.bigquery.v2.Model.OptimizationStrategy[message.optimizationStrategy] : message.optimizationStrategy; + if (message.hiddenUnits && message.hiddenUnits.length) { + object.hiddenUnits = []; + for (var j = 0; j < message.hiddenUnits.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.hiddenUnits[j] = typeof message.hiddenUnits[j] === "number" ? BigInt(message.hiddenUnits[j]) : $util.Long.fromBits(message.hiddenUnits[j].low >>> 0, message.hiddenUnits[j].high >>> 0, false).toBigInt(); + else if (typeof message.hiddenUnits[j] === "number") + object.hiddenUnits[j] = options.longs === String ? String(message.hiddenUnits[j]) : message.hiddenUnits[j]; + else + object.hiddenUnits[j] = options.longs === String ? $util.Long.prototype.toString.call(message.hiddenUnits[j]) : options.longs === Number ? new $util.LongBits(message.hiddenUnits[j].low >>> 0, message.hiddenUnits[j].high >>> 0).toNumber() : message.hiddenUnits[j]; + } + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.batchSize = typeof message.batchSize === "number" ? BigInt(message.batchSize) : $util.Long.fromBits(message.batchSize.low >>> 0, message.batchSize.high >>> 0, false).toBigInt(); + else if (typeof message.batchSize === "number") + object.batchSize = options.longs === String ? String(message.batchSize) : message.batchSize; + else + object.batchSize = options.longs === String ? $util.Long.prototype.toString.call(message.batchSize) : options.longs === Number ? new $util.LongBits(message.batchSize.low >>> 0, message.batchSize.high >>> 0).toNumber() : message.batchSize; + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) + object.dropout = $root.google.protobuf.DoubleValue.toObject(message.dropout, options, q + 1); + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxTreeDepth = typeof message.maxTreeDepth === "number" ? BigInt(message.maxTreeDepth) : $util.Long.fromBits(message.maxTreeDepth.low >>> 0, message.maxTreeDepth.high >>> 0, false).toBigInt(); + else if (typeof message.maxTreeDepth === "number") + object.maxTreeDepth = options.longs === String ? String(message.maxTreeDepth) : message.maxTreeDepth; + else + object.maxTreeDepth = options.longs === String ? $util.Long.prototype.toString.call(message.maxTreeDepth) : options.longs === Number ? new $util.LongBits(message.maxTreeDepth.low >>> 0, message.maxTreeDepth.high >>> 0).toNumber() : message.maxTreeDepth; + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) + object.subsample = options.json && !isFinite(message.subsample) ? String(message.subsample) : message.subsample; + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) + object.minSplitLoss = $root.google.protobuf.DoubleValue.toObject(message.minSplitLoss, options, q + 1); + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numFactors = typeof message.numFactors === "number" ? BigInt(message.numFactors) : $util.Long.fromBits(message.numFactors.low >>> 0, message.numFactors.high >>> 0, false).toBigInt(); + else if (typeof message.numFactors === "number") + object.numFactors = options.longs === String ? String(message.numFactors) : message.numFactors; + else + object.numFactors = options.longs === String ? $util.Long.prototype.toString.call(message.numFactors) : options.longs === Number ? new $util.LongBits(message.numFactors.low >>> 0, message.numFactors.high >>> 0).toNumber() : message.numFactors; + if (message.feedbackType != null && Object.hasOwnProperty.call(message, "feedbackType")) + object.feedbackType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.FeedbackType[message.feedbackType] === undefined ? message.feedbackType : $root.google.cloud.bigquery.v2.Model.FeedbackType[message.feedbackType] : message.feedbackType; + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) + object.walsAlpha = $root.google.protobuf.DoubleValue.toObject(message.walsAlpha, options, q + 1); + if (message.kmeansInitializationMethod != null && Object.hasOwnProperty.call(message, "kmeansInitializationMethod")) + object.kmeansInitializationMethod = options.enums === String ? $root.google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod[message.kmeansInitializationMethod] === undefined ? message.kmeansInitializationMethod : $root.google.cloud.bigquery.v2.Model.KmeansEnums.KmeansInitializationMethod[message.kmeansInitializationMethod] : message.kmeansInitializationMethod; + if (message.kmeansInitializationColumn != null && Object.hasOwnProperty.call(message, "kmeansInitializationColumn")) + object.kmeansInitializationColumn = message.kmeansInitializationColumn; + if (message.timeSeriesTimestampColumn != null && Object.hasOwnProperty.call(message, "timeSeriesTimestampColumn")) + object.timeSeriesTimestampColumn = message.timeSeriesTimestampColumn; + if (message.timeSeriesDataColumn != null && Object.hasOwnProperty.call(message, "timeSeriesDataColumn")) + object.timeSeriesDataColumn = message.timeSeriesDataColumn; + if (message.autoArima != null && Object.hasOwnProperty.call(message, "autoArima")) + object.autoArima = $root.google.protobuf.BoolValue.toObject(message.autoArima, options, q + 1); + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + object.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.toObject(message.nonSeasonalOrder, options, q + 1); + if (message.dataFrequency != null && Object.hasOwnProperty.call(message, "dataFrequency")) + object.dataFrequency = options.enums === String ? $root.google.cloud.bigquery.v2.Model.DataFrequency[message.dataFrequency] === undefined ? message.dataFrequency : $root.google.cloud.bigquery.v2.Model.DataFrequency[message.dataFrequency] : message.dataFrequency; + if (message.calculatePValues != null && Object.hasOwnProperty.call(message, "calculatePValues")) + object.calculatePValues = $root.google.protobuf.BoolValue.toObject(message.calculatePValues, options, q + 1); + if (message.includeDrift != null && Object.hasOwnProperty.call(message, "includeDrift")) + object.includeDrift = $root.google.protobuf.BoolValue.toObject(message.includeDrift, options, q + 1); + if (message.holidayRegion != null && Object.hasOwnProperty.call(message, "holidayRegion")) + object.holidayRegion = options.enums === String ? $root.google.cloud.bigquery.v2.Model.HolidayRegion[message.holidayRegion] === undefined ? message.holidayRegion : $root.google.cloud.bigquery.v2.Model.HolidayRegion[message.holidayRegion] : message.holidayRegion; + if (message.timeSeriesIdColumn != null && Object.hasOwnProperty.call(message, "timeSeriesIdColumn")) + object.timeSeriesIdColumn = message.timeSeriesIdColumn; + if (message.horizon != null && Object.hasOwnProperty.call(message, "horizon")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.horizon = typeof message.horizon === "number" ? BigInt(message.horizon) : $util.Long.fromBits(message.horizon.low >>> 0, message.horizon.high >>> 0, false).toBigInt(); + else if (typeof message.horizon === "number") + object.horizon = options.longs === String ? String(message.horizon) : message.horizon; + else + object.horizon = options.longs === String ? $util.Long.prototype.toString.call(message.horizon) : options.longs === Number ? new $util.LongBits(message.horizon.low >>> 0, message.horizon.high >>> 0).toNumber() : message.horizon; + if (message.autoArimaMaxOrder != null && Object.hasOwnProperty.call(message, "autoArimaMaxOrder")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.autoArimaMaxOrder = typeof message.autoArimaMaxOrder === "number" ? BigInt(message.autoArimaMaxOrder) : $util.Long.fromBits(message.autoArimaMaxOrder.low >>> 0, message.autoArimaMaxOrder.high >>> 0, false).toBigInt(); + else if (typeof message.autoArimaMaxOrder === "number") + object.autoArimaMaxOrder = options.longs === String ? String(message.autoArimaMaxOrder) : message.autoArimaMaxOrder; + else + object.autoArimaMaxOrder = options.longs === String ? $util.Long.prototype.toString.call(message.autoArimaMaxOrder) : options.longs === Number ? new $util.LongBits(message.autoArimaMaxOrder.low >>> 0, message.autoArimaMaxOrder.high >>> 0).toNumber() : message.autoArimaMaxOrder; + if (message.numTrials != null && Object.hasOwnProperty.call(message, "numTrials")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numTrials = typeof message.numTrials === "number" ? BigInt(message.numTrials) : $util.Long.fromBits(message.numTrials.low >>> 0, message.numTrials.high >>> 0, false).toBigInt(); + else if (typeof message.numTrials === "number") + object.numTrials = options.longs === String ? String(message.numTrials) : message.numTrials; + else + object.numTrials = options.longs === String ? $util.Long.prototype.toString.call(message.numTrials) : options.longs === Number ? new $util.LongBits(message.numTrials.low >>> 0, message.numTrials.high >>> 0).toNumber() : message.numTrials; + if (message.maxParallelTrials != null && Object.hasOwnProperty.call(message, "maxParallelTrials")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxParallelTrials = typeof message.maxParallelTrials === "number" ? BigInt(message.maxParallelTrials) : $util.Long.fromBits(message.maxParallelTrials.low >>> 0, message.maxParallelTrials.high >>> 0, false).toBigInt(); + else if (typeof message.maxParallelTrials === "number") + object.maxParallelTrials = options.longs === String ? String(message.maxParallelTrials) : message.maxParallelTrials; + else + object.maxParallelTrials = options.longs === String ? $util.Long.prototype.toString.call(message.maxParallelTrials) : options.longs === Number ? new $util.LongBits(message.maxParallelTrials.low >>> 0, message.maxParallelTrials.high >>> 0).toNumber() : message.maxParallelTrials; + if (message.decomposeTimeSeries != null && Object.hasOwnProperty.call(message, "decomposeTimeSeries")) + object.decomposeTimeSeries = $root.google.protobuf.BoolValue.toObject(message.decomposeTimeSeries, options, q + 1); + if (message.timeSeriesIdColumns && message.timeSeriesIdColumns.length) { + object.timeSeriesIdColumns = []; + for (var j = 0; j < message.timeSeriesIdColumns.length; ++j) + object.timeSeriesIdColumns[j] = message.timeSeriesIdColumns[j]; + } + if (message.cleanSpikesAndDips != null && Object.hasOwnProperty.call(message, "cleanSpikesAndDips")) + object.cleanSpikesAndDips = $root.google.protobuf.BoolValue.toObject(message.cleanSpikesAndDips, options, q + 1); + if (message.adjustStepChanges != null && Object.hasOwnProperty.call(message, "adjustStepChanges")) + object.adjustStepChanges = $root.google.protobuf.BoolValue.toObject(message.adjustStepChanges, options, q + 1); + if (message.hparamTuningObjectives && message.hparamTuningObjectives.length) { + object.hparamTuningObjectives = []; + for (var j = 0; j < message.hparamTuningObjectives.length; ++j) + object.hparamTuningObjectives[j] = options.enums === String ? $root.google.cloud.bigquery.v2.Model.HparamTuningEnums.HparamTuningObjective[message.hparamTuningObjectives[j]] === undefined ? message.hparamTuningObjectives[j] : $root.google.cloud.bigquery.v2.Model.HparamTuningEnums.HparamTuningObjective[message.hparamTuningObjectives[j]] : message.hparamTuningObjectives[j]; + } + if (message.enableGlobalExplain != null && Object.hasOwnProperty.call(message, "enableGlobalExplain")) + object.enableGlobalExplain = $root.google.protobuf.BoolValue.toObject(message.enableGlobalExplain, options, q + 1); + if (message.sampledShapleyNumPaths != null && Object.hasOwnProperty.call(message, "sampledShapleyNumPaths")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.sampledShapleyNumPaths = typeof message.sampledShapleyNumPaths === "number" ? BigInt(message.sampledShapleyNumPaths) : $util.Long.fromBits(message.sampledShapleyNumPaths.low >>> 0, message.sampledShapleyNumPaths.high >>> 0, false).toBigInt(); + else if (typeof message.sampledShapleyNumPaths === "number") + object.sampledShapleyNumPaths = options.longs === String ? String(message.sampledShapleyNumPaths) : message.sampledShapleyNumPaths; + else + object.sampledShapleyNumPaths = options.longs === String ? $util.Long.prototype.toString.call(message.sampledShapleyNumPaths) : options.longs === Number ? new $util.LongBits(message.sampledShapleyNumPaths.low >>> 0, message.sampledShapleyNumPaths.high >>> 0).toNumber() : message.sampledShapleyNumPaths; + if (message.integratedGradientsNumSteps != null && Object.hasOwnProperty.call(message, "integratedGradientsNumSteps")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.integratedGradientsNumSteps = typeof message.integratedGradientsNumSteps === "number" ? BigInt(message.integratedGradientsNumSteps) : $util.Long.fromBits(message.integratedGradientsNumSteps.low >>> 0, message.integratedGradientsNumSteps.high >>> 0, false).toBigInt(); + else if (typeof message.integratedGradientsNumSteps === "number") + object.integratedGradientsNumSteps = options.longs === String ? String(message.integratedGradientsNumSteps) : message.integratedGradientsNumSteps; + else + object.integratedGradientsNumSteps = options.longs === String ? $util.Long.prototype.toString.call(message.integratedGradientsNumSteps) : options.longs === Number ? new $util.LongBits(message.integratedGradientsNumSteps.low >>> 0, message.integratedGradientsNumSteps.high >>> 0).toNumber() : message.integratedGradientsNumSteps; + if (message.categoryEncodingMethod != null && Object.hasOwnProperty.call(message, "categoryEncodingMethod")) + object.categoryEncodingMethod = options.enums === String ? $root.google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod[message.categoryEncodingMethod] === undefined ? message.categoryEncodingMethod : $root.google.cloud.bigquery.v2.Model.CategoryEncodingMethod.EncodingMethod[message.categoryEncodingMethod] : message.categoryEncodingMethod; + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) + object.boosterType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType[message.boosterType] === undefined ? message.boosterType : $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.BoosterType[message.boosterType] : message.boosterType; + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) + object.numParallelTree = $root.google.protobuf.Int64Value.toObject(message.numParallelTree, options, q + 1); + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) + object.dartNormalizeType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType[message.dartNormalizeType] === undefined ? message.dartNormalizeType : $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.DartNormalizeType[message.dartNormalizeType] : message.dartNormalizeType; + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) + object.treeMethod = options.enums === String ? $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod[message.treeMethod] === undefined ? message.treeMethod : $root.google.cloud.bigquery.v2.Model.BoostedTreeOptionEnums.TreeMethod[message.treeMethod] : message.treeMethod; + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) + object.minTreeChildWeight = $root.google.protobuf.Int64Value.toObject(message.minTreeChildWeight, options, q + 1); + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) + object.colsampleBytree = $root.google.protobuf.DoubleValue.toObject(message.colsampleBytree, options, q + 1); + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) + object.colsampleBylevel = $root.google.protobuf.DoubleValue.toObject(message.colsampleBylevel, options, q + 1); + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) + object.colsampleBynode = $root.google.protobuf.DoubleValue.toObject(message.colsampleBynode, options, q + 1); + if (message.tfVersion != null && Object.hasOwnProperty.call(message, "tfVersion")) + object.tfVersion = message.tfVersion; + if (message.holidayRegions && message.holidayRegions.length) { + object.holidayRegions = []; + for (var j = 0; j < message.holidayRegions.length; ++j) + object.holidayRegions[j] = options.enums === String ? $root.google.cloud.bigquery.v2.Model.HolidayRegion[message.holidayRegions[j]] === undefined ? message.holidayRegions[j] : $root.google.cloud.bigquery.v2.Model.HolidayRegion[message.holidayRegions[j]] : message.holidayRegions[j]; + } + if (message.colorSpace != null && Object.hasOwnProperty.call(message, "colorSpace")) + object.colorSpace = options.enums === String ? $root.google.cloud.bigquery.v2.Model.ColorSpace[message.colorSpace] === undefined ? message.colorSpace : $root.google.cloud.bigquery.v2.Model.ColorSpace[message.colorSpace] : message.colorSpace; + if (message.instanceWeightColumn != null && Object.hasOwnProperty.call(message, "instanceWeightColumn")) + object.instanceWeightColumn = message.instanceWeightColumn; + if (message.trendSmoothingWindowSize != null && Object.hasOwnProperty.call(message, "trendSmoothingWindowSize")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.trendSmoothingWindowSize = typeof message.trendSmoothingWindowSize === "number" ? BigInt(message.trendSmoothingWindowSize) : $util.Long.fromBits(message.trendSmoothingWindowSize.low >>> 0, message.trendSmoothingWindowSize.high >>> 0, false).toBigInt(); + else if (typeof message.trendSmoothingWindowSize === "number") + object.trendSmoothingWindowSize = options.longs === String ? String(message.trendSmoothingWindowSize) : message.trendSmoothingWindowSize; + else + object.trendSmoothingWindowSize = options.longs === String ? $util.Long.prototype.toString.call(message.trendSmoothingWindowSize) : options.longs === Number ? new $util.LongBits(message.trendSmoothingWindowSize.low >>> 0, message.trendSmoothingWindowSize.high >>> 0).toNumber() : message.trendSmoothingWindowSize; + if (message.timeSeriesLengthFraction != null && Object.hasOwnProperty.call(message, "timeSeriesLengthFraction")) + object.timeSeriesLengthFraction = options.json && !isFinite(message.timeSeriesLengthFraction) ? String(message.timeSeriesLengthFraction) : message.timeSeriesLengthFraction; + if (message.minTimeSeriesLength != null && Object.hasOwnProperty.call(message, "minTimeSeriesLength")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minTimeSeriesLength = typeof message.minTimeSeriesLength === "number" ? BigInt(message.minTimeSeriesLength) : $util.Long.fromBits(message.minTimeSeriesLength.low >>> 0, message.minTimeSeriesLength.high >>> 0, false).toBigInt(); + else if (typeof message.minTimeSeriesLength === "number") + object.minTimeSeriesLength = options.longs === String ? String(message.minTimeSeriesLength) : message.minTimeSeriesLength; + else + object.minTimeSeriesLength = options.longs === String ? $util.Long.prototype.toString.call(message.minTimeSeriesLength) : options.longs === Number ? new $util.LongBits(message.minTimeSeriesLength.low >>> 0, message.minTimeSeriesLength.high >>> 0).toNumber() : message.minTimeSeriesLength; + if (message.maxTimeSeriesLength != null && Object.hasOwnProperty.call(message, "maxTimeSeriesLength")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxTimeSeriesLength = typeof message.maxTimeSeriesLength === "number" ? BigInt(message.maxTimeSeriesLength) : $util.Long.fromBits(message.maxTimeSeriesLength.low >>> 0, message.maxTimeSeriesLength.high >>> 0, false).toBigInt(); + else if (typeof message.maxTimeSeriesLength === "number") + object.maxTimeSeriesLength = options.longs === String ? String(message.maxTimeSeriesLength) : message.maxTimeSeriesLength; + else + object.maxTimeSeriesLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxTimeSeriesLength) : options.longs === Number ? new $util.LongBits(message.maxTimeSeriesLength.low >>> 0, message.maxTimeSeriesLength.high >>> 0).toNumber() : message.maxTimeSeriesLength; + if (message.xgboostVersion != null && Object.hasOwnProperty.call(message, "xgboostVersion")) + object.xgboostVersion = message.xgboostVersion; + if (message.autoArimaMinOrder != null && Object.hasOwnProperty.call(message, "autoArimaMinOrder")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.autoArimaMinOrder = typeof message.autoArimaMinOrder === "number" ? BigInt(message.autoArimaMinOrder) : $util.Long.fromBits(message.autoArimaMinOrder.low >>> 0, message.autoArimaMinOrder.high >>> 0, false).toBigInt(); + else if (typeof message.autoArimaMinOrder === "number") + object.autoArimaMinOrder = options.longs === String ? String(message.autoArimaMinOrder) : message.autoArimaMinOrder; + else + object.autoArimaMinOrder = options.longs === String ? $util.Long.prototype.toString.call(message.autoArimaMinOrder) : options.longs === Number ? new $util.LongBits(message.autoArimaMinOrder.low >>> 0, message.autoArimaMinOrder.high >>> 0).toNumber() : message.autoArimaMinOrder; + if (message.approxGlobalFeatureContrib != null && Object.hasOwnProperty.call(message, "approxGlobalFeatureContrib")) + object.approxGlobalFeatureContrib = $root.google.protobuf.BoolValue.toObject(message.approxGlobalFeatureContrib, options, q + 1); + if (message.fitIntercept != null && Object.hasOwnProperty.call(message, "fitIntercept")) + object.fitIntercept = $root.google.protobuf.BoolValue.toObject(message.fitIntercept, options, q + 1); + if (message.numPrincipalComponents != null && Object.hasOwnProperty.call(message, "numPrincipalComponents")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.numPrincipalComponents = typeof message.numPrincipalComponents === "number" ? BigInt(message.numPrincipalComponents) : $util.Long.fromBits(message.numPrincipalComponents.low >>> 0, message.numPrincipalComponents.high >>> 0, false).toBigInt(); + else if (typeof message.numPrincipalComponents === "number") + object.numPrincipalComponents = options.longs === String ? String(message.numPrincipalComponents) : message.numPrincipalComponents; + else + object.numPrincipalComponents = options.longs === String ? $util.Long.prototype.toString.call(message.numPrincipalComponents) : options.longs === Number ? new $util.LongBits(message.numPrincipalComponents.low >>> 0, message.numPrincipalComponents.high >>> 0).toNumber() : message.numPrincipalComponents; + if (message.pcaExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "pcaExplainedVarianceRatio")) + object.pcaExplainedVarianceRatio = options.json && !isFinite(message.pcaExplainedVarianceRatio) ? String(message.pcaExplainedVarianceRatio) : message.pcaExplainedVarianceRatio; + if (message.scaleFeatures != null && Object.hasOwnProperty.call(message, "scaleFeatures")) + object.scaleFeatures = $root.google.protobuf.BoolValue.toObject(message.scaleFeatures, options, q + 1); + if (message.pcaSolver != null && Object.hasOwnProperty.call(message, "pcaSolver")) + object.pcaSolver = options.enums === String ? $root.google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver[message.pcaSolver] === undefined ? message.pcaSolver : $root.google.cloud.bigquery.v2.Model.PcaSolverOptionEnums.PcaSolver[message.pcaSolver] : message.pcaSolver; + if (message.autoClassWeights != null && Object.hasOwnProperty.call(message, "autoClassWeights")) + object.autoClassWeights = $root.google.protobuf.BoolValue.toObject(message.autoClassWeights, options, q + 1); + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) + object.activationFn = message.activationFn; + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) + object.optimizer = message.optimizer; + if (message.budgetHours != null && Object.hasOwnProperty.call(message, "budgetHours")) + object.budgetHours = options.json && !isFinite(message.budgetHours) ? String(message.budgetHours) : message.budgetHours; + if (message.standardizeFeatures != null && Object.hasOwnProperty.call(message, "standardizeFeatures")) + object.standardizeFeatures = $root.google.protobuf.BoolValue.toObject(message.standardizeFeatures, options, q + 1); + if (message.l1RegActivation != null && Object.hasOwnProperty.call(message, "l1RegActivation")) + object.l1RegActivation = options.json && !isFinite(message.l1RegActivation) ? String(message.l1RegActivation) : message.l1RegActivation; + if (message.modelRegistry != null && Object.hasOwnProperty.call(message, "modelRegistry")) + object.modelRegistry = options.enums === String ? $root.google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry[message.modelRegistry] === undefined ? message.modelRegistry : $root.google.cloud.bigquery.v2.Model.ModelRegistryOptionEnums.ModelRegistry[message.modelRegistry] : message.modelRegistry; + if (message.vertexAiModelVersionAliases && message.vertexAiModelVersionAliases.length) { + object.vertexAiModelVersionAliases = []; + for (var j = 0; j < message.vertexAiModelVersionAliases.length; ++j) + object.vertexAiModelVersionAliases[j] = message.vertexAiModelVersionAliases[j]; + } + if (message.forecastLimitLowerBound != null && Object.hasOwnProperty.call(message, "forecastLimitLowerBound")) + object.forecastLimitLowerBound = options.json && !isFinite(message.forecastLimitLowerBound) ? String(message.forecastLimitLowerBound) : message.forecastLimitLowerBound; + if (message.forecastLimitUpperBound != null && Object.hasOwnProperty.call(message, "forecastLimitUpperBound")) + object.forecastLimitUpperBound = options.json && !isFinite(message.forecastLimitUpperBound) ? String(message.forecastLimitUpperBound) : message.forecastLimitUpperBound; + if (message.dimensionIdColumns && message.dimensionIdColumns.length) { + object.dimensionIdColumns = []; + for (var j = 0; j < message.dimensionIdColumns.length; ++j) + object.dimensionIdColumns[j] = message.dimensionIdColumns[j]; + } + if (message.contributionMetric != null && Object.hasOwnProperty.call(message, "contributionMetric")) { + object.contributionMetric = message.contributionMetric; + if (options.oneofs) + object._contributionMetric = "contributionMetric"; + } + if (message.isTestColumn != null && Object.hasOwnProperty.call(message, "isTestColumn")) { + object.isTestColumn = message.isTestColumn; + if (options.oneofs) + object._isTestColumn = "isTestColumn"; + } + if (message.minAprioriSupport != null && Object.hasOwnProperty.call(message, "minAprioriSupport")) { + object.minAprioriSupport = options.json && !isFinite(message.minAprioriSupport) ? String(message.minAprioriSupport) : message.minAprioriSupport; + if (options.oneofs) + object._minAprioriSupport = "minAprioriSupport"; + } + if (message.huggingFaceModelId != null && Object.hasOwnProperty.call(message, "huggingFaceModelId")) { + object.huggingFaceModelId = message.huggingFaceModelId; + if (options.oneofs) + object.externalModelId = "huggingFaceModelId"; + } + if (message.modelGardenModelName != null && Object.hasOwnProperty.call(message, "modelGardenModelName")) { + object.modelGardenModelName = message.modelGardenModelName; + if (options.oneofs) + object.externalModelId = "modelGardenModelName"; + } + if (message.endpointIdleTtl != null && Object.hasOwnProperty.call(message, "endpointIdleTtl")) { + object.endpointIdleTtl = $root.google.protobuf.Duration.toObject(message.endpointIdleTtl, options, q + 1); + if (options.oneofs) + object._endpointIdleTtl = "endpointIdleTtl"; + } + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minReplicaCount = typeof message.minReplicaCount === "number" ? BigInt(message.minReplicaCount) : $util.Long.fromBits(message.minReplicaCount.low >>> 0, message.minReplicaCount.high >>> 0, false).toBigInt(); + else if (typeof message.minReplicaCount === "number") + object.minReplicaCount = options.longs === String ? String(message.minReplicaCount) : message.minReplicaCount; + else + object.minReplicaCount = options.longs === String ? $util.Long.prototype.toString.call(message.minReplicaCount) : options.longs === Number ? new $util.LongBits(message.minReplicaCount.low >>> 0, message.minReplicaCount.high >>> 0).toNumber() : message.minReplicaCount; + if (options.oneofs) + object._minReplicaCount = "minReplicaCount"; + } + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxReplicaCount = typeof message.maxReplicaCount === "number" ? BigInt(message.maxReplicaCount) : $util.Long.fromBits(message.maxReplicaCount.low >>> 0, message.maxReplicaCount.high >>> 0, false).toBigInt(); + else if (typeof message.maxReplicaCount === "number") + object.maxReplicaCount = options.longs === String ? String(message.maxReplicaCount) : message.maxReplicaCount; + else + object.maxReplicaCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxReplicaCount) : options.longs === Number ? new $util.LongBits(message.maxReplicaCount.low >>> 0, message.maxReplicaCount.high >>> 0).toNumber() : message.maxReplicaCount; + if (options.oneofs) + object._maxReplicaCount = "maxReplicaCount"; + } + if (message.reservationAffinityType != null && Object.hasOwnProperty.call(message, "reservationAffinityType")) { + object.reservationAffinityType = options.enums === String ? $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType[message.reservationAffinityType] === undefined ? message.reservationAffinityType : $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType[message.reservationAffinityType] : message.reservationAffinityType; + if (options.oneofs) + object._reservationAffinityType = "reservationAffinityType"; + } + if (message.reservationAffinityKey != null && Object.hasOwnProperty.call(message, "reservationAffinityKey")) { + object.reservationAffinityKey = message.reservationAffinityKey; + if (options.oneofs) + object._reservationAffinityKey = "reservationAffinityKey"; + } + if (message.reservationAffinityValues && message.reservationAffinityValues.length) { + object.reservationAffinityValues = []; + for (var j = 0; j < message.reservationAffinityValues.length; ++j) + object.reservationAffinityValues[j] = message.reservationAffinityValues[j]; + } + return object; + }; + + /** + * Converts this TrainingOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @instance + * @returns {Object.} JSON object + */ + TrainingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainingOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainingOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions"; + }; + + /** + * ReservationAffinityType enum. + * @name google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.ReservationAffinityType + * @enum {number} + * @property {number} RESERVATION_AFFINITY_TYPE_UNSPECIFIED=0 RESERVATION_AFFINITY_TYPE_UNSPECIFIED value + * @property {number} NO_RESERVATION=1 NO_RESERVATION value + * @property {number} ANY_RESERVATION=2 ANY_RESERVATION value + * @property {number} SPECIFIC_RESERVATION=3 SPECIFIC_RESERVATION value + */ + TrainingOptions.ReservationAffinityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESERVATION_AFFINITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESERVATION"] = 1; + values[valuesById[2] = "ANY_RESERVATION"] = 2; + values[valuesById[3] = "SPECIFIC_RESERVATION"] = 3; + return values; + })(); + + return TrainingOptions; + })(); + + TrainingRun.IterationResult = (function() { + + /** + * Properties of an IterationResult. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @interface IIterationResult + * @property {google.protobuf.IInt32Value|null} [index] IterationResult index + * @property {google.protobuf.IInt64Value|null} [durationMs] IterationResult durationMs + * @property {google.protobuf.IDoubleValue|null} [trainingLoss] IterationResult trainingLoss + * @property {google.protobuf.IDoubleValue|null} [evalLoss] IterationResult evalLoss + * @property {number|null} [learnRate] IterationResult learnRate + * @property {Array.|null} [clusterInfos] IterationResult clusterInfos + * @property {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult|null} [arimaResult] IterationResult arimaResult + * @property {Array.|null} [principalComponentInfos] IterationResult principalComponentInfos + */ + + /** + * Constructs a new IterationResult. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun + * @classdesc Represents an IterationResult. + * @implements IIterationResult + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult=} [properties] Properties to set + */ + function IterationResult(properties) { + this.clusterInfos = []; + this.principalComponentInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IterationResult index. + * @member {google.protobuf.IInt32Value|null|undefined} index + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.index = null; + + /** + * IterationResult durationMs. + * @member {google.protobuf.IInt64Value|null|undefined} durationMs + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.durationMs = null; + + /** + * IterationResult trainingLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} trainingLoss + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.trainingLoss = null; + + /** + * IterationResult evalLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} evalLoss + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.evalLoss = null; + + /** + * IterationResult learnRate. + * @member {number} learnRate + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.learnRate = 0; + + /** + * IterationResult clusterInfos. + * @member {Array.} clusterInfos + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.clusterInfos = $util.emptyArray; + + /** + * IterationResult arimaResult. + * @member {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult|null|undefined} arimaResult + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.arimaResult = null; + + /** + * IterationResult principalComponentInfos. + * @member {Array.} principalComponentInfos + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + */ + IterationResult.prototype.principalComponentInfos = $util.emptyArray; + + /** + * Creates a new IterationResult instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult} IterationResult instance + */ + IterationResult.create = function create(properties) { + return new IterationResult(properties); + }; + + /** + * Encodes the specified IterationResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult} message IterationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IterationResult.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + $root.google.protobuf.Int32Value.encode(message.index, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.durationMs != null && Object.hasOwnProperty.call(message, "durationMs")) + $root.google.protobuf.Int64Value.encode(message.durationMs, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) + $root.google.protobuf.DoubleValue.encode(message.trainingLoss, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) + $root.google.protobuf.DoubleValue.encode(message.evalLoss, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.learnRate); + if (message.clusterInfos != null && message.clusterInfos.length) + for (var i = 0; i < message.clusterInfos.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.encode(message.clusterInfos[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.arimaResult != null && Object.hasOwnProperty.call(message, "arimaResult")) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.encode(message.arimaResult, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.principalComponentInfos != null && message.principalComponentInfos.length) + for (var i = 0; i < message.principalComponentInfos.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.encode(message.principalComponentInfos[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IterationResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IIterationResult} message IterationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IterationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IterationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult} IterationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IterationResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.index = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.durationMs = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.trainingLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.evalLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.learnRate = reader.double(); + break; + } + case 8: { + if (!(message.clusterInfos && message.clusterInfos.length)) + message.clusterInfos = []; + message.clusterInfos.push($root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + message.arimaResult = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + if (!(message.principalComponentInfos && message.principalComponentInfos.length)) + message.principalComponentInfos = []; + message.principalComponentInfos.push($root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IterationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult} IterationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IterationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IterationResult message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IterationResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { + var error = $root.google.protobuf.Int32Value.verify(message.index, long + 1); + if (error) + return "index." + error; + } + if (message.durationMs != null && Object.hasOwnProperty.call(message, "durationMs")) { + var error = $root.google.protobuf.Int64Value.verify(message.durationMs, long + 1); + if (error) + return "durationMs." + error; + } + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.trainingLoss, long + 1); + if (error) + return "trainingLoss." + error; + } + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.evalLoss, long + 1); + if (error) + return "evalLoss." + error; + } + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + if (typeof message.learnRate !== "number") + return "learnRate: number expected"; + if (message.clusterInfos != null && Object.hasOwnProperty.call(message, "clusterInfos")) { + if (!Array.isArray(message.clusterInfos)) + return "clusterInfos: array expected"; + for (var i = 0; i < message.clusterInfos.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.verify(message.clusterInfos[i], long + 1); + if (error) + return "clusterInfos." + error; + } + } + if (message.arimaResult != null && Object.hasOwnProperty.call(message, "arimaResult")) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.verify(message.arimaResult, long + 1); + if (error) + return "arimaResult." + error; + } + if (message.principalComponentInfos != null && Object.hasOwnProperty.call(message, "principalComponentInfos")) { + if (!Array.isArray(message.principalComponentInfos)) + return "principalComponentInfos: array expected"; + for (var i = 0; i < message.principalComponentInfos.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.verify(message.principalComponentInfos[i], long + 1); + if (error) + return "principalComponentInfos." + error; + } + } + return null; + }; + + /** + * Creates an IterationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult} IterationResult + */ + IterationResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult(); + if (object.index != null) { + if (!$util.isObject(object.index)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.index: object expected"); + message.index = $root.google.protobuf.Int32Value.fromObject(object.index, long + 1); + } + if (object.durationMs != null) { + if (!$util.isObject(object.durationMs)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.durationMs: object expected"); + message.durationMs = $root.google.protobuf.Int64Value.fromObject(object.durationMs, long + 1); + } + if (object.trainingLoss != null) { + if (!$util.isObject(object.trainingLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.trainingLoss: object expected"); + message.trainingLoss = $root.google.protobuf.DoubleValue.fromObject(object.trainingLoss, long + 1); + } + if (object.evalLoss != null) { + if (!$util.isObject(object.evalLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.evalLoss: object expected"); + message.evalLoss = $root.google.protobuf.DoubleValue.fromObject(object.evalLoss, long + 1); + } + if (object.learnRate != null) + message.learnRate = Number(object.learnRate); + if (object.clusterInfos) { + if (!Array.isArray(object.clusterInfos)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.clusterInfos: array expected"); + message.clusterInfos = []; + for (var i = 0; i < object.clusterInfos.length; ++i) { + if (!$util.isObject(object.clusterInfos[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.clusterInfos: object expected"); + message.clusterInfos[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.fromObject(object.clusterInfos[i], long + 1); + } + } + if (object.arimaResult != null) { + if (!$util.isObject(object.arimaResult)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.arimaResult: object expected"); + message.arimaResult = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.fromObject(object.arimaResult, long + 1); + } + if (object.principalComponentInfos) { + if (!Array.isArray(object.principalComponentInfos)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.principalComponentInfos: array expected"); + message.principalComponentInfos = []; + for (var i = 0; i < object.principalComponentInfos.length; ++i) { + if (!$util.isObject(object.principalComponentInfos[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.principalComponentInfos: object expected"); + message.principalComponentInfos[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.fromObject(object.principalComponentInfos[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an IterationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult} message IterationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IterationResult.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.clusterInfos = []; + object.principalComponentInfos = []; + } + if (options.defaults) { + object.index = null; + object.durationMs = null; + object.trainingLoss = null; + object.evalLoss = null; + object.learnRate = 0; + object.arimaResult = null; + } + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + object.index = $root.google.protobuf.Int32Value.toObject(message.index, options, q + 1); + if (message.durationMs != null && Object.hasOwnProperty.call(message, "durationMs")) + object.durationMs = $root.google.protobuf.Int64Value.toObject(message.durationMs, options, q + 1); + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) + object.trainingLoss = $root.google.protobuf.DoubleValue.toObject(message.trainingLoss, options, q + 1); + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) + object.evalLoss = $root.google.protobuf.DoubleValue.toObject(message.evalLoss, options, q + 1); + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + object.learnRate = options.json && !isFinite(message.learnRate) ? String(message.learnRate) : message.learnRate; + if (message.clusterInfos && message.clusterInfos.length) { + object.clusterInfos = []; + for (var j = 0; j < message.clusterInfos.length; ++j) + object.clusterInfos[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.toObject(message.clusterInfos[j], options, q + 1); + } + if (message.arimaResult != null && Object.hasOwnProperty.call(message, "arimaResult")) + object.arimaResult = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.toObject(message.arimaResult, options, q + 1); + if (message.principalComponentInfos && message.principalComponentInfos.length) { + object.principalComponentInfos = []; + for (var j = 0; j < message.principalComponentInfos.length; ++j) + object.principalComponentInfos[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.toObject(message.principalComponentInfos[j], options, q + 1); + } + return object; + }; + + /** + * Converts this IterationResult to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @instance + * @returns {Object.} JSON object + */ + IterationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IterationResult + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IterationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult"; + }; + + IterationResult.ClusterInfo = (function() { + + /** + * Properties of a ClusterInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @interface IClusterInfo + * @property {number|Long|null} [centroidId] ClusterInfo centroidId + * @property {google.protobuf.IDoubleValue|null} [clusterRadius] ClusterInfo clusterRadius + * @property {google.protobuf.IInt64Value|null} [clusterSize] ClusterInfo clusterSize + */ + + /** + * Constructs a new ClusterInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @classdesc Represents a ClusterInfo. + * @implements IClusterInfo + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo=} [properties] Properties to set + */ + function ClusterInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterInfo centroidId. + * @member {number|Long} centroidId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @instance + */ + ClusterInfo.prototype.centroidId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ClusterInfo clusterRadius. + * @member {google.protobuf.IDoubleValue|null|undefined} clusterRadius + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @instance + */ + ClusterInfo.prototype.clusterRadius = null; + + /** + * ClusterInfo clusterSize. + * @member {google.protobuf.IInt64Value|null|undefined} clusterSize + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @instance + */ + ClusterInfo.prototype.clusterSize = null; + + /** + * Creates a new ClusterInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo} ClusterInfo instance + */ + ClusterInfo.create = function create(properties) { + return new ClusterInfo(properties); + }; + + /** + * Encodes the specified ClusterInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo} message ClusterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.centroidId); + if (message.clusterRadius != null && Object.hasOwnProperty.call(message, "clusterRadius")) + $root.google.protobuf.DoubleValue.encode(message.clusterRadius, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.clusterSize != null && Object.hasOwnProperty.call(message, "clusterSize")) + $root.google.protobuf.Int64Value.encode(message.clusterSize, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IClusterInfo} message ClusterInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ClusterInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo} ClusterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.centroidId = reader.int64(); + break; + } + case 2: { + message.clusterRadius = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.clusterSize = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo} ClusterInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + if (!$util.isInteger(message.centroidId) && !(message.centroidId && $util.isInteger(message.centroidId.low) && $util.isInteger(message.centroidId.high))) + return "centroidId: integer|Long expected"; + if (message.clusterRadius != null && Object.hasOwnProperty.call(message, "clusterRadius")) { + var error = $root.google.protobuf.DoubleValue.verify(message.clusterRadius, long + 1); + if (error) + return "clusterRadius." + error; + } + if (message.clusterSize != null && Object.hasOwnProperty.call(message, "clusterSize")) { + var error = $root.google.protobuf.Int64Value.verify(message.clusterSize, long + 1); + if (error) + return "clusterSize." + error; + } + return null; + }; + + /** + * Creates a ClusterInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo} ClusterInfo + */ + ClusterInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo(); + if (object.centroidId != null) + if ($util.Long) + message.centroidId = $util.Long.fromValue(object.centroidId, false); + else if (typeof object.centroidId === "string") + message.centroidId = parseInt(object.centroidId, 10); + else if (typeof object.centroidId === "number") + message.centroidId = object.centroidId; + else if (typeof object.centroidId === "object") + message.centroidId = new $util.LongBits(object.centroidId.low >>> 0, object.centroidId.high >>> 0).toNumber(); + if (object.clusterRadius != null) { + if (!$util.isObject(object.clusterRadius)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.clusterRadius: object expected"); + message.clusterRadius = $root.google.protobuf.DoubleValue.fromObject(object.clusterRadius, long + 1); + } + if (object.clusterSize != null) { + if (!$util.isObject(object.clusterSize)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo.clusterSize: object expected"); + message.clusterSize = $root.google.protobuf.Int64Value.fromObject(object.clusterSize, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ClusterInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo} message ClusterInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.centroidId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.centroidId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.clusterRadius = null; + object.clusterSize = null; + } + if (message.centroidId != null && Object.hasOwnProperty.call(message, "centroidId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.centroidId = typeof message.centroidId === "number" ? BigInt(message.centroidId) : $util.Long.fromBits(message.centroidId.low >>> 0, message.centroidId.high >>> 0, false).toBigInt(); + else if (typeof message.centroidId === "number") + object.centroidId = options.longs === String ? String(message.centroidId) : message.centroidId; + else + object.centroidId = options.longs === String ? $util.Long.prototype.toString.call(message.centroidId) : options.longs === Number ? new $util.LongBits(message.centroidId.low >>> 0, message.centroidId.high >>> 0).toNumber() : message.centroidId; + if (message.clusterRadius != null && Object.hasOwnProperty.call(message, "clusterRadius")) + object.clusterRadius = $root.google.protobuf.DoubleValue.toObject(message.clusterRadius, options, q + 1); + if (message.clusterSize != null && Object.hasOwnProperty.call(message, "clusterSize")) + object.clusterSize = $root.google.protobuf.Int64Value.toObject(message.clusterSize, options, q + 1); + return object; + }; + + /** + * Converts this ClusterInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @instance + * @returns {Object.} JSON object + */ + ClusterInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo"; + }; + + return ClusterInfo; + })(); + + IterationResult.ArimaResult = (function() { + + /** + * Properties of an ArimaResult. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @interface IArimaResult + * @property {Array.|null} [arimaModelInfo] ArimaResult arimaModelInfo + * @property {Array.|null} [seasonalPeriods] ArimaResult seasonalPeriods + */ + + /** + * Constructs a new ArimaResult. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @classdesc Represents an ArimaResult. + * @implements IArimaResult + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult=} [properties] Properties to set + */ + function ArimaResult(properties) { + this.arimaModelInfo = []; + this.seasonalPeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaResult arimaModelInfo. + * @member {Array.} arimaModelInfo + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @instance + */ + ArimaResult.prototype.arimaModelInfo = $util.emptyArray; + + /** + * ArimaResult seasonalPeriods. + * @member {Array.} seasonalPeriods + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @instance + */ + ArimaResult.prototype.seasonalPeriods = $util.emptyArray; + + /** + * Creates a new ArimaResult instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult} ArimaResult instance + */ + ArimaResult.create = function create(properties) { + return new ArimaResult(properties); + }; + + /** + * Encodes the specified ArimaResult message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult} message ArimaResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaResult.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.arimaModelInfo != null && message.arimaModelInfo.length) + for (var i = 0; i < message.arimaModelInfo.length; ++i) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.encode(message.arimaModelInfo[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.seasonalPeriods != null && message.seasonalPeriods.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.seasonalPeriods.length; ++i) + writer.int32(message.seasonalPeriods[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ArimaResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IArimaResult} message ArimaResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult} ArimaResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaResult.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.arimaModelInfo && message.arimaModelInfo.length)) + message.arimaModelInfo = []; + message.arimaModelInfo.push($root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.seasonalPeriods && message.seasonalPeriods.length)) + message.seasonalPeriods = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.seasonalPeriods.push(reader.int32()); + } else + message.seasonalPeriods.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult} ArimaResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaResult message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaResult.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.arimaModelInfo != null && Object.hasOwnProperty.call(message, "arimaModelInfo")) { + if (!Array.isArray(message.arimaModelInfo)) + return "arimaModelInfo: array expected"; + for (var i = 0; i < message.arimaModelInfo.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.verify(message.arimaModelInfo[i], long + 1); + if (error) + return "arimaModelInfo." + error; + } + } + if (message.seasonalPeriods != null && Object.hasOwnProperty.call(message, "seasonalPeriods")) { + if (!Array.isArray(message.seasonalPeriods)) + return "seasonalPeriods: array expected"; + for (var i = 0; i < message.seasonalPeriods.length; ++i) + switch (message.seasonalPeriods[i]) { + default: + return "seasonalPeriods: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates an ArimaResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult} ArimaResult + */ + ArimaResult.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult(); + if (object.arimaModelInfo) { + if (!Array.isArray(object.arimaModelInfo)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.arimaModelInfo: array expected"); + message.arimaModelInfo = []; + for (var i = 0; i < object.arimaModelInfo.length; ++i) { + if (!$util.isObject(object.arimaModelInfo[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.arimaModelInfo: object expected"); + message.arimaModelInfo[i] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.fromObject(object.arimaModelInfo[i], long + 1); + } + } + if (object.seasonalPeriods) { + if (!Array.isArray(object.seasonalPeriods)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.seasonalPeriods: array expected"); + message.seasonalPeriods = []; + for (var i = 0; i < object.seasonalPeriods.length; ++i) + switch (object.seasonalPeriods[i]) { + default: + if (typeof object.seasonalPeriods[i] === "number") { + message.seasonalPeriods[i] = object.seasonalPeriods[i]; + break; + } + case "SEASONAL_PERIOD_TYPE_UNSPECIFIED": + case 0: + message.seasonalPeriods[i] = 0; + break; + case "NO_SEASONALITY": + case 1: + message.seasonalPeriods[i] = 1; + break; + case "DAILY": + case 2: + message.seasonalPeriods[i] = 2; + break; + case "WEEKLY": + case 3: + message.seasonalPeriods[i] = 3; + break; + case "MONTHLY": + case 4: + message.seasonalPeriods[i] = 4; + break; + case "QUARTERLY": + case 5: + message.seasonalPeriods[i] = 5; + break; + case "YEARLY": + case 6: + message.seasonalPeriods[i] = 6; + break; + case "HOURLY": + case 7: + message.seasonalPeriods[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an ArimaResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult} message ArimaResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaResult.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.arimaModelInfo = []; + object.seasonalPeriods = []; + } + if (message.arimaModelInfo && message.arimaModelInfo.length) { + object.arimaModelInfo = []; + for (var j = 0; j < message.arimaModelInfo.length; ++j) + object.arimaModelInfo[j] = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.toObject(message.arimaModelInfo[j], options, q + 1); + } + if (message.seasonalPeriods && message.seasonalPeriods.length) { + object.seasonalPeriods = []; + for (var j = 0; j < message.seasonalPeriods.length; ++j) + object.seasonalPeriods[j] = options.enums === String ? $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] === undefined ? message.seasonalPeriods[j] : $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] : message.seasonalPeriods[j]; + } + return object; + }; + + /** + * Converts this ArimaResult to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @instance + * @returns {Object.} JSON object + */ + ArimaResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaResult + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult"; + }; + + ArimaResult.ArimaCoefficients = (function() { + + /** + * Properties of an ArimaCoefficients. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @interface IArimaCoefficients + * @property {Array.|null} [autoRegressiveCoefficients] ArimaCoefficients autoRegressiveCoefficients + * @property {Array.|null} [movingAverageCoefficients] ArimaCoefficients movingAverageCoefficients + * @property {google.protobuf.IDoubleValue|null} [interceptCoefficient] ArimaCoefficients interceptCoefficient + */ + + /** + * Constructs a new ArimaCoefficients. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @classdesc Represents an ArimaCoefficients. + * @implements IArimaCoefficients + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients=} [properties] Properties to set + */ + function ArimaCoefficients(properties) { + this.autoRegressiveCoefficients = []; + this.movingAverageCoefficients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaCoefficients autoRegressiveCoefficients. + * @member {Array.} autoRegressiveCoefficients + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @instance + */ + ArimaCoefficients.prototype.autoRegressiveCoefficients = $util.emptyArray; + + /** + * ArimaCoefficients movingAverageCoefficients. + * @member {Array.} movingAverageCoefficients + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @instance + */ + ArimaCoefficients.prototype.movingAverageCoefficients = $util.emptyArray; + + /** + * ArimaCoefficients interceptCoefficient. + * @member {google.protobuf.IDoubleValue|null|undefined} interceptCoefficient + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @instance + */ + ArimaCoefficients.prototype.interceptCoefficient = null; + + /** + * Creates a new ArimaCoefficients instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients} ArimaCoefficients instance + */ + ArimaCoefficients.create = function create(properties) { + return new ArimaCoefficients(properties); + }; + + /** + * Encodes the specified ArimaCoefficients message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients} message ArimaCoefficients message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaCoefficients.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.autoRegressiveCoefficients != null && message.autoRegressiveCoefficients.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.autoRegressiveCoefficients.length; ++i) + writer.double(message.autoRegressiveCoefficients[i]); + writer.ldelim(); + } + if (message.movingAverageCoefficients != null && message.movingAverageCoefficients.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.movingAverageCoefficients.length; ++i) + writer.double(message.movingAverageCoefficients[i]); + writer.ldelim(); + } + if (message.interceptCoefficient != null && Object.hasOwnProperty.call(message, "interceptCoefficient")) + $root.google.protobuf.DoubleValue.encode(message.interceptCoefficient, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArimaCoefficients message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients} message ArimaCoefficients message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaCoefficients.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaCoefficients message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients} ArimaCoefficients + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaCoefficients.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.autoRegressiveCoefficients && message.autoRegressiveCoefficients.length)) + message.autoRegressiveCoefficients = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.autoRegressiveCoefficients.push(reader.double()); + } else + message.autoRegressiveCoefficients.push(reader.double()); + break; + } + case 2: { + if (!(message.movingAverageCoefficients && message.movingAverageCoefficients.length)) + message.movingAverageCoefficients = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.movingAverageCoefficients.push(reader.double()); + } else + message.movingAverageCoefficients.push(reader.double()); + break; + } + case 3: { + message.interceptCoefficient = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaCoefficients message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients} ArimaCoefficients + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaCoefficients.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaCoefficients message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaCoefficients.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.autoRegressiveCoefficients != null && Object.hasOwnProperty.call(message, "autoRegressiveCoefficients")) { + if (!Array.isArray(message.autoRegressiveCoefficients)) + return "autoRegressiveCoefficients: array expected"; + for (var i = 0; i < message.autoRegressiveCoefficients.length; ++i) + if (typeof message.autoRegressiveCoefficients[i] !== "number") + return "autoRegressiveCoefficients: number[] expected"; + } + if (message.movingAverageCoefficients != null && Object.hasOwnProperty.call(message, "movingAverageCoefficients")) { + if (!Array.isArray(message.movingAverageCoefficients)) + return "movingAverageCoefficients: array expected"; + for (var i = 0; i < message.movingAverageCoefficients.length; ++i) + if (typeof message.movingAverageCoefficients[i] !== "number") + return "movingAverageCoefficients: number[] expected"; + } + if (message.interceptCoefficient != null && Object.hasOwnProperty.call(message, "interceptCoefficient")) { + var error = $root.google.protobuf.DoubleValue.verify(message.interceptCoefficient, long + 1); + if (error) + return "interceptCoefficient." + error; + } + return null; + }; + + /** + * Creates an ArimaCoefficients message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients} ArimaCoefficients + */ + ArimaCoefficients.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients(); + if (object.autoRegressiveCoefficients) { + if (!Array.isArray(object.autoRegressiveCoefficients)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.autoRegressiveCoefficients: array expected"); + message.autoRegressiveCoefficients = []; + for (var i = 0; i < object.autoRegressiveCoefficients.length; ++i) + message.autoRegressiveCoefficients[i] = Number(object.autoRegressiveCoefficients[i]); + } + if (object.movingAverageCoefficients) { + if (!Array.isArray(object.movingAverageCoefficients)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.movingAverageCoefficients: array expected"); + message.movingAverageCoefficients = []; + for (var i = 0; i < object.movingAverageCoefficients.length; ++i) + message.movingAverageCoefficients[i] = Number(object.movingAverageCoefficients[i]); + } + if (object.interceptCoefficient != null) { + if (!$util.isObject(object.interceptCoefficient)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.interceptCoefficient: object expected"); + message.interceptCoefficient = $root.google.protobuf.DoubleValue.fromObject(object.interceptCoefficient, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ArimaCoefficients message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients} message ArimaCoefficients + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaCoefficients.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.autoRegressiveCoefficients = []; + object.movingAverageCoefficients = []; + } + if (options.defaults) + object.interceptCoefficient = null; + if (message.autoRegressiveCoefficients && message.autoRegressiveCoefficients.length) { + object.autoRegressiveCoefficients = []; + for (var j = 0; j < message.autoRegressiveCoefficients.length; ++j) + object.autoRegressiveCoefficients[j] = options.json && !isFinite(message.autoRegressiveCoefficients[j]) ? String(message.autoRegressiveCoefficients[j]) : message.autoRegressiveCoefficients[j]; + } + if (message.movingAverageCoefficients && message.movingAverageCoefficients.length) { + object.movingAverageCoefficients = []; + for (var j = 0; j < message.movingAverageCoefficients.length; ++j) + object.movingAverageCoefficients[j] = options.json && !isFinite(message.movingAverageCoefficients[j]) ? String(message.movingAverageCoefficients[j]) : message.movingAverageCoefficients[j]; + } + if (message.interceptCoefficient != null && Object.hasOwnProperty.call(message, "interceptCoefficient")) + object.interceptCoefficient = $root.google.protobuf.DoubleValue.toObject(message.interceptCoefficient, options, q + 1); + return object; + }; + + /** + * Converts this ArimaCoefficients to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @instance + * @returns {Object.} JSON object + */ + ArimaCoefficients.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaCoefficients + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaCoefficients.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients"; + }; + + return ArimaCoefficients; + })(); + + ArimaResult.ArimaModelInfo = (function() { + + /** + * Properties of an ArimaModelInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @interface IArimaModelInfo + * @property {google.cloud.bigquery.v2.Model.IArimaOrder|null} [nonSeasonalOrder] ArimaModelInfo nonSeasonalOrder + * @property {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients|null} [arimaCoefficients] ArimaModelInfo arimaCoefficients + * @property {google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null} [arimaFittingMetrics] ArimaModelInfo arimaFittingMetrics + * @property {google.protobuf.IBoolValue|null} [hasDrift] ArimaModelInfo hasDrift + * @property {string|null} [timeSeriesId] ArimaModelInfo timeSeriesId + * @property {Array.|null} [timeSeriesIds] ArimaModelInfo timeSeriesIds + * @property {Array.|null} [seasonalPeriods] ArimaModelInfo seasonalPeriods + * @property {google.protobuf.IBoolValue|null} [hasHolidayEffect] ArimaModelInfo hasHolidayEffect + * @property {google.protobuf.IBoolValue|null} [hasSpikesAndDips] ArimaModelInfo hasSpikesAndDips + * @property {google.protobuf.IBoolValue|null} [hasStepChanges] ArimaModelInfo hasStepChanges + */ + + /** + * Constructs a new ArimaModelInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult + * @classdesc Represents an ArimaModelInfo. + * @implements IArimaModelInfo + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo=} [properties] Properties to set + */ + function ArimaModelInfo(properties) { + this.timeSeriesIds = []; + this.seasonalPeriods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArimaModelInfo nonSeasonalOrder. + * @member {google.cloud.bigquery.v2.Model.IArimaOrder|null|undefined} nonSeasonalOrder + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.nonSeasonalOrder = null; + + /** + * ArimaModelInfo arimaCoefficients. + * @member {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaCoefficients|null|undefined} arimaCoefficients + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.arimaCoefficients = null; + + /** + * ArimaModelInfo arimaFittingMetrics. + * @member {google.cloud.bigquery.v2.Model.IArimaFittingMetrics|null|undefined} arimaFittingMetrics + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.arimaFittingMetrics = null; + + /** + * ArimaModelInfo hasDrift. + * @member {google.protobuf.IBoolValue|null|undefined} hasDrift + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.hasDrift = null; + + /** + * ArimaModelInfo timeSeriesId. + * @member {string} timeSeriesId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.timeSeriesId = ""; + + /** + * ArimaModelInfo timeSeriesIds. + * @member {Array.} timeSeriesIds + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.timeSeriesIds = $util.emptyArray; + + /** + * ArimaModelInfo seasonalPeriods. + * @member {Array.} seasonalPeriods + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.seasonalPeriods = $util.emptyArray; + + /** + * ArimaModelInfo hasHolidayEffect. + * @member {google.protobuf.IBoolValue|null|undefined} hasHolidayEffect + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.hasHolidayEffect = null; + + /** + * ArimaModelInfo hasSpikesAndDips. + * @member {google.protobuf.IBoolValue|null|undefined} hasSpikesAndDips + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.hasSpikesAndDips = null; + + /** + * ArimaModelInfo hasStepChanges. + * @member {google.protobuf.IBoolValue|null|undefined} hasStepChanges + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + */ + ArimaModelInfo.prototype.hasStepChanges = null; + + /** + * Creates a new ArimaModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo} ArimaModelInfo instance + */ + ArimaModelInfo.create = function create(properties) { + return new ArimaModelInfo(properties); + }; + + /** + * Encodes the specified ArimaModelInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo} message ArimaModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaModelInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + $root.google.cloud.bigquery.v2.Model.ArimaOrder.encode(message.nonSeasonalOrder, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.arimaCoefficients != null && Object.hasOwnProperty.call(message, "arimaCoefficients")) + $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.encode(message.arimaCoefficients, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) + $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.encode(message.arimaFittingMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) + $root.google.protobuf.BoolValue.encode(message.hasDrift, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeSeriesId); + if (message.seasonalPeriods != null && message.seasonalPeriods.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.seasonalPeriods.length; ++i) + writer.int32(message.seasonalPeriods[i]); + writer.ldelim(); + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) + $root.google.protobuf.BoolValue.encode(message.hasHolidayEffect, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) + $root.google.protobuf.BoolValue.encode(message.hasSpikesAndDips, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) + $root.google.protobuf.BoolValue.encode(message.hasStepChanges, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.timeSeriesIds != null && message.timeSeriesIds.length) + for (var i = 0; i < message.timeSeriesIds.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.timeSeriesIds[i]); + return writer; + }; + + /** + * Encodes the specified ArimaModelInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.IArimaModelInfo} message ArimaModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArimaModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ArimaModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo} ArimaModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaModelInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.arimaCoefficients = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.hasDrift = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.timeSeriesId = reader.string(); + break; + } + case 10: { + if (!(message.timeSeriesIds && message.timeSeriesIds.length)) + message.timeSeriesIds = []; + message.timeSeriesIds.push(reader.string()); + break; + } + case 6: { + if (!(message.seasonalPeriods && message.seasonalPeriods.length)) + message.seasonalPeriods = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.seasonalPeriods.push(reader.int32()); + } else + message.seasonalPeriods.push(reader.int32()); + break; + } + case 7: { + message.hasHolidayEffect = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.hasSpikesAndDips = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.hasStepChanges = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ArimaModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo} ArimaModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArimaModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArimaModelInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArimaModelInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaOrder.verify(message.nonSeasonalOrder, long + 1); + if (error) + return "nonSeasonalOrder." + error; + } + if (message.arimaCoefficients != null && Object.hasOwnProperty.call(message, "arimaCoefficients")) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.verify(message.arimaCoefficients, long + 1); + if (error) + return "arimaCoefficients." + error; + } + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.verify(message.arimaFittingMetrics, long + 1); + if (error) + return "arimaFittingMetrics." + error; + } + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasDrift, long + 1); + if (error) + return "hasDrift." + error; + } + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + if (!$util.isString(message.timeSeriesId)) + return "timeSeriesId: string expected"; + if (message.timeSeriesIds != null && Object.hasOwnProperty.call(message, "timeSeriesIds")) { + if (!Array.isArray(message.timeSeriesIds)) + return "timeSeriesIds: array expected"; + for (var i = 0; i < message.timeSeriesIds.length; ++i) + if (!$util.isString(message.timeSeriesIds[i])) + return "timeSeriesIds: string[] expected"; + } + if (message.seasonalPeriods != null && Object.hasOwnProperty.call(message, "seasonalPeriods")) { + if (!Array.isArray(message.seasonalPeriods)) + return "seasonalPeriods: array expected"; + for (var i = 0; i < message.seasonalPeriods.length; ++i) + switch (message.seasonalPeriods[i]) { + default: + return "seasonalPeriods: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasHolidayEffect, long + 1); + if (error) + return "hasHolidayEffect." + error; + } + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasSpikesAndDips, long + 1); + if (error) + return "hasSpikesAndDips." + error; + } + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) { + var error = $root.google.protobuf.BoolValue.verify(message.hasStepChanges, long + 1); + if (error) + return "hasStepChanges." + error; + } + return null; + }; + + /** + * Creates an ArimaModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo} ArimaModelInfo + */ + ArimaModelInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo(); + if (object.nonSeasonalOrder != null) { + if (!$util.isObject(object.nonSeasonalOrder)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.nonSeasonalOrder: object expected"); + message.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.fromObject(object.nonSeasonalOrder, long + 1); + } + if (object.arimaCoefficients != null) { + if (!$util.isObject(object.arimaCoefficients)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.arimaCoefficients: object expected"); + message.arimaCoefficients = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.fromObject(object.arimaCoefficients, long + 1); + } + if (object.arimaFittingMetrics != null) { + if (!$util.isObject(object.arimaFittingMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.arimaFittingMetrics: object expected"); + message.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.fromObject(object.arimaFittingMetrics, long + 1); + } + if (object.hasDrift != null) { + if (!$util.isObject(object.hasDrift)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.hasDrift: object expected"); + message.hasDrift = $root.google.protobuf.BoolValue.fromObject(object.hasDrift, long + 1); + } + if (object.timeSeriesId != null) + message.timeSeriesId = String(object.timeSeriesId); + if (object.timeSeriesIds) { + if (!Array.isArray(object.timeSeriesIds)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.timeSeriesIds: array expected"); + message.timeSeriesIds = []; + for (var i = 0; i < object.timeSeriesIds.length; ++i) + message.timeSeriesIds[i] = String(object.timeSeriesIds[i]); + } + if (object.seasonalPeriods) { + if (!Array.isArray(object.seasonalPeriods)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.seasonalPeriods: array expected"); + message.seasonalPeriods = []; + for (var i = 0; i < object.seasonalPeriods.length; ++i) + switch (object.seasonalPeriods[i]) { + default: + if (typeof object.seasonalPeriods[i] === "number") { + message.seasonalPeriods[i] = object.seasonalPeriods[i]; + break; + } + case "SEASONAL_PERIOD_TYPE_UNSPECIFIED": + case 0: + message.seasonalPeriods[i] = 0; + break; + case "NO_SEASONALITY": + case 1: + message.seasonalPeriods[i] = 1; + break; + case "DAILY": + case 2: + message.seasonalPeriods[i] = 2; + break; + case "WEEKLY": + case 3: + message.seasonalPeriods[i] = 3; + break; + case "MONTHLY": + case 4: + message.seasonalPeriods[i] = 4; + break; + case "QUARTERLY": + case 5: + message.seasonalPeriods[i] = 5; + break; + case "YEARLY": + case 6: + message.seasonalPeriods[i] = 6; + break; + case "HOURLY": + case 7: + message.seasonalPeriods[i] = 7; + break; + } + } + if (object.hasHolidayEffect != null) { + if (!$util.isObject(object.hasHolidayEffect)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.hasHolidayEffect: object expected"); + message.hasHolidayEffect = $root.google.protobuf.BoolValue.fromObject(object.hasHolidayEffect, long + 1); + } + if (object.hasSpikesAndDips != null) { + if (!$util.isObject(object.hasSpikesAndDips)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.hasSpikesAndDips: object expected"); + message.hasSpikesAndDips = $root.google.protobuf.BoolValue.fromObject(object.hasSpikesAndDips, long + 1); + } + if (object.hasStepChanges != null) { + if (!$util.isObject(object.hasStepChanges)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo.hasStepChanges: object expected"); + message.hasStepChanges = $root.google.protobuf.BoolValue.fromObject(object.hasStepChanges, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ArimaModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo} message ArimaModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArimaModelInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.seasonalPeriods = []; + object.timeSeriesIds = []; + } + if (options.defaults) { + object.nonSeasonalOrder = null; + object.arimaCoefficients = null; + object.arimaFittingMetrics = null; + object.hasDrift = null; + object.timeSeriesId = ""; + object.hasHolidayEffect = null; + object.hasSpikesAndDips = null; + object.hasStepChanges = null; + } + if (message.nonSeasonalOrder != null && Object.hasOwnProperty.call(message, "nonSeasonalOrder")) + object.nonSeasonalOrder = $root.google.cloud.bigquery.v2.Model.ArimaOrder.toObject(message.nonSeasonalOrder, options, q + 1); + if (message.arimaCoefficients != null && Object.hasOwnProperty.call(message, "arimaCoefficients")) + object.arimaCoefficients = $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients.toObject(message.arimaCoefficients, options, q + 1); + if (message.arimaFittingMetrics != null && Object.hasOwnProperty.call(message, "arimaFittingMetrics")) + object.arimaFittingMetrics = $root.google.cloud.bigquery.v2.Model.ArimaFittingMetrics.toObject(message.arimaFittingMetrics, options, q + 1); + if (message.hasDrift != null && Object.hasOwnProperty.call(message, "hasDrift")) + object.hasDrift = $root.google.protobuf.BoolValue.toObject(message.hasDrift, options, q + 1); + if (message.timeSeriesId != null && Object.hasOwnProperty.call(message, "timeSeriesId")) + object.timeSeriesId = message.timeSeriesId; + if (message.seasonalPeriods && message.seasonalPeriods.length) { + object.seasonalPeriods = []; + for (var j = 0; j < message.seasonalPeriods.length; ++j) + object.seasonalPeriods[j] = options.enums === String ? $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] === undefined ? message.seasonalPeriods[j] : $root.google.cloud.bigquery.v2.Model.SeasonalPeriod.SeasonalPeriodType[message.seasonalPeriods[j]] : message.seasonalPeriods[j]; + } + if (message.hasHolidayEffect != null && Object.hasOwnProperty.call(message, "hasHolidayEffect")) + object.hasHolidayEffect = $root.google.protobuf.BoolValue.toObject(message.hasHolidayEffect, options, q + 1); + if (message.hasSpikesAndDips != null && Object.hasOwnProperty.call(message, "hasSpikesAndDips")) + object.hasSpikesAndDips = $root.google.protobuf.BoolValue.toObject(message.hasSpikesAndDips, options, q + 1); + if (message.hasStepChanges != null && Object.hasOwnProperty.call(message, "hasStepChanges")) + object.hasStepChanges = $root.google.protobuf.BoolValue.toObject(message.hasStepChanges, options, q + 1); + if (message.timeSeriesIds && message.timeSeriesIds.length) { + object.timeSeriesIds = []; + for (var j = 0; j < message.timeSeriesIds.length; ++j) + object.timeSeriesIds[j] = message.timeSeriesIds[j]; + } + return object; + }; + + /** + * Converts this ArimaModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @instance + * @returns {Object.} JSON object + */ + ArimaModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArimaModelInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArimaModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo"; + }; + + return ArimaModelInfo; + })(); + + return ArimaResult; + })(); + + IterationResult.PrincipalComponentInfo = (function() { + + /** + * Properties of a PrincipalComponentInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @interface IPrincipalComponentInfo + * @property {google.protobuf.IInt64Value|null} [principalComponentId] PrincipalComponentInfo principalComponentId + * @property {google.protobuf.IDoubleValue|null} [explainedVariance] PrincipalComponentInfo explainedVariance + * @property {google.protobuf.IDoubleValue|null} [explainedVarianceRatio] PrincipalComponentInfo explainedVarianceRatio + * @property {google.protobuf.IDoubleValue|null} [cumulativeExplainedVarianceRatio] PrincipalComponentInfo cumulativeExplainedVarianceRatio + */ + + /** + * Constructs a new PrincipalComponentInfo. + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult + * @classdesc Represents a PrincipalComponentInfo. + * @implements IPrincipalComponentInfo + * @constructor + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo=} [properties] Properties to set + */ + function PrincipalComponentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrincipalComponentInfo principalComponentId. + * @member {google.protobuf.IInt64Value|null|undefined} principalComponentId + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @instance + */ + PrincipalComponentInfo.prototype.principalComponentId = null; + + /** + * PrincipalComponentInfo explainedVariance. + * @member {google.protobuf.IDoubleValue|null|undefined} explainedVariance + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @instance + */ + PrincipalComponentInfo.prototype.explainedVariance = null; + + /** + * PrincipalComponentInfo explainedVarianceRatio. + * @member {google.protobuf.IDoubleValue|null|undefined} explainedVarianceRatio + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @instance + */ + PrincipalComponentInfo.prototype.explainedVarianceRatio = null; + + /** + * PrincipalComponentInfo cumulativeExplainedVarianceRatio. + * @member {google.protobuf.IDoubleValue|null|undefined} cumulativeExplainedVarianceRatio + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @instance + */ + PrincipalComponentInfo.prototype.cumulativeExplainedVarianceRatio = null; + + /** + * Creates a new PrincipalComponentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo} PrincipalComponentInfo instance + */ + PrincipalComponentInfo.create = function create(properties) { + return new PrincipalComponentInfo(properties); + }; + + /** + * Encodes the specified PrincipalComponentInfo message. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo} message PrincipalComponentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrincipalComponentInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.principalComponentId != null && Object.hasOwnProperty.call(message, "principalComponentId")) + $root.google.protobuf.Int64Value.encode(message.principalComponentId, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.explainedVariance != null && Object.hasOwnProperty.call(message, "explainedVariance")) + $root.google.protobuf.DoubleValue.encode(message.explainedVariance, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.explainedVarianceRatio != null && Object.hasOwnProperty.call(message, "explainedVarianceRatio")) + $root.google.protobuf.DoubleValue.encode(message.explainedVarianceRatio, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.cumulativeExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "cumulativeExplainedVarianceRatio")) + $root.google.protobuf.DoubleValue.encode(message.cumulativeExplainedVarianceRatio, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrincipalComponentInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.IPrincipalComponentInfo} message PrincipalComponentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrincipalComponentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PrincipalComponentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo} PrincipalComponentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrincipalComponentInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.principalComponentId = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.explainedVariance = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.explainedVarianceRatio = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.cumulativeExplainedVarianceRatio = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PrincipalComponentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo} PrincipalComponentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrincipalComponentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrincipalComponentInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrincipalComponentInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.principalComponentId != null && Object.hasOwnProperty.call(message, "principalComponentId")) { + var error = $root.google.protobuf.Int64Value.verify(message.principalComponentId, long + 1); + if (error) + return "principalComponentId." + error; + } + if (message.explainedVariance != null && Object.hasOwnProperty.call(message, "explainedVariance")) { + var error = $root.google.protobuf.DoubleValue.verify(message.explainedVariance, long + 1); + if (error) + return "explainedVariance." + error; + } + if (message.explainedVarianceRatio != null && Object.hasOwnProperty.call(message, "explainedVarianceRatio")) { + var error = $root.google.protobuf.DoubleValue.verify(message.explainedVarianceRatio, long + 1); + if (error) + return "explainedVarianceRatio." + error; + } + if (message.cumulativeExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "cumulativeExplainedVarianceRatio")) { + var error = $root.google.protobuf.DoubleValue.verify(message.cumulativeExplainedVarianceRatio, long + 1); + if (error) + return "cumulativeExplainedVarianceRatio." + error; + } + return null; + }; + + /** + * Creates a PrincipalComponentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo} PrincipalComponentInfo + */ + PrincipalComponentInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo(); + if (object.principalComponentId != null) { + if (!$util.isObject(object.principalComponentId)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.principalComponentId: object expected"); + message.principalComponentId = $root.google.protobuf.Int64Value.fromObject(object.principalComponentId, long + 1); + } + if (object.explainedVariance != null) { + if (!$util.isObject(object.explainedVariance)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.explainedVariance: object expected"); + message.explainedVariance = $root.google.protobuf.DoubleValue.fromObject(object.explainedVariance, long + 1); + } + if (object.explainedVarianceRatio != null) { + if (!$util.isObject(object.explainedVarianceRatio)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.explainedVarianceRatio: object expected"); + message.explainedVarianceRatio = $root.google.protobuf.DoubleValue.fromObject(object.explainedVarianceRatio, long + 1); + } + if (object.cumulativeExplainedVarianceRatio != null) { + if (!$util.isObject(object.cumulativeExplainedVarianceRatio)) + throw TypeError(".google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo.cumulativeExplainedVarianceRatio: object expected"); + message.cumulativeExplainedVarianceRatio = $root.google.protobuf.DoubleValue.fromObject(object.cumulativeExplainedVarianceRatio, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PrincipalComponentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo} message PrincipalComponentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrincipalComponentInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.principalComponentId = null; + object.explainedVariance = null; + object.explainedVarianceRatio = null; + object.cumulativeExplainedVarianceRatio = null; + } + if (message.principalComponentId != null && Object.hasOwnProperty.call(message, "principalComponentId")) + object.principalComponentId = $root.google.protobuf.Int64Value.toObject(message.principalComponentId, options, q + 1); + if (message.explainedVariance != null && Object.hasOwnProperty.call(message, "explainedVariance")) + object.explainedVariance = $root.google.protobuf.DoubleValue.toObject(message.explainedVariance, options, q + 1); + if (message.explainedVarianceRatio != null && Object.hasOwnProperty.call(message, "explainedVarianceRatio")) + object.explainedVarianceRatio = $root.google.protobuf.DoubleValue.toObject(message.explainedVarianceRatio, options, q + 1); + if (message.cumulativeExplainedVarianceRatio != null && Object.hasOwnProperty.call(message, "cumulativeExplainedVarianceRatio")) + object.cumulativeExplainedVarianceRatio = $root.google.protobuf.DoubleValue.toObject(message.cumulativeExplainedVarianceRatio, options, q + 1); + return object; + }; + + /** + * Converts this PrincipalComponentInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @instance + * @returns {Object.} JSON object + */ + PrincipalComponentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrincipalComponentInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrincipalComponentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.PrincipalComponentInfo"; + }; + + return PrincipalComponentInfo; + })(); + + return IterationResult; + })(); + + return TrainingRun; + })(); + + Model.DoubleHparamSearchSpace = (function() { + + /** + * Properties of a DoubleHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @interface IDoubleHparamSearchSpace + * @property {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange|null} [range] DoubleHparamSearchSpace range + * @property {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates|null} [candidates] DoubleHparamSearchSpace candidates + */ + + /** + * Constructs a new DoubleHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a DoubleHparamSearchSpace. + * @implements IDoubleHparamSearchSpace + * @constructor + * @param {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace=} [properties] Properties to set + */ + function DoubleHparamSearchSpace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleHparamSearchSpace range. + * @member {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange|null|undefined} range + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @instance + */ + DoubleHparamSearchSpace.prototype.range = null; + + /** + * DoubleHparamSearchSpace candidates. + * @member {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates|null|undefined} candidates + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @instance + */ + DoubleHparamSearchSpace.prototype.candidates = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DoubleHparamSearchSpace searchSpace. + * @member {"range"|"candidates"|undefined} searchSpace + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @instance + */ + Object.defineProperty(DoubleHparamSearchSpace.prototype, "searchSpace", { + get: $util.oneOfGetter($oneOfFields = ["range", "candidates"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DoubleHparamSearchSpace instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace} DoubleHparamSearchSpace instance + */ + DoubleHparamSearchSpace.create = function create(properties) { + return new DoubleHparamSearchSpace(properties); + }; + + /** + * Encodes the specified DoubleHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace} message DoubleHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleHparamSearchSpace.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.encode(message.range, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.encode(message.candidates, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DoubleHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace} message DoubleHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleHparamSearchSpace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DoubleHparamSearchSpace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace} DoubleHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleHparamSearchSpace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.range = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.candidates = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleHparamSearchSpace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace} DoubleHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleHparamSearchSpace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleHparamSearchSpace message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleHparamSearchSpace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + properties.searchSpace = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.verify(message.range, long + 1); + if (error) + return "range." + error; + } + } + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (properties.searchSpace === 1) + return "searchSpace: multiple values"; + properties.searchSpace = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.verify(message.candidates, long + 1); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates a DoubleHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace} DoubleHparamSearchSpace + */ + DoubleHparamSearchSpace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace(); + if (object.range != null) { + if (!$util.isObject(object.range)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.range: object expected"); + message.range = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.fromObject(object.range, long + 1); + } + if (object.candidates != null) { + if (!$util.isObject(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.candidates: object expected"); + message.candidates = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.fromObject(object.candidates, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DoubleHparamSearchSpace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace} message DoubleHparamSearchSpace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleHparamSearchSpace.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + object.range = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.toObject(message.range, options, q + 1); + if (options.oneofs) + object.searchSpace = "range"; + } + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + object.candidates = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.toObject(message.candidates, options, q + 1); + if (options.oneofs) + object.searchSpace = "candidates"; + } + return object; + }; + + /** + * Converts this DoubleHparamSearchSpace to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @instance + * @returns {Object.} JSON object + */ + DoubleHparamSearchSpace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleHparamSearchSpace + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleHparamSearchSpace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace"; + }; + + DoubleHparamSearchSpace.DoubleRange = (function() { + + /** + * Properties of a DoubleRange. + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @interface IDoubleRange + * @property {google.protobuf.IDoubleValue|null} [min] DoubleRange min + * @property {google.protobuf.IDoubleValue|null} [max] DoubleRange max + */ + + /** + * Constructs a new DoubleRange. + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @classdesc Represents a DoubleRange. + * @implements IDoubleRange + * @constructor + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange=} [properties] Properties to set + */ + function DoubleRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleRange min. + * @member {google.protobuf.IDoubleValue|null|undefined} min + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @instance + */ + DoubleRange.prototype.min = null; + + /** + * DoubleRange max. + * @member {google.protobuf.IDoubleValue|null|undefined} max + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @instance + */ + DoubleRange.prototype.max = null; + + /** + * Creates a new DoubleRange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange} DoubleRange instance + */ + DoubleRange.create = function create(properties) { + return new DoubleRange(properties); + }; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.protobuf.DoubleValue.encode(message.min, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.protobuf.DoubleValue.encode(message.max, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.min = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.max = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleRange message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.min != null && Object.hasOwnProperty.call(message, "min")) { + var error = $root.google.protobuf.DoubleValue.verify(message.min, long + 1); + if (error) + return "min." + error; + } + if (message.max != null && Object.hasOwnProperty.call(message, "max")) { + var error = $root.google.protobuf.DoubleValue.verify(message.max, long + 1); + if (error) + return "max." + error; + } + return null; + }; + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange} DoubleRange + */ + DoubleRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange(); + if (object.min != null) { + if (!$util.isObject(object.min)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.min: object expected"); + message.min = $root.google.protobuf.DoubleValue.fromObject(object.min, long + 1); + } + if (object.max != null) { + if (!$util.isObject(object.max)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange.max: object expected"); + message.max = $root.google.protobuf.DoubleValue.fromObject(object.max, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange} message DoubleRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.min = null; + object.max = null; + } + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + object.min = $root.google.protobuf.DoubleValue.toObject(message.min, options, q + 1); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + object.max = $root.google.protobuf.DoubleValue.toObject(message.max, options, q + 1); + return object; + }; + + /** + * Converts this DoubleRange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @instance + * @returns {Object.} JSON object + */ + DoubleRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleRange + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleRange"; + }; + + return DoubleRange; + })(); + + DoubleHparamSearchSpace.DoubleCandidates = (function() { + + /** + * Properties of a DoubleCandidates. + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @interface IDoubleCandidates + * @property {Array.|null} [candidates] DoubleCandidates candidates + */ + + /** + * Constructs a new DoubleCandidates. + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace + * @classdesc Represents a DoubleCandidates. + * @implements IDoubleCandidates + * @constructor + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates=} [properties] Properties to set + */ + function DoubleCandidates(properties) { + this.candidates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleCandidates candidates. + * @member {Array.} candidates + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @instance + */ + DoubleCandidates.prototype.candidates = $util.emptyArray; + + /** + * Creates a new DoubleCandidates instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates} DoubleCandidates instance + */ + DoubleCandidates.create = function create(properties) { + return new DoubleCandidates(properties); + }; + + /** + * Encodes the specified DoubleCandidates message. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates} message DoubleCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleCandidates.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.protobuf.DoubleValue.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified DoubleCandidates message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.IDoubleCandidates} message DoubleCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleCandidates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DoubleCandidates message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates} DoubleCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleCandidates.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleCandidates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates} DoubleCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleCandidates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleCandidates message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleCandidates.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.protobuf.DoubleValue.verify(message.candidates[i], long + 1); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates a DoubleCandidates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates} DoubleCandidates + */ + DoubleCandidates.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (!$util.isObject(object.candidates[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates.candidates: object expected"); + message.candidates[i] = $root.google.protobuf.DoubleValue.fromObject(object.candidates[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a DoubleCandidates message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates} message DoubleCandidates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleCandidates.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.protobuf.DoubleValue.toObject(message.candidates[j], options, q + 1); + } + return object; + }; + + /** + * Converts this DoubleCandidates to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @instance + * @returns {Object.} JSON object + */ + DoubleCandidates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleCandidates + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.DoubleCandidates"; + }; + + return DoubleCandidates; + })(); + + return DoubleHparamSearchSpace; + })(); + + Model.IntHparamSearchSpace = (function() { + + /** + * Properties of an IntHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @interface IIntHparamSearchSpace + * @property {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange|null} [range] IntHparamSearchSpace range + * @property {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates|null} [candidates] IntHparamSearchSpace candidates + */ + + /** + * Constructs a new IntHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an IntHparamSearchSpace. + * @implements IIntHparamSearchSpace + * @constructor + * @param {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace=} [properties] Properties to set + */ + function IntHparamSearchSpace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntHparamSearchSpace range. + * @member {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange|null|undefined} range + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @instance + */ + IntHparamSearchSpace.prototype.range = null; + + /** + * IntHparamSearchSpace candidates. + * @member {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates|null|undefined} candidates + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @instance + */ + IntHparamSearchSpace.prototype.candidates = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IntHparamSearchSpace searchSpace. + * @member {"range"|"candidates"|undefined} searchSpace + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @instance + */ + Object.defineProperty(IntHparamSearchSpace.prototype, "searchSpace", { + get: $util.oneOfGetter($oneOfFields = ["range", "candidates"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IntHparamSearchSpace instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace} IntHparamSearchSpace instance + */ + IntHparamSearchSpace.create = function create(properties) { + return new IntHparamSearchSpace(properties); + }; + + /** + * Encodes the specified IntHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace} message IntHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntHparamSearchSpace.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.encode(message.range, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.encode(message.candidates, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace} message IntHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntHparamSearchSpace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IntHparamSearchSpace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace} IntHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntHparamSearchSpace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.range = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.candidates = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntHparamSearchSpace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace} IntHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntHparamSearchSpace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntHparamSearchSpace message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntHparamSearchSpace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + properties.searchSpace = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.verify(message.range, long + 1); + if (error) + return "range." + error; + } + } + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (properties.searchSpace === 1) + return "searchSpace: multiple values"; + properties.searchSpace = 1; + { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.verify(message.candidates, long + 1); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates an IntHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace} IntHparamSearchSpace + */ + IntHparamSearchSpace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace(); + if (object.range != null) { + if (!$util.isObject(object.range)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.range: object expected"); + message.range = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.fromObject(object.range, long + 1); + } + if (object.candidates != null) { + if (!$util.isObject(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.candidates: object expected"); + message.candidates = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.fromObject(object.candidates, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IntHparamSearchSpace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace} message IntHparamSearchSpace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntHparamSearchSpace.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + object.range = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.toObject(message.range, options, q + 1); + if (options.oneofs) + object.searchSpace = "range"; + } + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + object.candidates = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.toObject(message.candidates, options, q + 1); + if (options.oneofs) + object.searchSpace = "candidates"; + } + return object; + }; + + /** + * Converts this IntHparamSearchSpace to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @instance + * @returns {Object.} JSON object + */ + IntHparamSearchSpace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntHparamSearchSpace + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntHparamSearchSpace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.IntHparamSearchSpace"; + }; + + IntHparamSearchSpace.IntRange = (function() { + + /** + * Properties of an IntRange. + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @interface IIntRange + * @property {google.protobuf.IInt64Value|null} [min] IntRange min + * @property {google.protobuf.IInt64Value|null} [max] IntRange max + */ + + /** + * Constructs a new IntRange. + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @classdesc Represents an IntRange. + * @implements IIntRange + * @constructor + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange=} [properties] Properties to set + */ + function IntRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntRange min. + * @member {google.protobuf.IInt64Value|null|undefined} min + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @instance + */ + IntRange.prototype.min = null; + + /** + * IntRange max. + * @member {google.protobuf.IInt64Value|null|undefined} max + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @instance + */ + IntRange.prototype.max = null; + + /** + * Creates a new IntRange instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange} IntRange instance + */ + IntRange.create = function create(properties) { + return new IntRange(properties); + }; + + /** + * Encodes the specified IntRange message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange} message IntRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + $root.google.protobuf.Int64Value.encode(message.min, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + $root.google.protobuf.Int64Value.encode(message.max, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntRange message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntRange} message IntRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IntRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange} IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.min = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.max = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange} IntRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntRange message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.min != null && Object.hasOwnProperty.call(message, "min")) { + var error = $root.google.protobuf.Int64Value.verify(message.min, long + 1); + if (error) + return "min." + error; + } + if (message.max != null && Object.hasOwnProperty.call(message, "max")) { + var error = $root.google.protobuf.Int64Value.verify(message.max, long + 1); + if (error) + return "max." + error; + } + return null; + }; + + /** + * Creates an IntRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange} IntRange + */ + IntRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange(); + if (object.min != null) { + if (!$util.isObject(object.min)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.min: object expected"); + message.min = $root.google.protobuf.Int64Value.fromObject(object.min, long + 1); + } + if (object.max != null) { + if (!$util.isObject(object.max)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange.max: object expected"); + message.max = $root.google.protobuf.Int64Value.fromObject(object.max, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IntRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange} message IntRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.min = null; + object.max = null; + } + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + object.min = $root.google.protobuf.Int64Value.toObject(message.min, options, q + 1); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + object.max = $root.google.protobuf.Int64Value.toObject(message.max, options, q + 1); + return object; + }; + + /** + * Converts this IntRange to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @instance + * @returns {Object.} JSON object + */ + IntRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntRange + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntRange"; + }; + + return IntRange; + })(); + + IntHparamSearchSpace.IntCandidates = (function() { + + /** + * Properties of an IntCandidates. + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @interface IIntCandidates + * @property {Array.|null} [candidates] IntCandidates candidates + */ + + /** + * Constructs a new IntCandidates. + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace + * @classdesc Represents an IntCandidates. + * @implements IIntCandidates + * @constructor + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates=} [properties] Properties to set + */ + function IntCandidates(properties) { + this.candidates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntCandidates candidates. + * @member {Array.} candidates + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @instance + */ + IntCandidates.prototype.candidates = $util.emptyArray; + + /** + * Creates a new IntCandidates instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates} IntCandidates instance + */ + IntCandidates.create = function create(properties) { + return new IntCandidates(properties); + }; + + /** + * Encodes the specified IntCandidates message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates} message IntCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntCandidates.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.protobuf.Int64Value.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntCandidates message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IIntCandidates} message IntCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntCandidates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IntCandidates message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates} IntCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntCandidates.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntCandidates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates} IntCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntCandidates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntCandidates message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntCandidates.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.protobuf.Int64Value.verify(message.candidates[i], long + 1); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates an IntCandidates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates} IntCandidates + */ + IntCandidates.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (!$util.isObject(object.candidates[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates.candidates: object expected"); + message.candidates[i] = $root.google.protobuf.Int64Value.fromObject(object.candidates[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an IntCandidates message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates} message IntCandidates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntCandidates.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.protobuf.Int64Value.toObject(message.candidates[j], options, q + 1); + } + return object; + }; + + /** + * Converts this IntCandidates to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @instance + * @returns {Object.} JSON object + */ + IntCandidates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntCandidates + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.IntHparamSearchSpace.IntCandidates"; + }; + + return IntCandidates; + })(); + + return IntHparamSearchSpace; + })(); + + Model.StringHparamSearchSpace = (function() { + + /** + * Properties of a StringHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @interface IStringHparamSearchSpace + * @property {Array.|null} [candidates] StringHparamSearchSpace candidates + */ + + /** + * Constructs a new StringHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a StringHparamSearchSpace. + * @implements IStringHparamSearchSpace + * @constructor + * @param {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace=} [properties] Properties to set + */ + function StringHparamSearchSpace(properties) { + this.candidates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringHparamSearchSpace candidates. + * @member {Array.} candidates + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @instance + */ + StringHparamSearchSpace.prototype.candidates = $util.emptyArray; + + /** + * Creates a new StringHparamSearchSpace instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.StringHparamSearchSpace} StringHparamSearchSpace instance + */ + StringHparamSearchSpace.create = function create(properties) { + return new StringHparamSearchSpace(properties); + }; + + /** + * Encodes the specified StringHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace} message StringHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringHparamSearchSpace.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.candidates[i]); + return writer; + }; + + /** + * Encodes the specified StringHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace} message StringHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringHparamSearchSpace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StringHparamSearchSpace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.StringHparamSearchSpace} StringHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringHparamSearchSpace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StringHparamSearchSpace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.StringHparamSearchSpace} StringHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringHparamSearchSpace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringHparamSearchSpace message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringHparamSearchSpace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) + if (!$util.isString(message.candidates[i])) + return "candidates: string[] expected"; + } + return null; + }; + + /** + * Creates a StringHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.StringHparamSearchSpace} StringHparamSearchSpace + */ + StringHparamSearchSpace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.StringHparamSearchSpace: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.StringHparamSearchSpace.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) + message.candidates[i] = String(object.candidates[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringHparamSearchSpace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.StringHparamSearchSpace} message StringHparamSearchSpace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringHparamSearchSpace.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = message.candidates[j]; + } + return object; + }; + + /** + * Converts this StringHparamSearchSpace to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @instance + * @returns {Object.} JSON object + */ + StringHparamSearchSpace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringHparamSearchSpace + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.StringHparamSearchSpace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringHparamSearchSpace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.StringHparamSearchSpace"; + }; + + return StringHparamSearchSpace; + })(); + + Model.IntArrayHparamSearchSpace = (function() { + + /** + * Properties of an IntArrayHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @interface IIntArrayHparamSearchSpace + * @property {Array.|null} [candidates] IntArrayHparamSearchSpace candidates + */ + + /** + * Constructs a new IntArrayHparamSearchSpace. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents an IntArrayHparamSearchSpace. + * @implements IIntArrayHparamSearchSpace + * @constructor + * @param {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace=} [properties] Properties to set + */ + function IntArrayHparamSearchSpace(properties) { + this.candidates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntArrayHparamSearchSpace candidates. + * @member {Array.} candidates + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @instance + */ + IntArrayHparamSearchSpace.prototype.candidates = $util.emptyArray; + + /** + * Creates a new IntArrayHparamSearchSpace instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace} IntArrayHparamSearchSpace instance + */ + IntArrayHparamSearchSpace.create = function create(properties) { + return new IntArrayHparamSearchSpace(properties); + }; + + /** + * Encodes the specified IntArrayHparamSearchSpace message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace} message IntArrayHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntArrayHparamSearchSpace.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntArrayHparamSearchSpace message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace} message IntArrayHparamSearchSpace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntArrayHparamSearchSpace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IntArrayHparamSearchSpace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace} IntArrayHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntArrayHparamSearchSpace.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntArrayHparamSearchSpace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace} IntArrayHparamSearchSpace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntArrayHparamSearchSpace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntArrayHparamSearchSpace message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntArrayHparamSearchSpace.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.candidates != null && Object.hasOwnProperty.call(message, "candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.verify(message.candidates[i], long + 1); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates an IntArrayHparamSearchSpace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace} IntArrayHparamSearchSpace + */ + IntArrayHparamSearchSpace.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (!$util.isObject(object.candidates[i])) + throw TypeError(".google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.candidates: object expected"); + message.candidates[i] = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.fromObject(object.candidates[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an IntArrayHparamSearchSpace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace} message IntArrayHparamSearchSpace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntArrayHparamSearchSpace.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.toObject(message.candidates[j], options, q + 1); + } + return object; + }; + + /** + * Converts this IntArrayHparamSearchSpace to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @instance + * @returns {Object.} JSON object + */ + IntArrayHparamSearchSpace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntArrayHparamSearchSpace + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntArrayHparamSearchSpace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace"; + }; + + IntArrayHparamSearchSpace.IntArray = (function() { + + /** + * Properties of an IntArray. + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @interface IIntArray + * @property {Array.|null} [elements] IntArray elements + */ + + /** + * Constructs a new IntArray. + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace + * @classdesc Represents an IntArray. + * @implements IIntArray + * @constructor + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray=} [properties] Properties to set + */ + function IntArray(properties) { + this.elements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntArray elements. + * @member {Array.} elements + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @instance + */ + IntArray.prototype.elements = $util.emptyArray; + + /** + * Creates a new IntArray instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray} IntArray instance + */ + IntArray.create = function create(properties) { + return new IntArray(properties); + }; + + /** + * Encodes the specified IntArray message. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray} message IntArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntArray.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.elements != null && message.elements.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.elements.length; ++i) + writer.int64(message.elements[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IntArray message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IIntArray} message IntArray message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntArray.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IntArray message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray} IntArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntArray.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.elements && message.elements.length)) + message.elements = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.elements.push(reader.int64()); + } else + message.elements.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IntArray message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray} IntArray + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntArray.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntArray message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntArray.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.elements != null && Object.hasOwnProperty.call(message, "elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) + if (!$util.isInteger(message.elements[i]) && !(message.elements[i] && $util.isInteger(message.elements[i].low) && $util.isInteger(message.elements[i].high))) + return "elements: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates an IntArray message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray} IntArray + */ + IntArray.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray(); + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) + if ($util.Long) + message.elements[i] = $util.Long.fromValue(object.elements[i], false); + else if (typeof object.elements[i] === "string") + message.elements[i] = parseInt(object.elements[i], 10); + else if (typeof object.elements[i] === "number") + message.elements[i] = object.elements[i]; + else if (typeof object.elements[i] === "object") + message.elements[i] = new $util.LongBits(object.elements[i].low >>> 0, object.elements[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from an IntArray message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray} message IntArray + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntArray.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.elements[j] = typeof message.elements[j] === "number" ? BigInt(message.elements[j]) : $util.Long.fromBits(message.elements[j].low >>> 0, message.elements[j].high >>> 0, false).toBigInt(); + else if (typeof message.elements[j] === "number") + object.elements[j] = options.longs === String ? String(message.elements[j]) : message.elements[j]; + else + object.elements[j] = options.longs === String ? $util.Long.prototype.toString.call(message.elements[j]) : options.longs === Number ? new $util.LongBits(message.elements[j].low >>> 0, message.elements[j].high >>> 0).toNumber() : message.elements[j]; + } + return object; + }; + + /** + * Converts this IntArray to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @instance + * @returns {Object.} JSON object + */ + IntArray.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntArray + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntArray.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.IntArray"; + }; + + return IntArray; + })(); + + return IntArrayHparamSearchSpace; + })(); + + Model.HparamSearchSpaces = (function() { + + /** + * Properties of a HparamSearchSpaces. + * @memberof google.cloud.bigquery.v2.Model + * @interface IHparamSearchSpaces + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [learnRate] HparamSearchSpaces learnRate + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [l1Reg] HparamSearchSpaces l1Reg + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [l2Reg] HparamSearchSpaces l2Reg + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [numClusters] HparamSearchSpaces numClusters + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [numFactors] HparamSearchSpaces numFactors + * @property {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace|null} [hiddenUnits] HparamSearchSpaces hiddenUnits + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [batchSize] HparamSearchSpaces batchSize + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [dropout] HparamSearchSpaces dropout + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [maxTreeDepth] HparamSearchSpaces maxTreeDepth + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [subsample] HparamSearchSpaces subsample + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [minSplitLoss] HparamSearchSpaces minSplitLoss + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [walsAlpha] HparamSearchSpaces walsAlpha + * @property {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null} [boosterType] HparamSearchSpaces boosterType + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [numParallelTree] HparamSearchSpaces numParallelTree + * @property {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null} [dartNormalizeType] HparamSearchSpaces dartNormalizeType + * @property {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null} [treeMethod] HparamSearchSpaces treeMethod + * @property {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null} [minTreeChildWeight] HparamSearchSpaces minTreeChildWeight + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [colsampleBytree] HparamSearchSpaces colsampleBytree + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [colsampleBylevel] HparamSearchSpaces colsampleBylevel + * @property {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null} [colsampleBynode] HparamSearchSpaces colsampleBynode + * @property {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null} [activationFn] HparamSearchSpaces activationFn + * @property {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null} [optimizer] HparamSearchSpaces optimizer + */ + + /** + * Constructs a new HparamSearchSpaces. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a HparamSearchSpaces. + * @implements IHparamSearchSpaces + * @constructor + * @param {google.cloud.bigquery.v2.Model.IHparamSearchSpaces=} [properties] Properties to set + */ + function HparamSearchSpaces(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HparamSearchSpaces learnRate. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} learnRate + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.learnRate = null; + + /** + * HparamSearchSpaces l1Reg. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} l1Reg + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.l1Reg = null; + + /** + * HparamSearchSpaces l2Reg. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} l2Reg + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.l2Reg = null; + + /** + * HparamSearchSpaces numClusters. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} numClusters + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.numClusters = null; + + /** + * HparamSearchSpaces numFactors. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} numFactors + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.numFactors = null; + + /** + * HparamSearchSpaces hiddenUnits. + * @member {google.cloud.bigquery.v2.Model.IIntArrayHparamSearchSpace|null|undefined} hiddenUnits + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.hiddenUnits = null; + + /** + * HparamSearchSpaces batchSize. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} batchSize + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.batchSize = null; + + /** + * HparamSearchSpaces dropout. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} dropout + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.dropout = null; + + /** + * HparamSearchSpaces maxTreeDepth. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} maxTreeDepth + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.maxTreeDepth = null; + + /** + * HparamSearchSpaces subsample. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} subsample + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.subsample = null; + + /** + * HparamSearchSpaces minSplitLoss. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} minSplitLoss + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.minSplitLoss = null; + + /** + * HparamSearchSpaces walsAlpha. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} walsAlpha + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.walsAlpha = null; + + /** + * HparamSearchSpaces boosterType. + * @member {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null|undefined} boosterType + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.boosterType = null; + + /** + * HparamSearchSpaces numParallelTree. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} numParallelTree + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.numParallelTree = null; + + /** + * HparamSearchSpaces dartNormalizeType. + * @member {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null|undefined} dartNormalizeType + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.dartNormalizeType = null; + + /** + * HparamSearchSpaces treeMethod. + * @member {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null|undefined} treeMethod + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.treeMethod = null; + + /** + * HparamSearchSpaces minTreeChildWeight. + * @member {google.cloud.bigquery.v2.Model.IIntHparamSearchSpace|null|undefined} minTreeChildWeight + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.minTreeChildWeight = null; + + /** + * HparamSearchSpaces colsampleBytree. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} colsampleBytree + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.colsampleBytree = null; + + /** + * HparamSearchSpaces colsampleBylevel. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} colsampleBylevel + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.colsampleBylevel = null; + + /** + * HparamSearchSpaces colsampleBynode. + * @member {google.cloud.bigquery.v2.Model.IDoubleHparamSearchSpace|null|undefined} colsampleBynode + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.colsampleBynode = null; + + /** + * HparamSearchSpaces activationFn. + * @member {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null|undefined} activationFn + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.activationFn = null; + + /** + * HparamSearchSpaces optimizer. + * @member {google.cloud.bigquery.v2.Model.IStringHparamSearchSpace|null|undefined} optimizer + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + */ + HparamSearchSpaces.prototype.optimizer = null; + + /** + * Creates a new HparamSearchSpaces instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamSearchSpaces=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.HparamSearchSpaces} HparamSearchSpaces instance + */ + HparamSearchSpaces.create = function create(properties) { + return new HparamSearchSpaces(properties); + }; + + /** + * Encodes the specified HparamSearchSpaces message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamSearchSpaces.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamSearchSpaces} message HparamSearchSpaces message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamSearchSpaces.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.learnRate, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.l1Reg != null && Object.hasOwnProperty.call(message, "l1Reg")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.l1Reg, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.l2Reg != null && Object.hasOwnProperty.call(message, "l2Reg")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.l2Reg, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.numClusters, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.numFactors, writer.uint32(/* id 31, wireType 2 =*/250).fork(), q + 1).ldelim(); + if (message.hiddenUnits != null && Object.hasOwnProperty.call(message, "hiddenUnits")) + $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.encode(message.hiddenUnits, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.batchSize, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.dropout, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.maxTreeDepth, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.subsample, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.minSplitLoss, writer.uint32(/* id 43, wireType 2 =*/346).fork(), q + 1).ldelim(); + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.walsAlpha, writer.uint32(/* id 49, wireType 2 =*/394).fork(), q + 1).ldelim(); + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) + $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.encode(message.boosterType, writer.uint32(/* id 56, wireType 2 =*/450).fork(), q + 1).ldelim(); + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.numParallelTree, writer.uint32(/* id 57, wireType 2 =*/458).fork(), q + 1).ldelim(); + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) + $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.encode(message.dartNormalizeType, writer.uint32(/* id 58, wireType 2 =*/466).fork(), q + 1).ldelim(); + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) + $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.encode(message.treeMethod, writer.uint32(/* id 59, wireType 2 =*/474).fork(), q + 1).ldelim(); + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) + $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.encode(message.minTreeChildWeight, writer.uint32(/* id 60, wireType 2 =*/482).fork(), q + 1).ldelim(); + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.colsampleBytree, writer.uint32(/* id 61, wireType 2 =*/490).fork(), q + 1).ldelim(); + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.colsampleBylevel, writer.uint32(/* id 62, wireType 2 =*/498).fork(), q + 1).ldelim(); + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) + $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.encode(message.colsampleBynode, writer.uint32(/* id 63, wireType 2 =*/506).fork(), q + 1).ldelim(); + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) + $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.encode(message.activationFn, writer.uint32(/* id 67, wireType 2 =*/538).fork(), q + 1).ldelim(); + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) + $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.encode(message.optimizer, writer.uint32(/* id 68, wireType 2 =*/546).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified HparamSearchSpaces message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamSearchSpaces.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamSearchSpaces} message HparamSearchSpaces message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamSearchSpaces.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HparamSearchSpaces message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.HparamSearchSpaces} HparamSearchSpaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamSearchSpaces.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.learnRate = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.l1Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.l2Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.numClusters = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 31: { + message.numFactors = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 34: { + message.hiddenUnits = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + message.batchSize = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.dropout = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 41: { + message.maxTreeDepth = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.subsample = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 43: { + message.minSplitLoss = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 49: { + message.walsAlpha = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 56: { + message.boosterType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 57: { + message.numParallelTree = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 58: { + message.dartNormalizeType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 59: { + message.treeMethod = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 60: { + message.minTreeChildWeight = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 61: { + message.colsampleBytree = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 62: { + message.colsampleBylevel = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 63: { + message.colsampleBynode = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 67: { + message.activationFn = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 68: { + message.optimizer = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HparamSearchSpaces message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.HparamSearchSpaces} HparamSearchSpaces + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamSearchSpaces.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HparamSearchSpaces message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HparamSearchSpaces.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.learnRate, long + 1); + if (error) + return "learnRate." + error; + } + if (message.l1Reg != null && Object.hasOwnProperty.call(message, "l1Reg")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.l1Reg, long + 1); + if (error) + return "l1Reg." + error; + } + if (message.l2Reg != null && Object.hasOwnProperty.call(message, "l2Reg")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.l2Reg, long + 1); + if (error) + return "l2Reg." + error; + } + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.numClusters, long + 1); + if (error) + return "numClusters." + error; + } + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.numFactors, long + 1); + if (error) + return "numFactors." + error; + } + if (message.hiddenUnits != null && Object.hasOwnProperty.call(message, "hiddenUnits")) { + var error = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.verify(message.hiddenUnits, long + 1); + if (error) + return "hiddenUnits." + error; + } + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.batchSize, long + 1); + if (error) + return "batchSize." + error; + } + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.dropout, long + 1); + if (error) + return "dropout." + error; + } + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.maxTreeDepth, long + 1); + if (error) + return "maxTreeDepth." + error; + } + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.subsample, long + 1); + if (error) + return "subsample." + error; + } + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.minSplitLoss, long + 1); + if (error) + return "minSplitLoss." + error; + } + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.walsAlpha, long + 1); + if (error) + return "walsAlpha." + error; + } + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) { + var error = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify(message.boosterType, long + 1); + if (error) + return "boosterType." + error; + } + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.numParallelTree, long + 1); + if (error) + return "numParallelTree." + error; + } + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) { + var error = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify(message.dartNormalizeType, long + 1); + if (error) + return "dartNormalizeType." + error; + } + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) { + var error = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify(message.treeMethod, long + 1); + if (error) + return "treeMethod." + error; + } + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) { + var error = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.verify(message.minTreeChildWeight, long + 1); + if (error) + return "minTreeChildWeight." + error; + } + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.colsampleBytree, long + 1); + if (error) + return "colsampleBytree." + error; + } + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.colsampleBylevel, long + 1); + if (error) + return "colsampleBylevel." + error; + } + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) { + var error = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.verify(message.colsampleBynode, long + 1); + if (error) + return "colsampleBynode." + error; + } + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) { + var error = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify(message.activationFn, long + 1); + if (error) + return "activationFn." + error; + } + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) { + var error = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.verify(message.optimizer, long + 1); + if (error) + return "optimizer." + error; + } + return null; + }; + + /** + * Creates a HparamSearchSpaces message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.HparamSearchSpaces} HparamSearchSpaces + */ + HparamSearchSpaces.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.HparamSearchSpaces(); + if (object.learnRate != null) { + if (!$util.isObject(object.learnRate)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.learnRate: object expected"); + message.learnRate = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.learnRate, long + 1); + } + if (object.l1Reg != null) { + if (!$util.isObject(object.l1Reg)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.l1Reg: object expected"); + message.l1Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.l1Reg, long + 1); + } + if (object.l2Reg != null) { + if (!$util.isObject(object.l2Reg)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.l2Reg: object expected"); + message.l2Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.l2Reg, long + 1); + } + if (object.numClusters != null) { + if (!$util.isObject(object.numClusters)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.numClusters: object expected"); + message.numClusters = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.numClusters, long + 1); + } + if (object.numFactors != null) { + if (!$util.isObject(object.numFactors)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.numFactors: object expected"); + message.numFactors = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.numFactors, long + 1); + } + if (object.hiddenUnits != null) { + if (!$util.isObject(object.hiddenUnits)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.hiddenUnits: object expected"); + message.hiddenUnits = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.fromObject(object.hiddenUnits, long + 1); + } + if (object.batchSize != null) { + if (!$util.isObject(object.batchSize)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.batchSize: object expected"); + message.batchSize = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.batchSize, long + 1); + } + if (object.dropout != null) { + if (!$util.isObject(object.dropout)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.dropout: object expected"); + message.dropout = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.dropout, long + 1); + } + if (object.maxTreeDepth != null) { + if (!$util.isObject(object.maxTreeDepth)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.maxTreeDepth: object expected"); + message.maxTreeDepth = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.maxTreeDepth, long + 1); + } + if (object.subsample != null) { + if (!$util.isObject(object.subsample)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.subsample: object expected"); + message.subsample = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.subsample, long + 1); + } + if (object.minSplitLoss != null) { + if (!$util.isObject(object.minSplitLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.minSplitLoss: object expected"); + message.minSplitLoss = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.minSplitLoss, long + 1); + } + if (object.walsAlpha != null) { + if (!$util.isObject(object.walsAlpha)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.walsAlpha: object expected"); + message.walsAlpha = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.walsAlpha, long + 1); + } + if (object.boosterType != null) { + if (!$util.isObject(object.boosterType)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.boosterType: object expected"); + message.boosterType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.fromObject(object.boosterType, long + 1); + } + if (object.numParallelTree != null) { + if (!$util.isObject(object.numParallelTree)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.numParallelTree: object expected"); + message.numParallelTree = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.numParallelTree, long + 1); + } + if (object.dartNormalizeType != null) { + if (!$util.isObject(object.dartNormalizeType)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.dartNormalizeType: object expected"); + message.dartNormalizeType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.fromObject(object.dartNormalizeType, long + 1); + } + if (object.treeMethod != null) { + if (!$util.isObject(object.treeMethod)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.treeMethod: object expected"); + message.treeMethod = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.fromObject(object.treeMethod, long + 1); + } + if (object.minTreeChildWeight != null) { + if (!$util.isObject(object.minTreeChildWeight)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.minTreeChildWeight: object expected"); + message.minTreeChildWeight = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.fromObject(object.minTreeChildWeight, long + 1); + } + if (object.colsampleBytree != null) { + if (!$util.isObject(object.colsampleBytree)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.colsampleBytree: object expected"); + message.colsampleBytree = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.colsampleBytree, long + 1); + } + if (object.colsampleBylevel != null) { + if (!$util.isObject(object.colsampleBylevel)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.colsampleBylevel: object expected"); + message.colsampleBylevel = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.colsampleBylevel, long + 1); + } + if (object.colsampleBynode != null) { + if (!$util.isObject(object.colsampleBynode)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.colsampleBynode: object expected"); + message.colsampleBynode = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.fromObject(object.colsampleBynode, long + 1); + } + if (object.activationFn != null) { + if (!$util.isObject(object.activationFn)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.activationFn: object expected"); + message.activationFn = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.fromObject(object.activationFn, long + 1); + } + if (object.optimizer != null) { + if (!$util.isObject(object.optimizer)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamSearchSpaces.optimizer: object expected"); + message.optimizer = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.fromObject(object.optimizer, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a HparamSearchSpaces message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {google.cloud.bigquery.v2.Model.HparamSearchSpaces} message HparamSearchSpaces + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HparamSearchSpaces.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.learnRate = null; + object.l1Reg = null; + object.l2Reg = null; + object.numClusters = null; + object.numFactors = null; + object.hiddenUnits = null; + object.batchSize = null; + object.dropout = null; + object.maxTreeDepth = null; + object.subsample = null; + object.minSplitLoss = null; + object.walsAlpha = null; + object.boosterType = null; + object.numParallelTree = null; + object.dartNormalizeType = null; + object.treeMethod = null; + object.minTreeChildWeight = null; + object.colsampleBytree = null; + object.colsampleBylevel = null; + object.colsampleBynode = null; + object.activationFn = null; + object.optimizer = null; + } + if (message.learnRate != null && Object.hasOwnProperty.call(message, "learnRate")) + object.learnRate = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.learnRate, options, q + 1); + if (message.l1Reg != null && Object.hasOwnProperty.call(message, "l1Reg")) + object.l1Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.l1Reg, options, q + 1); + if (message.l2Reg != null && Object.hasOwnProperty.call(message, "l2Reg")) + object.l2Reg = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.l2Reg, options, q + 1); + if (message.numClusters != null && Object.hasOwnProperty.call(message, "numClusters")) + object.numClusters = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.numClusters, options, q + 1); + if (message.numFactors != null && Object.hasOwnProperty.call(message, "numFactors")) + object.numFactors = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.numFactors, options, q + 1); + if (message.hiddenUnits != null && Object.hasOwnProperty.call(message, "hiddenUnits")) + object.hiddenUnits = $root.google.cloud.bigquery.v2.Model.IntArrayHparamSearchSpace.toObject(message.hiddenUnits, options, q + 1); + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + object.batchSize = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.batchSize, options, q + 1); + if (message.dropout != null && Object.hasOwnProperty.call(message, "dropout")) + object.dropout = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.dropout, options, q + 1); + if (message.maxTreeDepth != null && Object.hasOwnProperty.call(message, "maxTreeDepth")) + object.maxTreeDepth = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.maxTreeDepth, options, q + 1); + if (message.subsample != null && Object.hasOwnProperty.call(message, "subsample")) + object.subsample = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.subsample, options, q + 1); + if (message.minSplitLoss != null && Object.hasOwnProperty.call(message, "minSplitLoss")) + object.minSplitLoss = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.minSplitLoss, options, q + 1); + if (message.walsAlpha != null && Object.hasOwnProperty.call(message, "walsAlpha")) + object.walsAlpha = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.walsAlpha, options, q + 1); + if (message.boosterType != null && Object.hasOwnProperty.call(message, "boosterType")) + object.boosterType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.toObject(message.boosterType, options, q + 1); + if (message.numParallelTree != null && Object.hasOwnProperty.call(message, "numParallelTree")) + object.numParallelTree = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.numParallelTree, options, q + 1); + if (message.dartNormalizeType != null && Object.hasOwnProperty.call(message, "dartNormalizeType")) + object.dartNormalizeType = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.toObject(message.dartNormalizeType, options, q + 1); + if (message.treeMethod != null && Object.hasOwnProperty.call(message, "treeMethod")) + object.treeMethod = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.toObject(message.treeMethod, options, q + 1); + if (message.minTreeChildWeight != null && Object.hasOwnProperty.call(message, "minTreeChildWeight")) + object.minTreeChildWeight = $root.google.cloud.bigquery.v2.Model.IntHparamSearchSpace.toObject(message.minTreeChildWeight, options, q + 1); + if (message.colsampleBytree != null && Object.hasOwnProperty.call(message, "colsampleBytree")) + object.colsampleBytree = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.colsampleBytree, options, q + 1); + if (message.colsampleBylevel != null && Object.hasOwnProperty.call(message, "colsampleBylevel")) + object.colsampleBylevel = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.colsampleBylevel, options, q + 1); + if (message.colsampleBynode != null && Object.hasOwnProperty.call(message, "colsampleBynode")) + object.colsampleBynode = $root.google.cloud.bigquery.v2.Model.DoubleHparamSearchSpace.toObject(message.colsampleBynode, options, q + 1); + if (message.activationFn != null && Object.hasOwnProperty.call(message, "activationFn")) + object.activationFn = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.toObject(message.activationFn, options, q + 1); + if (message.optimizer != null && Object.hasOwnProperty.call(message, "optimizer")) + object.optimizer = $root.google.cloud.bigquery.v2.Model.StringHparamSearchSpace.toObject(message.optimizer, options, q + 1); + return object; + }; + + /** + * Converts this HparamSearchSpaces to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @instance + * @returns {Object.} JSON object + */ + HparamSearchSpaces.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HparamSearchSpaces + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.HparamSearchSpaces + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HparamSearchSpaces.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.HparamSearchSpaces"; + }; + + return HparamSearchSpaces; + })(); + + Model.HparamTuningTrial = (function() { + + /** + * Properties of a HparamTuningTrial. + * @memberof google.cloud.bigquery.v2.Model + * @interface IHparamTuningTrial + * @property {number|Long|null} [trialId] HparamTuningTrial trialId + * @property {number|Long|null} [startTimeMs] HparamTuningTrial startTimeMs + * @property {number|Long|null} [endTimeMs] HparamTuningTrial endTimeMs + * @property {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null} [hparams] HparamTuningTrial hparams + * @property {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null} [evaluationMetrics] HparamTuningTrial evaluationMetrics + * @property {google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus|null} [status] HparamTuningTrial status + * @property {string|null} [errorMessage] HparamTuningTrial errorMessage + * @property {google.protobuf.IDoubleValue|null} [trainingLoss] HparamTuningTrial trainingLoss + * @property {google.protobuf.IDoubleValue|null} [evalLoss] HparamTuningTrial evalLoss + * @property {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null} [hparamTuningEvaluationMetrics] HparamTuningTrial hparamTuningEvaluationMetrics + */ + + /** + * Constructs a new HparamTuningTrial. + * @memberof google.cloud.bigquery.v2.Model + * @classdesc Represents a HparamTuningTrial. + * @implements IHparamTuningTrial + * @constructor + * @param {google.cloud.bigquery.v2.Model.IHparamTuningTrial=} [properties] Properties to set + */ + function HparamTuningTrial(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HparamTuningTrial trialId. + * @member {number|Long} trialId + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.trialId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HparamTuningTrial startTimeMs. + * @member {number|Long} startTimeMs + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.startTimeMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HparamTuningTrial endTimeMs. + * @member {number|Long} endTimeMs + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.endTimeMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HparamTuningTrial hparams. + * @member {google.cloud.bigquery.v2.Model.TrainingRun.ITrainingOptions|null|undefined} hparams + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.hparams = null; + + /** + * HparamTuningTrial evaluationMetrics. + * @member {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null|undefined} evaluationMetrics + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.evaluationMetrics = null; + + /** + * HparamTuningTrial status. + * @member {google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus} status + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.status = 0; + + /** + * HparamTuningTrial errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.errorMessage = ""; + + /** + * HparamTuningTrial trainingLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} trainingLoss + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.trainingLoss = null; + + /** + * HparamTuningTrial evalLoss. + * @member {google.protobuf.IDoubleValue|null|undefined} evalLoss + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.evalLoss = null; + + /** + * HparamTuningTrial hparamTuningEvaluationMetrics. + * @member {google.cloud.bigquery.v2.Model.IEvaluationMetrics|null|undefined} hparamTuningEvaluationMetrics + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + */ + HparamTuningTrial.prototype.hparamTuningEvaluationMetrics = null; + + /** + * Creates a new HparamTuningTrial instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningTrial=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Model.HparamTuningTrial} HparamTuningTrial instance + */ + HparamTuningTrial.create = function create(properties) { + return new HparamTuningTrial(properties); + }; + + /** + * Encodes the specified HparamTuningTrial message. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningTrial.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningTrial} message HparamTuningTrial message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamTuningTrial.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.trialId); + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.startTimeMs); + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.endTimeMs); + if (message.hparams != null && Object.hasOwnProperty.call(message, "hparams")) + $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.encode(message.hparams, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) + $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.encode(message.evaluationMetrics, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.status); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.errorMessage); + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) + $root.google.protobuf.DoubleValue.encode(message.trainingLoss, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) + $root.google.protobuf.DoubleValue.encode(message.evalLoss, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.hparamTuningEvaluationMetrics != null && Object.hasOwnProperty.call(message, "hparamTuningEvaluationMetrics")) + $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.encode(message.hparamTuningEvaluationMetrics, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified HparamTuningTrial message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Model.HparamTuningTrial.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {google.cloud.bigquery.v2.Model.IHparamTuningTrial} message HparamTuningTrial message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HparamTuningTrial.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HparamTuningTrial message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Model.HparamTuningTrial} HparamTuningTrial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamTuningTrial.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Model.HparamTuningTrial(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trialId = reader.int64(); + break; + } + case 2: { + message.startTimeMs = reader.int64(); + break; + } + case 3: { + message.endTimeMs = reader.int64(); + break; + } + case 4: { + message.hparams = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.status = reader.int32(); + break; + } + case 7: { + message.errorMessage = reader.string(); + break; + } + case 8: { + message.trainingLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.evalLoss = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.hparamTuningEvaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HparamTuningTrial message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Model.HparamTuningTrial} HparamTuningTrial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HparamTuningTrial.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HparamTuningTrial message. + * @function verify + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HparamTuningTrial.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) + if (!$util.isInteger(message.trialId) && !(message.trialId && $util.isInteger(message.trialId.low) && $util.isInteger(message.trialId.high))) + return "trialId: integer|Long expected"; + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + if (!$util.isInteger(message.startTimeMs) && !(message.startTimeMs && $util.isInteger(message.startTimeMs.low) && $util.isInteger(message.startTimeMs.high))) + return "startTimeMs: integer|Long expected"; + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + if (!$util.isInteger(message.endTimeMs) && !(message.endTimeMs && $util.isInteger(message.endTimeMs.low) && $util.isInteger(message.endTimeMs.high))) + return "endTimeMs: integer|Long expected"; + if (message.hparams != null && Object.hasOwnProperty.call(message, "hparams")) { + var error = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.verify(message.hparams, long + 1); + if (error) + return "hparams." + error; + } + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.verify(message.evaluationMetrics, long + 1); + if (error) + return "evaluationMetrics." + error; + } + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.trainingLoss, long + 1); + if (error) + return "trainingLoss." + error; + } + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) { + var error = $root.google.protobuf.DoubleValue.verify(message.evalLoss, long + 1); + if (error) + return "evalLoss." + error; + } + if (message.hparamTuningEvaluationMetrics != null && Object.hasOwnProperty.call(message, "hparamTuningEvaluationMetrics")) { + var error = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.verify(message.hparamTuningEvaluationMetrics, long + 1); + if (error) + return "hparamTuningEvaluationMetrics." + error; + } + return null; + }; + + /** + * Creates a HparamTuningTrial message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Model.HparamTuningTrial} HparamTuningTrial + */ + HparamTuningTrial.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Model.HparamTuningTrial) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Model.HparamTuningTrial(); + if (object.trialId != null) + if ($util.Long) + message.trialId = $util.Long.fromValue(object.trialId, false); + else if (typeof object.trialId === "string") + message.trialId = parseInt(object.trialId, 10); + else if (typeof object.trialId === "number") + message.trialId = object.trialId; + else if (typeof object.trialId === "object") + message.trialId = new $util.LongBits(object.trialId.low >>> 0, object.trialId.high >>> 0).toNumber(); + if (object.startTimeMs != null) + if ($util.Long) + message.startTimeMs = $util.Long.fromValue(object.startTimeMs, false); + else if (typeof object.startTimeMs === "string") + message.startTimeMs = parseInt(object.startTimeMs, 10); + else if (typeof object.startTimeMs === "number") + message.startTimeMs = object.startTimeMs; + else if (typeof object.startTimeMs === "object") + message.startTimeMs = new $util.LongBits(object.startTimeMs.low >>> 0, object.startTimeMs.high >>> 0).toNumber(); + if (object.endTimeMs != null) + if ($util.Long) + message.endTimeMs = $util.Long.fromValue(object.endTimeMs, false); + else if (typeof object.endTimeMs === "string") + message.endTimeMs = parseInt(object.endTimeMs, 10); + else if (typeof object.endTimeMs === "number") + message.endTimeMs = object.endTimeMs; + else if (typeof object.endTimeMs === "object") + message.endTimeMs = new $util.LongBits(object.endTimeMs.low >>> 0, object.endTimeMs.high >>> 0).toNumber(); + if (object.hparams != null) { + if (!$util.isObject(object.hparams)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial.hparams: object expected"); + message.hparams = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.fromObject(object.hparams, long + 1); + } + if (object.evaluationMetrics != null) { + if (!$util.isObject(object.evaluationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial.evaluationMetrics: object expected"); + message.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.fromObject(object.evaluationMetrics, long + 1); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "TRIAL_STATUS_UNSPECIFIED": + case 0: + message.status = 0; + break; + case "NOT_STARTED": + case 1: + message.status = 1; + break; + case "RUNNING": + case 2: + message.status = 2; + break; + case "SUCCEEDED": + case 3: + message.status = 3; + break; + case "FAILED": + case 4: + message.status = 4; + break; + case "INFEASIBLE": + case 5: + message.status = 5; + break; + case "STOPPED_EARLY": + case 6: + message.status = 6; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.trainingLoss != null) { + if (!$util.isObject(object.trainingLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial.trainingLoss: object expected"); + message.trainingLoss = $root.google.protobuf.DoubleValue.fromObject(object.trainingLoss, long + 1); + } + if (object.evalLoss != null) { + if (!$util.isObject(object.evalLoss)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial.evalLoss: object expected"); + message.evalLoss = $root.google.protobuf.DoubleValue.fromObject(object.evalLoss, long + 1); + } + if (object.hparamTuningEvaluationMetrics != null) { + if (!$util.isObject(object.hparamTuningEvaluationMetrics)) + throw TypeError(".google.cloud.bigquery.v2.Model.HparamTuningTrial.hparamTuningEvaluationMetrics: object expected"); + message.hparamTuningEvaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.fromObject(object.hparamTuningEvaluationMetrics, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a HparamTuningTrial message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {google.cloud.bigquery.v2.Model.HparamTuningTrial} message HparamTuningTrial + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HparamTuningTrial.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trialId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.trialId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.startTimeMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTimeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.endTimeMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.hparams = null; + object.evaluationMetrics = null; + object.status = options.enums === String ? "TRIAL_STATUS_UNSPECIFIED" : 0; + object.errorMessage = ""; + object.trainingLoss = null; + object.evalLoss = null; + object.hparamTuningEvaluationMetrics = null; + } + if (message.trialId != null && Object.hasOwnProperty.call(message, "trialId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.trialId = typeof message.trialId === "number" ? BigInt(message.trialId) : $util.Long.fromBits(message.trialId.low >>> 0, message.trialId.high >>> 0, false).toBigInt(); + else if (typeof message.trialId === "number") + object.trialId = options.longs === String ? String(message.trialId) : message.trialId; + else + object.trialId = options.longs === String ? $util.Long.prototype.toString.call(message.trialId) : options.longs === Number ? new $util.LongBits(message.trialId.low >>> 0, message.trialId.high >>> 0).toNumber() : message.trialId; + if (message.startTimeMs != null && Object.hasOwnProperty.call(message, "startTimeMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.startTimeMs = typeof message.startTimeMs === "number" ? BigInt(message.startTimeMs) : $util.Long.fromBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0, false).toBigInt(); + else if (typeof message.startTimeMs === "number") + object.startTimeMs = options.longs === String ? String(message.startTimeMs) : message.startTimeMs; + else + object.startTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeMs) : options.longs === Number ? new $util.LongBits(message.startTimeMs.low >>> 0, message.startTimeMs.high >>> 0).toNumber() : message.startTimeMs; + if (message.endTimeMs != null && Object.hasOwnProperty.call(message, "endTimeMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.endTimeMs = typeof message.endTimeMs === "number" ? BigInt(message.endTimeMs) : $util.Long.fromBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0, false).toBigInt(); + else if (typeof message.endTimeMs === "number") + object.endTimeMs = options.longs === String ? String(message.endTimeMs) : message.endTimeMs; + else + object.endTimeMs = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeMs) : options.longs === Number ? new $util.LongBits(message.endTimeMs.low >>> 0, message.endTimeMs.high >>> 0).toNumber() : message.endTimeMs; + if (message.hparams != null && Object.hasOwnProperty.call(message, "hparams")) + object.hparams = $root.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.toObject(message.hparams, options, q + 1); + if (message.evaluationMetrics != null && Object.hasOwnProperty.call(message, "evaluationMetrics")) + object.evaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.toObject(message.evaluationMetrics, options, q + 1); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = options.enums === String ? $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus[message.status] === undefined ? message.status : $root.google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus[message.status] : message.status; + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + object.errorMessage = message.errorMessage; + if (message.trainingLoss != null && Object.hasOwnProperty.call(message, "trainingLoss")) + object.trainingLoss = $root.google.protobuf.DoubleValue.toObject(message.trainingLoss, options, q + 1); + if (message.evalLoss != null && Object.hasOwnProperty.call(message, "evalLoss")) + object.evalLoss = $root.google.protobuf.DoubleValue.toObject(message.evalLoss, options, q + 1); + if (message.hparamTuningEvaluationMetrics != null && Object.hasOwnProperty.call(message, "hparamTuningEvaluationMetrics")) + object.hparamTuningEvaluationMetrics = $root.google.cloud.bigquery.v2.Model.EvaluationMetrics.toObject(message.hparamTuningEvaluationMetrics, options, q + 1); + return object; + }; + + /** + * Converts this HparamTuningTrial to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @instance + * @returns {Object.} JSON object + */ + HparamTuningTrial.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HparamTuningTrial + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Model.HparamTuningTrial + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HparamTuningTrial.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Model.HparamTuningTrial"; + }; + + /** + * TrialStatus enum. + * @name google.cloud.bigquery.v2.Model.HparamTuningTrial.TrialStatus + * @enum {number} + * @property {number} TRIAL_STATUS_UNSPECIFIED=0 TRIAL_STATUS_UNSPECIFIED value + * @property {number} NOT_STARTED=1 NOT_STARTED value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} INFEASIBLE=5 INFEASIBLE value + * @property {number} STOPPED_EARLY=6 STOPPED_EARLY value + */ + HparamTuningTrial.TrialStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRIAL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_STARTED"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "INFEASIBLE"] = 5; + values[valuesById[6] = "STOPPED_EARLY"] = 6; + return values; + })(); + + return HparamTuningTrial; + })(); + + return Model; + })(); + + v2.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetModelRequest + * @property {string|null} [projectId] GetModelRequest projectId + * @property {string|null} [datasetId] GetModelRequest datasetId + * @property {string|null} [modelId] GetModelRequest modelId + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @instance + */ + GetModelRequest.prototype.projectId = ""; + + /** + * GetModelRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @instance + */ + GetModelRequest.prototype.datasetId = ""; + + /** + * GetModelRequest modelId. + * @member {string} modelId + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @instance + */ + GetModelRequest.prototype.modelId = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {google.cloud.bigquery.v2.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {google.cloud.bigquery.v2.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelId); + return writer; + }; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {google.cloud.bigquery.v2.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.modelId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + if (!$util.isString(message.modelId)) + return "modelId: string expected"; + return null; + }; + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetModelRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetModelRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetModelRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.modelId != null) + message.modelId = String(object.modelId); + return message; + }; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {google.cloud.bigquery.v2.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.modelId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + object.modelId = message.modelId; + return object; + }; + + /** + * Converts this GetModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v2.PatchModelRequest = (function() { + + /** + * Properties of a PatchModelRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IPatchModelRequest + * @property {string|null} [projectId] PatchModelRequest projectId + * @property {string|null} [datasetId] PatchModelRequest datasetId + * @property {string|null} [modelId] PatchModelRequest modelId + * @property {google.cloud.bigquery.v2.IModel|null} [model] PatchModelRequest model + */ + + /** + * Constructs a new PatchModelRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PatchModelRequest. + * @implements IPatchModelRequest + * @constructor + * @param {google.cloud.bigquery.v2.IPatchModelRequest=} [properties] Properties to set + */ + function PatchModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchModelRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @instance + */ + PatchModelRequest.prototype.projectId = ""; + + /** + * PatchModelRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @instance + */ + PatchModelRequest.prototype.datasetId = ""; + + /** + * PatchModelRequest modelId. + * @member {string} modelId + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @instance + */ + PatchModelRequest.prototype.modelId = ""; + + /** + * PatchModelRequest model. + * @member {google.cloud.bigquery.v2.IModel|null|undefined} model + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @instance + */ + PatchModelRequest.prototype.model = null; + + /** + * Creates a new PatchModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {google.cloud.bigquery.v2.IPatchModelRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PatchModelRequest} PatchModelRequest instance + */ + PatchModelRequest.create = function create(properties) { + return new PatchModelRequest(properties); + }; + + /** + * Encodes the specified PatchModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.PatchModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {google.cloud.bigquery.v2.IPatchModelRequest} message PatchModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchModelRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelId); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.bigquery.v2.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PatchModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {google.cloud.bigquery.v2.IPatchModelRequest} message PatchModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PatchModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PatchModelRequest} PatchModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchModelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PatchModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.modelId = reader.string(); + break; + } + case 4: { + message.model = $root.google.cloud.bigquery.v2.Model.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PatchModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PatchModelRequest} PatchModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchModelRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchModelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + if (!$util.isString(message.modelId)) + return "modelId: string expected"; + if (message.model != null && Object.hasOwnProperty.call(message, "model")) { + var error = $root.google.cloud.bigquery.v2.Model.verify(message.model, long + 1); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates a PatchModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PatchModelRequest} PatchModelRequest + */ + PatchModelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PatchModelRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PatchModelRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PatchModelRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.modelId != null) + message.modelId = String(object.modelId); + if (object.model != null) { + if (!$util.isObject(object.model)) + throw TypeError(".google.cloud.bigquery.v2.PatchModelRequest.model: object expected"); + message.model = $root.google.cloud.bigquery.v2.Model.fromObject(object.model, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PatchModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {google.cloud.bigquery.v2.PatchModelRequest} message PatchModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchModelRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.modelId = ""; + object.model = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + object.modelId = message.modelId; + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + object.model = $root.google.cloud.bigquery.v2.Model.toObject(message.model, options, q + 1); + return object; + }; + + /** + * Converts this PatchModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @instance + * @returns {Object.} JSON object + */ + PatchModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PatchModelRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PatchModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PatchModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PatchModelRequest"; + }; + + return PatchModelRequest; + })(); + + v2.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteModelRequest + * @property {string|null} [projectId] DeleteModelRequest projectId + * @property {string|null} [datasetId] DeleteModelRequest datasetId + * @property {string|null} [modelId] DeleteModelRequest modelId + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteModelRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.projectId = ""; + + /** + * DeleteModelRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.datasetId = ""; + + /** + * DeleteModelRequest modelId. + * @member {string} modelId + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.modelId = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelId); + return writer; + }; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.modelId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + if (!$util.isString(message.modelId)) + return "modelId: string expected"; + return null; + }; + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteModelRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteModelRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteModelRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.modelId != null) + message.modelId = String(object.modelId); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.modelId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.modelId != null && Object.hasOwnProperty.call(message, "modelId")) + object.modelId = message.modelId; + return object; + }; + + /** + * Converts this DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v2.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListModelsRequest + * @property {string|null} [projectId] ListModelsRequest projectId + * @property {string|null} [datasetId] ListModelsRequest datasetId + * @property {google.protobuf.IUInt32Value|null} [maxResults] ListModelsRequest maxResults + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.projectId = ""; + + /** + * ListModelsRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.datasetId = ""; + + /** + * ListModelsRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.maxResults = null; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {google.cloud.bigquery.v2.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {google.cloud.bigquery.v2.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {google.cloud.bigquery.v2.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListModelsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListModelsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListModelsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.ListModelsRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {google.cloud.bigquery.v2.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.maxResults = null; + object.pageToken = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListModelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v2.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IListModelsResponse + * @property {Array.|null} [models] ListModelsResponse models + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.bigquery.v2.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(properties) { + this.models = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsResponse models. + * @member {Array.} models + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.models = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {google.cloud.bigquery.v2.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {google.cloud.bigquery.v2.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.models != null && message.models.length) + for (var i = 0; i < message.models.length; ++i) + $root.google.cloud.bigquery.v2.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {google.cloud.bigquery.v2.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.models && message.models.length)) + message.models = []; + message.models.push($root.google.cloud.bigquery.v2.Model.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.models != null && Object.hasOwnProperty.call(message, "models")) { + if (!Array.isArray(message.models)) + return "models: array expected"; + for (var i = 0; i < message.models.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Model.verify(message.models[i], long + 1); + if (error) + return "models." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListModelsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListModelsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".google.cloud.bigquery.v2.ListModelsResponse.models: array expected"); + message.models = []; + for (var i = 0; i < object.models.length; ++i) { + if (!$util.isObject(object.models[i])) + throw TypeError(".google.cloud.bigquery.v2.ListModelsResponse.models: object expected"); + message.models[i] = $root.google.cloud.bigquery.v2.Model.fromObject(object.models[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {google.cloud.bigquery.v2.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.models = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.models && message.models.length) { + object.models = []; + for (var j = 0; j < message.models.length; ++j) + object.models[j] = $root.google.cloud.bigquery.v2.Model.toObject(message.models[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v2.PropertyGraphReference = (function() { + + /** + * Properties of a PropertyGraphReference. + * @memberof google.cloud.bigquery.v2 + * @interface IPropertyGraphReference + * @property {string|null} [projectId] PropertyGraphReference projectId + * @property {string|null} [datasetId] PropertyGraphReference datasetId + * @property {string|null} [propertyGraphId] PropertyGraphReference propertyGraphId + */ + + /** + * Constructs a new PropertyGraphReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PropertyGraphReference. + * @implements IPropertyGraphReference + * @constructor + * @param {google.cloud.bigquery.v2.IPropertyGraphReference=} [properties] Properties to set + */ + function PropertyGraphReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PropertyGraphReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @instance + */ + PropertyGraphReference.prototype.projectId = ""; + + /** + * PropertyGraphReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @instance + */ + PropertyGraphReference.prototype.datasetId = ""; + + /** + * PropertyGraphReference propertyGraphId. + * @member {string} propertyGraphId + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @instance + */ + PropertyGraphReference.prototype.propertyGraphId = ""; + + /** + * Creates a new PropertyGraphReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {google.cloud.bigquery.v2.IPropertyGraphReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PropertyGraphReference} PropertyGraphReference instance + */ + PropertyGraphReference.create = function create(properties) { + return new PropertyGraphReference(properties); + }; + + /** + * Encodes the specified PropertyGraphReference message. Does not implicitly {@link google.cloud.bigquery.v2.PropertyGraphReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {google.cloud.bigquery.v2.IPropertyGraphReference} message PropertyGraphReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyGraphReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.propertyGraphId != null && Object.hasOwnProperty.call(message, "propertyGraphId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.propertyGraphId); + return writer; + }; + + /** + * Encodes the specified PropertyGraphReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PropertyGraphReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {google.cloud.bigquery.v2.IPropertyGraphReference} message PropertyGraphReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyGraphReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PropertyGraphReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PropertyGraphReference} PropertyGraphReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyGraphReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PropertyGraphReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.propertyGraphId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyGraphReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PropertyGraphReference} PropertyGraphReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyGraphReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyGraphReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyGraphReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.propertyGraphId != null && Object.hasOwnProperty.call(message, "propertyGraphId")) + if (!$util.isString(message.propertyGraphId)) + return "propertyGraphId: string expected"; + return null; + }; + + /** + * Creates a PropertyGraphReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PropertyGraphReference} PropertyGraphReference + */ + PropertyGraphReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PropertyGraphReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PropertyGraphReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PropertyGraphReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.propertyGraphId != null) + message.propertyGraphId = String(object.propertyGraphId); + return message; + }; + + /** + * Creates a plain object from a PropertyGraphReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {google.cloud.bigquery.v2.PropertyGraphReference} message PropertyGraphReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyGraphReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.propertyGraphId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.propertyGraphId != null && Object.hasOwnProperty.call(message, "propertyGraphId")) + object.propertyGraphId = message.propertyGraphId; + return object; + }; + + /** + * Converts this PropertyGraphReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @instance + * @returns {Object.} JSON object + */ + PropertyGraphReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyGraphReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PropertyGraphReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyGraphReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PropertyGraphReference"; + }; + + return PropertyGraphReference; + })(); + + v2.RowAccessPolicyReference = (function() { + + /** + * Properties of a RowAccessPolicyReference. + * @memberof google.cloud.bigquery.v2 + * @interface IRowAccessPolicyReference + * @property {string|null} [projectId] RowAccessPolicyReference projectId + * @property {string|null} [datasetId] RowAccessPolicyReference datasetId + * @property {string|null} [tableId] RowAccessPolicyReference tableId + * @property {string|null} [policyId] RowAccessPolicyReference policyId + */ + + /** + * Constructs a new RowAccessPolicyReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RowAccessPolicyReference. + * @implements IRowAccessPolicyReference + * @constructor + * @param {google.cloud.bigquery.v2.IRowAccessPolicyReference=} [properties] Properties to set + */ + function RowAccessPolicyReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowAccessPolicyReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @instance + */ + RowAccessPolicyReference.prototype.projectId = ""; + + /** + * RowAccessPolicyReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @instance + */ + RowAccessPolicyReference.prototype.datasetId = ""; + + /** + * RowAccessPolicyReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @instance + */ + RowAccessPolicyReference.prototype.tableId = ""; + + /** + * RowAccessPolicyReference policyId. + * @member {string} policyId + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @instance + */ + RowAccessPolicyReference.prototype.policyId = ""; + + /** + * Creates a new RowAccessPolicyReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicyReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RowAccessPolicyReference} RowAccessPolicyReference instance + */ + RowAccessPolicyReference.create = function create(properties) { + return new RowAccessPolicyReference(properties); + }; + + /** + * Encodes the specified RowAccessPolicyReference message. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicyReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicyReference} message RowAccessPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAccessPolicyReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyId); + return writer; + }; + + /** + * Encodes the specified RowAccessPolicyReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicyReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicyReference} message RowAccessPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAccessPolicyReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RowAccessPolicyReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RowAccessPolicyReference} RowAccessPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAccessPolicyReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RowAccessPolicyReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.policyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RowAccessPolicyReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RowAccessPolicyReference} RowAccessPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAccessPolicyReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowAccessPolicyReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowAccessPolicyReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + if (!$util.isString(message.policyId)) + return "policyId: string expected"; + return null; + }; + + /** + * Creates a RowAccessPolicyReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RowAccessPolicyReference} RowAccessPolicyReference + */ + RowAccessPolicyReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RowAccessPolicyReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicyReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RowAccessPolicyReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.policyId != null) + message.policyId = String(object.policyId); + return message; + }; + + /** + * Creates a plain object from a RowAccessPolicyReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {google.cloud.bigquery.v2.RowAccessPolicyReference} message RowAccessPolicyReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowAccessPolicyReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.policyId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + object.policyId = message.policyId; + return object; + }; + + /** + * Converts this RowAccessPolicyReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @instance + * @returns {Object.} JSON object + */ + RowAccessPolicyReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowAccessPolicyReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RowAccessPolicyReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowAccessPolicyReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RowAccessPolicyReference"; + }; + + return RowAccessPolicyReference; + })(); + + v2.SessionInfo = (function() { + + /** + * Properties of a SessionInfo. + * @memberof google.cloud.bigquery.v2 + * @interface ISessionInfo + * @property {string|null} [sessionId] SessionInfo sessionId + */ + + /** + * Constructs a new SessionInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SessionInfo. + * @implements ISessionInfo + * @constructor + * @param {google.cloud.bigquery.v2.ISessionInfo=} [properties] Properties to set + */ + function SessionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionInfo sessionId. + * @member {string} sessionId + * @memberof google.cloud.bigquery.v2.SessionInfo + * @instance + */ + SessionInfo.prototype.sessionId = ""; + + /** + * Creates a new SessionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {google.cloud.bigquery.v2.ISessionInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SessionInfo} SessionInfo instance + */ + SessionInfo.create = function create(properties) { + return new SessionInfo(properties); + }; + + /** + * Encodes the specified SessionInfo message. Does not implicitly {@link google.cloud.bigquery.v2.SessionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {google.cloud.bigquery.v2.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sessionId); + return writer; + }; + + /** + * Encodes the specified SessionInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SessionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {google.cloud.bigquery.v2.ISessionInfo} message SessionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SessionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SessionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SessionInfo} SessionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + return null; + }; + + /** + * Creates a SessionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SessionInfo} SessionInfo + */ + SessionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SessionInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SessionInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SessionInfo(); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + return message; + }; + + /** + * Creates a plain object from a SessionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {google.cloud.bigquery.v2.SessionInfo} message SessionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.sessionId = ""; + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + object.sessionId = message.sessionId; + return object; + }; + + /** + * Converts this SessionInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SessionInfo + * @instance + * @returns {Object.} JSON object + */ + SessionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SessionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SessionInfo"; + }; + + return SessionInfo; + })(); + + v2.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.bigquery.v2 + * @interface IJobStatus + * @property {google.cloud.bigquery.v2.IErrorProto|null} [errorResult] JobStatus errorResult + * @property {Array.|null} [errors] JobStatus errors + * @property {string|null} [state] JobStatus state + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.bigquery.v2.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus errorResult. + * @member {google.cloud.bigquery.v2.IErrorProto|null|undefined} errorResult + * @memberof google.cloud.bigquery.v2.JobStatus + * @instance + */ + JobStatus.prototype.errorResult = null; + + /** + * JobStatus errors. + * @member {Array.} errors + * @memberof google.cloud.bigquery.v2.JobStatus + * @instance + */ + JobStatus.prototype.errors = $util.emptyArray; + + /** + * JobStatus state. + * @member {string} state + * @memberof google.cloud.bigquery.v2.JobStatus + * @instance + */ + JobStatus.prototype.state = ""; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {google.cloud.bigquery.v2.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.bigquery.v2.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {google.cloud.bigquery.v2.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errorResult, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.state); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {google.cloud.bigquery.v2.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JobStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.state = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errorResult, long + 1); + if (error) + return "errorResult." + error; + } + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errors[i], long + 1); + if (error) + return "errors." + error; + } + } + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + if (!$util.isString(message.state)) + return "state: string expected"; + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JobStatus) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JobStatus: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JobStatus(); + if (object.errorResult != null) { + if (!$util.isObject(object.errorResult)) + throw TypeError(".google.cloud.bigquery.v2.JobStatus.errorResult: object expected"); + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errorResult, long + 1); + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.bigquery.v2.JobStatus.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (!$util.isObject(object.errors[i])) + throw TypeError(".google.cloud.bigquery.v2.JobStatus.errors: object expected"); + message.errors[i] = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errors[i], long + 1); + } + } + if (object.state != null) + message.state = String(object.state); + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {google.cloud.bigquery.v2.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) { + object.errorResult = null; + object.state = ""; + } + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + object.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errorResult, options, q + 1); + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errors[j], options, q + 1); + } + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + object.state = message.state; + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JobStatus"; + }; + + return JobStatus; + })(); + + v2.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.bigquery.v2 + * @interface ILocationMetadata + * @property {string|null} [legacyLocationId] LocationMetadata legacyLocationId + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.bigquery.v2.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata legacyLocationId. + * @member {string} legacyLocationId + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @instance + */ + LocationMetadata.prototype.legacyLocationId = ""; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {google.cloud.bigquery.v2.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.bigquery.v2.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {google.cloud.bigquery.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.legacyLocationId != null && Object.hasOwnProperty.call(message, "legacyLocationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.legacyLocationId); + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {google.cloud.bigquery.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.legacyLocationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.legacyLocationId != null && Object.hasOwnProperty.call(message, "legacyLocationId")) + if (!$util.isString(message.legacyLocationId)) + return "legacyLocationId: string expected"; + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.LocationMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.LocationMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.LocationMetadata(); + if (object.legacyLocationId != null) + message.legacyLocationId = String(object.legacyLocationId); + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {google.cloud.bigquery.v2.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.legacyLocationId = ""; + if (message.legacyLocationId != null && Object.hasOwnProperty.call(message, "legacyLocationId")) + object.legacyLocationId = message.legacyLocationId; + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + /** + * ManagedTableType enum. + * @name google.cloud.bigquery.v2.ManagedTableType + * @enum {number} + * @property {number} MANAGED_TABLE_TYPE_UNSPECIFIED=0 MANAGED_TABLE_TYPE_UNSPECIFIED value + * @property {number} NATIVE=1 NATIVE value + * @property {number} BIGLAKE=2 BIGLAKE value + */ + v2.ManagedTableType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGED_TABLE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NATIVE"] = 1; + values[valuesById[2] = "BIGLAKE"] = 2; + return values; + })(); + + v2.PartitioningDefinition = (function() { + + /** + * Properties of a PartitioningDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface IPartitioningDefinition + * @property {Array.|null} [partitionedColumn] PartitioningDefinition partitionedColumn + */ + + /** + * Constructs a new PartitioningDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PartitioningDefinition. + * @implements IPartitioningDefinition + * @constructor + * @param {google.cloud.bigquery.v2.IPartitioningDefinition=} [properties] Properties to set + */ + function PartitioningDefinition(properties) { + this.partitionedColumn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitioningDefinition partitionedColumn. + * @member {Array.} partitionedColumn + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @instance + */ + PartitioningDefinition.prototype.partitionedColumn = $util.emptyArray; + + /** + * Creates a new PartitioningDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {google.cloud.bigquery.v2.IPartitioningDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PartitioningDefinition} PartitioningDefinition instance + */ + PartitioningDefinition.create = function create(properties) { + return new PartitioningDefinition(properties); + }; + + /** + * Encodes the specified PartitioningDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.PartitioningDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {google.cloud.bigquery.v2.IPartitioningDefinition} message PartitioningDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitioningDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.partitionedColumn != null && message.partitionedColumn.length) + for (var i = 0; i < message.partitionedColumn.length; ++i) + $root.google.cloud.bigquery.v2.PartitionedColumn.encode(message.partitionedColumn[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitioningDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitioningDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {google.cloud.bigquery.v2.IPartitioningDefinition} message PartitioningDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitioningDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PartitioningDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PartitioningDefinition} PartitioningDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitioningDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PartitioningDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.partitionedColumn && message.partitionedColumn.length)) + message.partitionedColumn = []; + message.partitionedColumn.push($root.google.cloud.bigquery.v2.PartitionedColumn.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PartitioningDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PartitioningDefinition} PartitioningDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitioningDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitioningDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitioningDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.partitionedColumn != null && Object.hasOwnProperty.call(message, "partitionedColumn")) { + if (!Array.isArray(message.partitionedColumn)) + return "partitionedColumn: array expected"; + for (var i = 0; i < message.partitionedColumn.length; ++i) { + var error = $root.google.cloud.bigquery.v2.PartitionedColumn.verify(message.partitionedColumn[i], long + 1); + if (error) + return "partitionedColumn." + error; + } + } + return null; + }; + + /** + * Creates a PartitioningDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PartitioningDefinition} PartitioningDefinition + */ + PartitioningDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PartitioningDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PartitioningDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PartitioningDefinition(); + if (object.partitionedColumn) { + if (!Array.isArray(object.partitionedColumn)) + throw TypeError(".google.cloud.bigquery.v2.PartitioningDefinition.partitionedColumn: array expected"); + message.partitionedColumn = []; + for (var i = 0; i < object.partitionedColumn.length; ++i) { + if (!$util.isObject(object.partitionedColumn[i])) + throw TypeError(".google.cloud.bigquery.v2.PartitioningDefinition.partitionedColumn: object expected"); + message.partitionedColumn[i] = $root.google.cloud.bigquery.v2.PartitionedColumn.fromObject(object.partitionedColumn[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a PartitioningDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {google.cloud.bigquery.v2.PartitioningDefinition} message PartitioningDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitioningDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.partitionedColumn = []; + if (message.partitionedColumn && message.partitionedColumn.length) { + object.partitionedColumn = []; + for (var j = 0; j < message.partitionedColumn.length; ++j) + object.partitionedColumn[j] = $root.google.cloud.bigquery.v2.PartitionedColumn.toObject(message.partitionedColumn[j], options, q + 1); + } + return object; + }; + + /** + * Converts this PartitioningDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @instance + * @returns {Object.} JSON object + */ + PartitioningDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitioningDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PartitioningDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitioningDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PartitioningDefinition"; + }; + + return PartitioningDefinition; + })(); + + v2.PartitionedColumn = (function() { + + /** + * Properties of a PartitionedColumn. + * @memberof google.cloud.bigquery.v2 + * @interface IPartitionedColumn + * @property {string|null} [field] PartitionedColumn field + */ + + /** + * Constructs a new PartitionedColumn. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PartitionedColumn. + * @implements IPartitionedColumn + * @constructor + * @param {google.cloud.bigquery.v2.IPartitionedColumn=} [properties] Properties to set + */ + function PartitionedColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionedColumn field. + * @member {string|null|undefined} field + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @instance + */ + PartitionedColumn.prototype.field = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PartitionedColumn.prototype, "_field", { + get: $util.oneOfGetter($oneOfFields = ["field"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PartitionedColumn instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {google.cloud.bigquery.v2.IPartitionedColumn=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PartitionedColumn} PartitionedColumn instance + */ + PartitionedColumn.create = function create(properties) { + return new PartitionedColumn(properties); + }; + + /** + * Encodes the specified PartitionedColumn message. Does not implicitly {@link google.cloud.bigquery.v2.PartitionedColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {google.cloud.bigquery.v2.IPartitionedColumn} message PartitionedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedColumn.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + return writer; + }; + + /** + * Encodes the specified PartitionedColumn message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PartitionedColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {google.cloud.bigquery.v2.IPartitionedColumn} message PartitionedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionedColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PartitionedColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PartitionedColumn} PartitionedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedColumn.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PartitionedColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionedColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PartitionedColumn} PartitionedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionedColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionedColumn message. + * @function verify + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionedColumn.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + properties._field = 1; + if (!$util.isString(message.field)) + return "field: string expected"; + } + return null; + }; + + /** + * Creates a PartitionedColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PartitionedColumn} PartitionedColumn + */ + PartitionedColumn.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PartitionedColumn) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PartitionedColumn: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PartitionedColumn(); + if (object.field != null) + message.field = String(object.field); + return message; + }; + + /** + * Creates a plain object from a PartitionedColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {google.cloud.bigquery.v2.PartitionedColumn} message PartitionedColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionedColumn.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + object.field = message.field; + if (options.oneofs) + object._field = "field"; + } + return object; + }; + + /** + * Converts this PartitionedColumn to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @instance + * @returns {Object.} JSON object + */ + PartitionedColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionedColumn + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PartitionedColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionedColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PartitionedColumn"; + }; + + return PartitionedColumn; + })(); + + v2.AggregationThresholdPolicy = (function() { + + /** + * Properties of an AggregationThresholdPolicy. + * @memberof google.cloud.bigquery.v2 + * @interface IAggregationThresholdPolicy + * @property {number|Long|null} [threshold] AggregationThresholdPolicy threshold + * @property {Array.|null} [privacyUnitColumns] AggregationThresholdPolicy privacyUnitColumns + */ + + /** + * Constructs a new AggregationThresholdPolicy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an AggregationThresholdPolicy. + * @implements IAggregationThresholdPolicy + * @constructor + * @param {google.cloud.bigquery.v2.IAggregationThresholdPolicy=} [properties] Properties to set + */ + function AggregationThresholdPolicy(properties) { + this.privacyUnitColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregationThresholdPolicy threshold. + * @member {number|Long|null|undefined} threshold + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @instance + */ + AggregationThresholdPolicy.prototype.threshold = null; + + /** + * AggregationThresholdPolicy privacyUnitColumns. + * @member {Array.} privacyUnitColumns + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @instance + */ + AggregationThresholdPolicy.prototype.privacyUnitColumns = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AggregationThresholdPolicy.prototype, "_threshold", { + get: $util.oneOfGetter($oneOfFields = ["threshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregationThresholdPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {google.cloud.bigquery.v2.IAggregationThresholdPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.AggregationThresholdPolicy} AggregationThresholdPolicy instance + */ + AggregationThresholdPolicy.create = function create(properties) { + return new AggregationThresholdPolicy(properties); + }; + + /** + * Encodes the specified AggregationThresholdPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.AggregationThresholdPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {google.cloud.bigquery.v2.IAggregationThresholdPolicy} message AggregationThresholdPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationThresholdPolicy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.threshold); + if (message.privacyUnitColumns != null && message.privacyUnitColumns.length) + for (var i = 0; i < message.privacyUnitColumns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privacyUnitColumns[i]); + return writer; + }; + + /** + * Encodes the specified AggregationThresholdPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.AggregationThresholdPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {google.cloud.bigquery.v2.IAggregationThresholdPolicy} message AggregationThresholdPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationThresholdPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an AggregationThresholdPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.AggregationThresholdPolicy} AggregationThresholdPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationThresholdPolicy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.AggregationThresholdPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.threshold = reader.int64(); + break; + } + case 2: { + if (!(message.privacyUnitColumns && message.privacyUnitColumns.length)) + message.privacyUnitColumns = []; + message.privacyUnitColumns.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AggregationThresholdPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.AggregationThresholdPolicy} AggregationThresholdPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationThresholdPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregationThresholdPolicy message. + * @function verify + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationThresholdPolicy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) { + properties._threshold = 1; + if (!$util.isInteger(message.threshold) && !(message.threshold && $util.isInteger(message.threshold.low) && $util.isInteger(message.threshold.high))) + return "threshold: integer|Long expected"; + } + if (message.privacyUnitColumns != null && Object.hasOwnProperty.call(message, "privacyUnitColumns")) { + if (!Array.isArray(message.privacyUnitColumns)) + return "privacyUnitColumns: array expected"; + for (var i = 0; i < message.privacyUnitColumns.length; ++i) + if (!$util.isString(message.privacyUnitColumns[i])) + return "privacyUnitColumns: string[] expected"; + } + return null; + }; + + /** + * Creates an AggregationThresholdPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.AggregationThresholdPolicy} AggregationThresholdPolicy + */ + AggregationThresholdPolicy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.AggregationThresholdPolicy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.AggregationThresholdPolicy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.AggregationThresholdPolicy(); + if (object.threshold != null) + if ($util.Long) + message.threshold = $util.Long.fromValue(object.threshold, false); + else if (typeof object.threshold === "string") + message.threshold = parseInt(object.threshold, 10); + else if (typeof object.threshold === "number") + message.threshold = object.threshold; + else if (typeof object.threshold === "object") + message.threshold = new $util.LongBits(object.threshold.low >>> 0, object.threshold.high >>> 0).toNumber(); + if (object.privacyUnitColumns) { + if (!Array.isArray(object.privacyUnitColumns)) + throw TypeError(".google.cloud.bigquery.v2.AggregationThresholdPolicy.privacyUnitColumns: array expected"); + message.privacyUnitColumns = []; + for (var i = 0; i < object.privacyUnitColumns.length; ++i) + message.privacyUnitColumns[i] = String(object.privacyUnitColumns[i]); + } + return message; + }; + + /** + * Creates a plain object from an AggregationThresholdPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {google.cloud.bigquery.v2.AggregationThresholdPolicy} message AggregationThresholdPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationThresholdPolicy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.privacyUnitColumns = []; + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.threshold = typeof message.threshold === "number" ? BigInt(message.threshold) : $util.Long.fromBits(message.threshold.low >>> 0, message.threshold.high >>> 0, false).toBigInt(); + else if (typeof message.threshold === "number") + object.threshold = options.longs === String ? String(message.threshold) : message.threshold; + else + object.threshold = options.longs === String ? $util.Long.prototype.toString.call(message.threshold) : options.longs === Number ? new $util.LongBits(message.threshold.low >>> 0, message.threshold.high >>> 0).toNumber() : message.threshold; + if (options.oneofs) + object._threshold = "threshold"; + } + if (message.privacyUnitColumns && message.privacyUnitColumns.length) { + object.privacyUnitColumns = []; + for (var j = 0; j < message.privacyUnitColumns.length; ++j) + object.privacyUnitColumns[j] = message.privacyUnitColumns[j]; + } + return object; + }; + + /** + * Converts this AggregationThresholdPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @instance + * @returns {Object.} JSON object + */ + AggregationThresholdPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregationThresholdPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.AggregationThresholdPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregationThresholdPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.AggregationThresholdPolicy"; + }; + + return AggregationThresholdPolicy; + })(); + + v2.DifferentialPrivacyPolicy = (function() { + + /** + * Properties of a DifferentialPrivacyPolicy. + * @memberof google.cloud.bigquery.v2 + * @interface IDifferentialPrivacyPolicy + * @property {number|null} [maxEpsilonPerQuery] DifferentialPrivacyPolicy maxEpsilonPerQuery + * @property {number|null} [deltaPerQuery] DifferentialPrivacyPolicy deltaPerQuery + * @property {number|Long|null} [maxGroupsContributed] DifferentialPrivacyPolicy maxGroupsContributed + * @property {string|null} [privacyUnitColumn] DifferentialPrivacyPolicy privacyUnitColumn + * @property {number|null} [epsilonBudget] DifferentialPrivacyPolicy epsilonBudget + * @property {number|null} [deltaBudget] DifferentialPrivacyPolicy deltaBudget + * @property {number|null} [epsilonBudgetRemaining] DifferentialPrivacyPolicy epsilonBudgetRemaining + * @property {number|null} [deltaBudgetRemaining] DifferentialPrivacyPolicy deltaBudgetRemaining + */ + + /** + * Constructs a new DifferentialPrivacyPolicy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DifferentialPrivacyPolicy. + * @implements IDifferentialPrivacyPolicy + * @constructor + * @param {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy=} [properties] Properties to set + */ + function DifferentialPrivacyPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DifferentialPrivacyPolicy maxEpsilonPerQuery. + * @member {number|null|undefined} maxEpsilonPerQuery + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.maxEpsilonPerQuery = null; + + /** + * DifferentialPrivacyPolicy deltaPerQuery. + * @member {number|null|undefined} deltaPerQuery + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.deltaPerQuery = null; + + /** + * DifferentialPrivacyPolicy maxGroupsContributed. + * @member {number|Long|null|undefined} maxGroupsContributed + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.maxGroupsContributed = null; + + /** + * DifferentialPrivacyPolicy privacyUnitColumn. + * @member {string|null|undefined} privacyUnitColumn + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.privacyUnitColumn = null; + + /** + * DifferentialPrivacyPolicy epsilonBudget. + * @member {number|null|undefined} epsilonBudget + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.epsilonBudget = null; + + /** + * DifferentialPrivacyPolicy deltaBudget. + * @member {number|null|undefined} deltaBudget + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.deltaBudget = null; + + /** + * DifferentialPrivacyPolicy epsilonBudgetRemaining. + * @member {number|null|undefined} epsilonBudgetRemaining + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.epsilonBudgetRemaining = null; + + /** + * DifferentialPrivacyPolicy deltaBudgetRemaining. + * @member {number|null|undefined} deltaBudgetRemaining + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + */ + DifferentialPrivacyPolicy.prototype.deltaBudgetRemaining = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_maxEpsilonPerQuery", { + get: $util.oneOfGetter($oneOfFields = ["maxEpsilonPerQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_deltaPerQuery", { + get: $util.oneOfGetter($oneOfFields = ["deltaPerQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_maxGroupsContributed", { + get: $util.oneOfGetter($oneOfFields = ["maxGroupsContributed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_privacyUnitColumn", { + get: $util.oneOfGetter($oneOfFields = ["privacyUnitColumn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_epsilonBudget", { + get: $util.oneOfGetter($oneOfFields = ["epsilonBudget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_deltaBudget", { + get: $util.oneOfGetter($oneOfFields = ["deltaBudget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_epsilonBudgetRemaining", { + get: $util.oneOfGetter($oneOfFields = ["epsilonBudgetRemaining"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DifferentialPrivacyPolicy.prototype, "_deltaBudgetRemaining", { + get: $util.oneOfGetter($oneOfFields = ["deltaBudgetRemaining"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DifferentialPrivacyPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DifferentialPrivacyPolicy} DifferentialPrivacyPolicy instance + */ + DifferentialPrivacyPolicy.create = function create(properties) { + return new DifferentialPrivacyPolicy(properties); + }; + + /** + * Encodes the specified DifferentialPrivacyPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.DifferentialPrivacyPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy} message DifferentialPrivacyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DifferentialPrivacyPolicy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.maxEpsilonPerQuery != null && Object.hasOwnProperty.call(message, "maxEpsilonPerQuery")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.maxEpsilonPerQuery); + if (message.deltaPerQuery != null && Object.hasOwnProperty.call(message, "deltaPerQuery")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.deltaPerQuery); + if (message.maxGroupsContributed != null && Object.hasOwnProperty.call(message, "maxGroupsContributed")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxGroupsContributed); + if (message.privacyUnitColumn != null && Object.hasOwnProperty.call(message, "privacyUnitColumn")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.privacyUnitColumn); + if (message.epsilonBudget != null && Object.hasOwnProperty.call(message, "epsilonBudget")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.epsilonBudget); + if (message.deltaBudget != null && Object.hasOwnProperty.call(message, "deltaBudget")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.deltaBudget); + if (message.epsilonBudgetRemaining != null && Object.hasOwnProperty.call(message, "epsilonBudgetRemaining")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.epsilonBudgetRemaining); + if (message.deltaBudgetRemaining != null && Object.hasOwnProperty.call(message, "deltaBudgetRemaining")) + writer.uint32(/* id 8, wireType 1 =*/65).double(message.deltaBudgetRemaining); + return writer; + }; + + /** + * Encodes the specified DifferentialPrivacyPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DifferentialPrivacyPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy} message DifferentialPrivacyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DifferentialPrivacyPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DifferentialPrivacyPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DifferentialPrivacyPolicy} DifferentialPrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DifferentialPrivacyPolicy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxEpsilonPerQuery = reader.double(); + break; + } + case 2: { + message.deltaPerQuery = reader.double(); + break; + } + case 3: { + message.maxGroupsContributed = reader.int64(); + break; + } + case 4: { + message.privacyUnitColumn = reader.string(); + break; + } + case 5: { + message.epsilonBudget = reader.double(); + break; + } + case 6: { + message.deltaBudget = reader.double(); + break; + } + case 7: { + message.epsilonBudgetRemaining = reader.double(); + break; + } + case 8: { + message.deltaBudgetRemaining = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DifferentialPrivacyPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DifferentialPrivacyPolicy} DifferentialPrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DifferentialPrivacyPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DifferentialPrivacyPolicy message. + * @function verify + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DifferentialPrivacyPolicy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.maxEpsilonPerQuery != null && Object.hasOwnProperty.call(message, "maxEpsilonPerQuery")) { + properties._maxEpsilonPerQuery = 1; + if (typeof message.maxEpsilonPerQuery !== "number") + return "maxEpsilonPerQuery: number expected"; + } + if (message.deltaPerQuery != null && Object.hasOwnProperty.call(message, "deltaPerQuery")) { + properties._deltaPerQuery = 1; + if (typeof message.deltaPerQuery !== "number") + return "deltaPerQuery: number expected"; + } + if (message.maxGroupsContributed != null && Object.hasOwnProperty.call(message, "maxGroupsContributed")) { + properties._maxGroupsContributed = 1; + if (!$util.isInteger(message.maxGroupsContributed) && !(message.maxGroupsContributed && $util.isInteger(message.maxGroupsContributed.low) && $util.isInteger(message.maxGroupsContributed.high))) + return "maxGroupsContributed: integer|Long expected"; + } + if (message.privacyUnitColumn != null && Object.hasOwnProperty.call(message, "privacyUnitColumn")) { + properties._privacyUnitColumn = 1; + if (!$util.isString(message.privacyUnitColumn)) + return "privacyUnitColumn: string expected"; + } + if (message.epsilonBudget != null && Object.hasOwnProperty.call(message, "epsilonBudget")) { + properties._epsilonBudget = 1; + if (typeof message.epsilonBudget !== "number") + return "epsilonBudget: number expected"; + } + if (message.deltaBudget != null && Object.hasOwnProperty.call(message, "deltaBudget")) { + properties._deltaBudget = 1; + if (typeof message.deltaBudget !== "number") + return "deltaBudget: number expected"; + } + if (message.epsilonBudgetRemaining != null && Object.hasOwnProperty.call(message, "epsilonBudgetRemaining")) { + properties._epsilonBudgetRemaining = 1; + if (typeof message.epsilonBudgetRemaining !== "number") + return "epsilonBudgetRemaining: number expected"; + } + if (message.deltaBudgetRemaining != null && Object.hasOwnProperty.call(message, "deltaBudgetRemaining")) { + properties._deltaBudgetRemaining = 1; + if (typeof message.deltaBudgetRemaining !== "number") + return "deltaBudgetRemaining: number expected"; + } + return null; + }; + + /** + * Creates a DifferentialPrivacyPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DifferentialPrivacyPolicy} DifferentialPrivacyPolicy + */ + DifferentialPrivacyPolicy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DifferentialPrivacyPolicy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy(); + if (object.maxEpsilonPerQuery != null) + message.maxEpsilonPerQuery = Number(object.maxEpsilonPerQuery); + if (object.deltaPerQuery != null) + message.deltaPerQuery = Number(object.deltaPerQuery); + if (object.maxGroupsContributed != null) + if ($util.Long) + message.maxGroupsContributed = $util.Long.fromValue(object.maxGroupsContributed, false); + else if (typeof object.maxGroupsContributed === "string") + message.maxGroupsContributed = parseInt(object.maxGroupsContributed, 10); + else if (typeof object.maxGroupsContributed === "number") + message.maxGroupsContributed = object.maxGroupsContributed; + else if (typeof object.maxGroupsContributed === "object") + message.maxGroupsContributed = new $util.LongBits(object.maxGroupsContributed.low >>> 0, object.maxGroupsContributed.high >>> 0).toNumber(); + if (object.privacyUnitColumn != null) + message.privacyUnitColumn = String(object.privacyUnitColumn); + if (object.epsilonBudget != null) + message.epsilonBudget = Number(object.epsilonBudget); + if (object.deltaBudget != null) + message.deltaBudget = Number(object.deltaBudget); + if (object.epsilonBudgetRemaining != null) + message.epsilonBudgetRemaining = Number(object.epsilonBudgetRemaining); + if (object.deltaBudgetRemaining != null) + message.deltaBudgetRemaining = Number(object.deltaBudgetRemaining); + return message; + }; + + /** + * Creates a plain object from a DifferentialPrivacyPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.DifferentialPrivacyPolicy} message DifferentialPrivacyPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DifferentialPrivacyPolicy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.maxEpsilonPerQuery != null && Object.hasOwnProperty.call(message, "maxEpsilonPerQuery")) { + object.maxEpsilonPerQuery = options.json && !isFinite(message.maxEpsilonPerQuery) ? String(message.maxEpsilonPerQuery) : message.maxEpsilonPerQuery; + if (options.oneofs) + object._maxEpsilonPerQuery = "maxEpsilonPerQuery"; + } + if (message.deltaPerQuery != null && Object.hasOwnProperty.call(message, "deltaPerQuery")) { + object.deltaPerQuery = options.json && !isFinite(message.deltaPerQuery) ? String(message.deltaPerQuery) : message.deltaPerQuery; + if (options.oneofs) + object._deltaPerQuery = "deltaPerQuery"; + } + if (message.maxGroupsContributed != null && Object.hasOwnProperty.call(message, "maxGroupsContributed")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxGroupsContributed = typeof message.maxGroupsContributed === "number" ? BigInt(message.maxGroupsContributed) : $util.Long.fromBits(message.maxGroupsContributed.low >>> 0, message.maxGroupsContributed.high >>> 0, false).toBigInt(); + else if (typeof message.maxGroupsContributed === "number") + object.maxGroupsContributed = options.longs === String ? String(message.maxGroupsContributed) : message.maxGroupsContributed; + else + object.maxGroupsContributed = options.longs === String ? $util.Long.prototype.toString.call(message.maxGroupsContributed) : options.longs === Number ? new $util.LongBits(message.maxGroupsContributed.low >>> 0, message.maxGroupsContributed.high >>> 0).toNumber() : message.maxGroupsContributed; + if (options.oneofs) + object._maxGroupsContributed = "maxGroupsContributed"; + } + if (message.privacyUnitColumn != null && Object.hasOwnProperty.call(message, "privacyUnitColumn")) { + object.privacyUnitColumn = message.privacyUnitColumn; + if (options.oneofs) + object._privacyUnitColumn = "privacyUnitColumn"; + } + if (message.epsilonBudget != null && Object.hasOwnProperty.call(message, "epsilonBudget")) { + object.epsilonBudget = options.json && !isFinite(message.epsilonBudget) ? String(message.epsilonBudget) : message.epsilonBudget; + if (options.oneofs) + object._epsilonBudget = "epsilonBudget"; + } + if (message.deltaBudget != null && Object.hasOwnProperty.call(message, "deltaBudget")) { + object.deltaBudget = options.json && !isFinite(message.deltaBudget) ? String(message.deltaBudget) : message.deltaBudget; + if (options.oneofs) + object._deltaBudget = "deltaBudget"; + } + if (message.epsilonBudgetRemaining != null && Object.hasOwnProperty.call(message, "epsilonBudgetRemaining")) { + object.epsilonBudgetRemaining = options.json && !isFinite(message.epsilonBudgetRemaining) ? String(message.epsilonBudgetRemaining) : message.epsilonBudgetRemaining; + if (options.oneofs) + object._epsilonBudgetRemaining = "epsilonBudgetRemaining"; + } + if (message.deltaBudgetRemaining != null && Object.hasOwnProperty.call(message, "deltaBudgetRemaining")) { + object.deltaBudgetRemaining = options.json && !isFinite(message.deltaBudgetRemaining) ? String(message.deltaBudgetRemaining) : message.deltaBudgetRemaining; + if (options.oneofs) + object._deltaBudgetRemaining = "deltaBudgetRemaining"; + } + return object; + }; + + /** + * Converts this DifferentialPrivacyPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @instance + * @returns {Object.} JSON object + */ + DifferentialPrivacyPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DifferentialPrivacyPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DifferentialPrivacyPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DifferentialPrivacyPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DifferentialPrivacyPolicy"; + }; + + return DifferentialPrivacyPolicy; + })(); + + v2.JoinRestrictionPolicy = (function() { + + /** + * Properties of a JoinRestrictionPolicy. + * @memberof google.cloud.bigquery.v2 + * @interface IJoinRestrictionPolicy + * @property {google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|null} [joinCondition] JoinRestrictionPolicy joinCondition + * @property {Array.|null} [joinAllowedColumns] JoinRestrictionPolicy joinAllowedColumns + */ + + /** + * Constructs a new JoinRestrictionPolicy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a JoinRestrictionPolicy. + * @implements IJoinRestrictionPolicy + * @constructor + * @param {google.cloud.bigquery.v2.IJoinRestrictionPolicy=} [properties] Properties to set + */ + function JoinRestrictionPolicy(properties) { + this.joinAllowedColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JoinRestrictionPolicy joinCondition. + * @member {google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition|null|undefined} joinCondition + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @instance + */ + JoinRestrictionPolicy.prototype.joinCondition = null; + + /** + * JoinRestrictionPolicy joinAllowedColumns. + * @member {Array.} joinAllowedColumns + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @instance + */ + JoinRestrictionPolicy.prototype.joinAllowedColumns = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(JoinRestrictionPolicy.prototype, "_joinCondition", { + get: $util.oneOfGetter($oneOfFields = ["joinCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new JoinRestrictionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {google.cloud.bigquery.v2.IJoinRestrictionPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.JoinRestrictionPolicy} JoinRestrictionPolicy instance + */ + JoinRestrictionPolicy.create = function create(properties) { + return new JoinRestrictionPolicy(properties); + }; + + /** + * Encodes the specified JoinRestrictionPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.JoinRestrictionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {google.cloud.bigquery.v2.IJoinRestrictionPolicy} message JoinRestrictionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JoinRestrictionPolicy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.joinCondition != null && Object.hasOwnProperty.call(message, "joinCondition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.joinCondition); + if (message.joinAllowedColumns != null && message.joinAllowedColumns.length) + for (var i = 0; i < message.joinAllowedColumns.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.joinAllowedColumns[i]); + return writer; + }; + + /** + * Encodes the specified JoinRestrictionPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.JoinRestrictionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {google.cloud.bigquery.v2.IJoinRestrictionPolicy} message JoinRestrictionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JoinRestrictionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JoinRestrictionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.JoinRestrictionPolicy} JoinRestrictionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JoinRestrictionPolicy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.JoinRestrictionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.joinCondition = reader.int32(); + break; + } + case 2: { + if (!(message.joinAllowedColumns && message.joinAllowedColumns.length)) + message.joinAllowedColumns = []; + message.joinAllowedColumns.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JoinRestrictionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.JoinRestrictionPolicy} JoinRestrictionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JoinRestrictionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JoinRestrictionPolicy message. + * @function verify + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JoinRestrictionPolicy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.joinCondition != null && Object.hasOwnProperty.call(message, "joinCondition")) { + properties._joinCondition = 1; + switch (message.joinCondition) { + default: + return "joinCondition: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.joinAllowedColumns != null && Object.hasOwnProperty.call(message, "joinAllowedColumns")) { + if (!Array.isArray(message.joinAllowedColumns)) + return "joinAllowedColumns: array expected"; + for (var i = 0; i < message.joinAllowedColumns.length; ++i) + if (!$util.isString(message.joinAllowedColumns[i])) + return "joinAllowedColumns: string[] expected"; + } + return null; + }; + + /** + * Creates a JoinRestrictionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.JoinRestrictionPolicy} JoinRestrictionPolicy + */ + JoinRestrictionPolicy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.JoinRestrictionPolicy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.JoinRestrictionPolicy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.JoinRestrictionPolicy(); + switch (object.joinCondition) { + default: + if (typeof object.joinCondition === "number") { + message.joinCondition = object.joinCondition; + break; + } + break; + case "JOIN_CONDITION_UNSPECIFIED": + case 0: + message.joinCondition = 0; + break; + case "JOIN_ANY": + case 1: + message.joinCondition = 1; + break; + case "JOIN_ALL": + case 2: + message.joinCondition = 2; + break; + case "JOIN_NOT_REQUIRED": + case 3: + message.joinCondition = 3; + break; + case "JOIN_BLOCKED": + case 4: + message.joinCondition = 4; + break; + } + if (object.joinAllowedColumns) { + if (!Array.isArray(object.joinAllowedColumns)) + throw TypeError(".google.cloud.bigquery.v2.JoinRestrictionPolicy.joinAllowedColumns: array expected"); + message.joinAllowedColumns = []; + for (var i = 0; i < object.joinAllowedColumns.length; ++i) + message.joinAllowedColumns[i] = String(object.joinAllowedColumns[i]); + } + return message; + }; + + /** + * Creates a plain object from a JoinRestrictionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {google.cloud.bigquery.v2.JoinRestrictionPolicy} message JoinRestrictionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JoinRestrictionPolicy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.joinAllowedColumns = []; + if (message.joinCondition != null && Object.hasOwnProperty.call(message, "joinCondition")) { + object.joinCondition = options.enums === String ? $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition[message.joinCondition] === undefined ? message.joinCondition : $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition[message.joinCondition] : message.joinCondition; + if (options.oneofs) + object._joinCondition = "joinCondition"; + } + if (message.joinAllowedColumns && message.joinAllowedColumns.length) { + object.joinAllowedColumns = []; + for (var j = 0; j < message.joinAllowedColumns.length; ++j) + object.joinAllowedColumns[j] = message.joinAllowedColumns[j]; + } + return object; + }; + + /** + * Converts this JoinRestrictionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @instance + * @returns {Object.} JSON object + */ + JoinRestrictionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JoinRestrictionPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.JoinRestrictionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JoinRestrictionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.JoinRestrictionPolicy"; + }; + + /** + * JoinCondition enum. + * @name google.cloud.bigquery.v2.JoinRestrictionPolicy.JoinCondition + * @enum {number} + * @property {number} JOIN_CONDITION_UNSPECIFIED=0 JOIN_CONDITION_UNSPECIFIED value + * @property {number} JOIN_ANY=1 JOIN_ANY value + * @property {number} JOIN_ALL=2 JOIN_ALL value + * @property {number} JOIN_NOT_REQUIRED=3 JOIN_NOT_REQUIRED value + * @property {number} JOIN_BLOCKED=4 JOIN_BLOCKED value + */ + JoinRestrictionPolicy.JoinCondition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOIN_CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOIN_ANY"] = 1; + values[valuesById[2] = "JOIN_ALL"] = 2; + values[valuesById[3] = "JOIN_NOT_REQUIRED"] = 3; + values[valuesById[4] = "JOIN_BLOCKED"] = 4; + return values; + })(); + + return JoinRestrictionPolicy; + })(); + + v2.PrivacyPolicy = (function() { + + /** + * Properties of a PrivacyPolicy. + * @memberof google.cloud.bigquery.v2 + * @interface IPrivacyPolicy + * @property {google.cloud.bigquery.v2.IAggregationThresholdPolicy|null} [aggregationThresholdPolicy] PrivacyPolicy aggregationThresholdPolicy + * @property {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy|null} [differentialPrivacyPolicy] PrivacyPolicy differentialPrivacyPolicy + * @property {google.cloud.bigquery.v2.IJoinRestrictionPolicy|null} [joinRestrictionPolicy] PrivacyPolicy joinRestrictionPolicy + */ + + /** + * Constructs a new PrivacyPolicy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PrivacyPolicy. + * @implements IPrivacyPolicy + * @constructor + * @param {google.cloud.bigquery.v2.IPrivacyPolicy=} [properties] Properties to set + */ + function PrivacyPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivacyPolicy aggregationThresholdPolicy. + * @member {google.cloud.bigquery.v2.IAggregationThresholdPolicy|null|undefined} aggregationThresholdPolicy + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @instance + */ + PrivacyPolicy.prototype.aggregationThresholdPolicy = null; + + /** + * PrivacyPolicy differentialPrivacyPolicy. + * @member {google.cloud.bigquery.v2.IDifferentialPrivacyPolicy|null|undefined} differentialPrivacyPolicy + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @instance + */ + PrivacyPolicy.prototype.differentialPrivacyPolicy = null; + + /** + * PrivacyPolicy joinRestrictionPolicy. + * @member {google.cloud.bigquery.v2.IJoinRestrictionPolicy|null|undefined} joinRestrictionPolicy + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @instance + */ + PrivacyPolicy.prototype.joinRestrictionPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrivacyPolicy privacyPolicy. + * @member {"aggregationThresholdPolicy"|"differentialPrivacyPolicy"|undefined} privacyPolicy + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @instance + */ + Object.defineProperty(PrivacyPolicy.prototype, "privacyPolicy", { + get: $util.oneOfGetter($oneOfFields = ["aggregationThresholdPolicy", "differentialPrivacyPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PrivacyPolicy.prototype, "_joinRestrictionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["joinRestrictionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrivacyPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IPrivacyPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PrivacyPolicy} PrivacyPolicy instance + */ + PrivacyPolicy.create = function create(properties) { + return new PrivacyPolicy(properties); + }; + + /** + * Encodes the specified PrivacyPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.PrivacyPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IPrivacyPolicy} message PrivacyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivacyPolicy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.joinRestrictionPolicy != null && Object.hasOwnProperty.call(message, "joinRestrictionPolicy")) + $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.encode(message.joinRestrictionPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.aggregationThresholdPolicy != null && Object.hasOwnProperty.call(message, "aggregationThresholdPolicy")) + $root.google.cloud.bigquery.v2.AggregationThresholdPolicy.encode(message.aggregationThresholdPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.differentialPrivacyPolicy != null && Object.hasOwnProperty.call(message, "differentialPrivacyPolicy")) + $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy.encode(message.differentialPrivacyPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivacyPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PrivacyPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.IPrivacyPolicy} message PrivacyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivacyPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PrivacyPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PrivacyPolicy} PrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivacyPolicy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PrivacyPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.aggregationThresholdPolicy = $root.google.cloud.bigquery.v2.AggregationThresholdPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.differentialPrivacyPolicy = $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1: { + message.joinRestrictionPolicy = $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PrivacyPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PrivacyPolicy} PrivacyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivacyPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivacyPolicy message. + * @function verify + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivacyPolicy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.aggregationThresholdPolicy != null && Object.hasOwnProperty.call(message, "aggregationThresholdPolicy")) { + properties.privacyPolicy = 1; + { + var error = $root.google.cloud.bigquery.v2.AggregationThresholdPolicy.verify(message.aggregationThresholdPolicy, long + 1); + if (error) + return "aggregationThresholdPolicy." + error; + } + } + if (message.differentialPrivacyPolicy != null && Object.hasOwnProperty.call(message, "differentialPrivacyPolicy")) { + if (properties.privacyPolicy === 1) + return "privacyPolicy: multiple values"; + properties.privacyPolicy = 1; + { + var error = $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy.verify(message.differentialPrivacyPolicy, long + 1); + if (error) + return "differentialPrivacyPolicy." + error; + } + } + if (message.joinRestrictionPolicy != null && Object.hasOwnProperty.call(message, "joinRestrictionPolicy")) { + properties._joinRestrictionPolicy = 1; + { + var error = $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.verify(message.joinRestrictionPolicy, long + 1); + if (error) + return "joinRestrictionPolicy." + error; + } + } + return null; + }; + + /** + * Creates a PrivacyPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PrivacyPolicy} PrivacyPolicy + */ + PrivacyPolicy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PrivacyPolicy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PrivacyPolicy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PrivacyPolicy(); + if (object.aggregationThresholdPolicy != null) { + if (!$util.isObject(object.aggregationThresholdPolicy)) + throw TypeError(".google.cloud.bigquery.v2.PrivacyPolicy.aggregationThresholdPolicy: object expected"); + message.aggregationThresholdPolicy = $root.google.cloud.bigquery.v2.AggregationThresholdPolicy.fromObject(object.aggregationThresholdPolicy, long + 1); + } + if (object.differentialPrivacyPolicy != null) { + if (!$util.isObject(object.differentialPrivacyPolicy)) + throw TypeError(".google.cloud.bigquery.v2.PrivacyPolicy.differentialPrivacyPolicy: object expected"); + message.differentialPrivacyPolicy = $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy.fromObject(object.differentialPrivacyPolicy, long + 1); + } + if (object.joinRestrictionPolicy != null) { + if (!$util.isObject(object.joinRestrictionPolicy)) + throw TypeError(".google.cloud.bigquery.v2.PrivacyPolicy.joinRestrictionPolicy: object expected"); + message.joinRestrictionPolicy = $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.fromObject(object.joinRestrictionPolicy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PrivacyPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {google.cloud.bigquery.v2.PrivacyPolicy} message PrivacyPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivacyPolicy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.joinRestrictionPolicy != null && Object.hasOwnProperty.call(message, "joinRestrictionPolicy")) { + object.joinRestrictionPolicy = $root.google.cloud.bigquery.v2.JoinRestrictionPolicy.toObject(message.joinRestrictionPolicy, options, q + 1); + if (options.oneofs) + object._joinRestrictionPolicy = "joinRestrictionPolicy"; + } + if (message.aggregationThresholdPolicy != null && Object.hasOwnProperty.call(message, "aggregationThresholdPolicy")) { + object.aggregationThresholdPolicy = $root.google.cloud.bigquery.v2.AggregationThresholdPolicy.toObject(message.aggregationThresholdPolicy, options, q + 1); + if (options.oneofs) + object.privacyPolicy = "aggregationThresholdPolicy"; + } + if (message.differentialPrivacyPolicy != null && Object.hasOwnProperty.call(message, "differentialPrivacyPolicy")) { + object.differentialPrivacyPolicy = $root.google.cloud.bigquery.v2.DifferentialPrivacyPolicy.toObject(message.differentialPrivacyPolicy, options, q + 1); + if (options.oneofs) + object.privacyPolicy = "differentialPrivacyPolicy"; + } + return object; + }; + + /** + * Converts this PrivacyPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @instance + * @returns {Object.} JSON object + */ + PrivacyPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivacyPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PrivacyPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivacyPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PrivacyPolicy"; + }; + + return PrivacyPolicy; + })(); + + v2.ProjectService = (function() { + + /** + * Constructs a new ProjectService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ProjectService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ProjectService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProjectService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProjectService; + + /** + * Creates new ProjectService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.ProjectService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ProjectService} RPC service. Useful where requests and/or responses are streamed. + */ + ProjectService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.ProjectService|getServiceAccount}. + * @memberof google.cloud.bigquery.v2.ProjectService + * @typedef GetServiceAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.GetServiceAccountResponse} [response] GetServiceAccountResponse + */ + + /** + * Calls GetServiceAccount. + * @function getServiceAccount + * @memberof google.cloud.bigquery.v2.ProjectService + * @instance + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest} request GetServiceAccountRequest message or plain object + * @param {google.cloud.bigquery.v2.ProjectService.GetServiceAccountCallback} callback Node-style callback called with the error, if any, and GetServiceAccountResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.getServiceAccount = function getServiceAccount(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getServiceAccount, $root.google.cloud.bigquery.v2.GetServiceAccountRequest, $root.google.cloud.bigquery.v2.GetServiceAccountResponse, request, callback); + }, "name", { value: "GetServiceAccount" }); + + /** + * Calls GetServiceAccount. + * @function getServiceAccount + * @memberof google.cloud.bigquery.v2.ProjectService + * @instance + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest} request GetServiceAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProjectService; + })(); + + v2.GetServiceAccountRequest = (function() { + + /** + * Properties of a GetServiceAccountRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetServiceAccountRequest + * @property {string|null} [projectId] GetServiceAccountRequest projectId + */ + + /** + * Constructs a new GetServiceAccountRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetServiceAccountRequest. + * @implements IGetServiceAccountRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest=} [properties] Properties to set + */ + function GetServiceAccountRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceAccountRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @instance + */ + GetServiceAccountRequest.prototype.projectId = ""; + + /** + * Creates a new GetServiceAccountRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetServiceAccountRequest} GetServiceAccountRequest instance + */ + GetServiceAccountRequest.create = function create(properties) { + return new GetServiceAccountRequest(properties); + }; + + /** + * Encodes the specified GetServiceAccountRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest} message GetServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceAccountRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified GetServiceAccountRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountRequest} message GetServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetServiceAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetServiceAccountRequest} GetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceAccountRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetServiceAccountRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetServiceAccountRequest} GetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceAccountRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceAccountRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a GetServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetServiceAccountRequest} GetServiceAccountRequest + */ + GetServiceAccountRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetServiceAccountRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetServiceAccountRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetServiceAccountRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a GetServiceAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {google.cloud.bigquery.v2.GetServiceAccountRequest} message GetServiceAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceAccountRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.projectId = ""; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this GetServiceAccountRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceAccountRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetServiceAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetServiceAccountRequest"; + }; + + return GetServiceAccountRequest; + })(); + + v2.GetServiceAccountResponse = (function() { + + /** + * Properties of a GetServiceAccountResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IGetServiceAccountResponse + * @property {string|null} [kind] GetServiceAccountResponse kind + * @property {string|null} [email] GetServiceAccountResponse email + */ + + /** + * Constructs a new GetServiceAccountResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetServiceAccountResponse. + * @implements IGetServiceAccountResponse + * @constructor + * @param {google.cloud.bigquery.v2.IGetServiceAccountResponse=} [properties] Properties to set + */ + function GetServiceAccountResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceAccountResponse kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @instance + */ + GetServiceAccountResponse.prototype.kind = ""; + + /** + * GetServiceAccountResponse email. + * @member {string} email + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @instance + */ + GetServiceAccountResponse.prototype.email = ""; + + /** + * Creates a new GetServiceAccountResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetServiceAccountResponse} GetServiceAccountResponse instance + */ + GetServiceAccountResponse.create = function create(properties) { + return new GetServiceAccountResponse(properties); + }; + + /** + * Encodes the specified GetServiceAccountResponse message. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountResponse} message GetServiceAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceAccountResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + return writer; + }; + + /** + * Encodes the specified GetServiceAccountResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetServiceAccountResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {google.cloud.bigquery.v2.IGetServiceAccountResponse} message GetServiceAccountResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceAccountResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetServiceAccountResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetServiceAccountResponse} GetServiceAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceAccountResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetServiceAccountResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceAccountResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetServiceAccountResponse} GetServiceAccountResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceAccountResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceAccountResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceAccountResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + if (!$util.isString(message.email)) + return "email: string expected"; + return null; + }; + + /** + * Creates a GetServiceAccountResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetServiceAccountResponse} GetServiceAccountResponse + */ + GetServiceAccountResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetServiceAccountResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetServiceAccountResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetServiceAccountResponse(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.email != null) + message.email = String(object.email); + return message; + }; + + /** + * Creates a plain object from a GetServiceAccountResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {google.cloud.bigquery.v2.GetServiceAccountResponse} message GetServiceAccountResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceAccountResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.kind = ""; + object.email = ""; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + object.email = message.email; + return object; + }; + + /** + * Converts this GetServiceAccountResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @instance + * @returns {Object.} JSON object + */ + GetServiceAccountResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceAccountResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetServiceAccountResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceAccountResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetServiceAccountResponse"; + }; + + return GetServiceAccountResponse; + })(); + + v2.RoutineService = (function() { + + /** + * Constructs a new RoutineService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RoutineService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function RoutineService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RoutineService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RoutineService; + + /** + * Creates new RoutineService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.RoutineService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {RoutineService} RPC service. Useful where requests and/or responses are streamed. + */ + RoutineService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|getRoutine}. + * @memberof google.cloud.bigquery.v2.RoutineService + * @typedef GetRoutineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Routine} [response] Routine + */ + + /** + * Calls GetRoutine. + * @function getRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IGetRoutineRequest} request GetRoutineRequest message or plain object + * @param {google.cloud.bigquery.v2.RoutineService.GetRoutineCallback} callback Node-style callback called with the error, if any, and Routine + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RoutineService.prototype.getRoutine = function getRoutine(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getRoutine, $root.google.cloud.bigquery.v2.GetRoutineRequest, $root.google.cloud.bigquery.v2.Routine, request, callback); + }, "name", { value: "GetRoutine" }); + + /** + * Calls GetRoutine. + * @function getRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IGetRoutineRequest} request GetRoutineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|insertRoutine}. + * @memberof google.cloud.bigquery.v2.RoutineService + * @typedef InsertRoutineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Routine} [response] Routine + */ + + /** + * Calls InsertRoutine. + * @function insertRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest} request InsertRoutineRequest message or plain object + * @param {google.cloud.bigquery.v2.RoutineService.InsertRoutineCallback} callback Node-style callback called with the error, if any, and Routine + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RoutineService.prototype.insertRoutine = function insertRoutine(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insertRoutine, $root.google.cloud.bigquery.v2.InsertRoutineRequest, $root.google.cloud.bigquery.v2.Routine, request, callback); + }, "name", { value: "InsertRoutine" }); + + /** + * Calls InsertRoutine. + * @function insertRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest} request InsertRoutineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|updateRoutine}. + * @memberof google.cloud.bigquery.v2.RoutineService + * @typedef UpdateRoutineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Routine} [response] Routine + */ + + /** + * Calls UpdateRoutine. + * @function updateRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest} request UpdateRoutineRequest message or plain object + * @param {google.cloud.bigquery.v2.RoutineService.UpdateRoutineCallback} callback Node-style callback called with the error, if any, and Routine + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RoutineService.prototype.updateRoutine = function updateRoutine(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateRoutine, $root.google.cloud.bigquery.v2.UpdateRoutineRequest, $root.google.cloud.bigquery.v2.Routine, request, callback); + }, "name", { value: "UpdateRoutine" }); + + /** + * Calls UpdateRoutine. + * @function updateRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest} request UpdateRoutineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|deleteRoutine}. + * @memberof google.cloud.bigquery.v2.RoutineService + * @typedef DeleteRoutineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRoutine. + * @function deleteRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest} request DeleteRoutineRequest message or plain object + * @param {google.cloud.bigquery.v2.RoutineService.DeleteRoutineCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RoutineService.prototype.deleteRoutine = function deleteRoutine(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteRoutine, $root.google.cloud.bigquery.v2.DeleteRoutineRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRoutine" }); + + /** + * Calls DeleteRoutine. + * @function deleteRoutine + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest} request DeleteRoutineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RoutineService|listRoutines}. + * @memberof google.cloud.bigquery.v2.RoutineService + * @typedef ListRoutinesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.ListRoutinesResponse} [response] ListRoutinesResponse + */ + + /** + * Calls ListRoutines. + * @function listRoutines + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IListRoutinesRequest} request ListRoutinesRequest message or plain object + * @param {google.cloud.bigquery.v2.RoutineService.ListRoutinesCallback} callback Node-style callback called with the error, if any, and ListRoutinesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RoutineService.prototype.listRoutines = function listRoutines(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listRoutines, $root.google.cloud.bigquery.v2.ListRoutinesRequest, $root.google.cloud.bigquery.v2.ListRoutinesResponse, request, callback); + }, "name", { value: "ListRoutines" }); + + /** + * Calls ListRoutines. + * @function listRoutines + * @memberof google.cloud.bigquery.v2.RoutineService + * @instance + * @param {google.cloud.bigquery.v2.IListRoutinesRequest} request ListRoutinesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RoutineService; + })(); + + v2.Routine = (function() { + + /** + * Properties of a Routine. + * @memberof google.cloud.bigquery.v2 + * @interface IRoutine + * @property {string|null} [etag] Routine etag + * @property {google.cloud.bigquery.v2.IRoutineReference|null} [routineReference] Routine routineReference + * @property {google.cloud.bigquery.v2.Routine.RoutineType|null} [routineType] Routine routineType + * @property {number|Long|null} [creationTime] Routine creationTime + * @property {number|Long|null} [lastModifiedTime] Routine lastModifiedTime + * @property {google.cloud.bigquery.v2.Routine.Language|null} [language] Routine language + * @property {Array.|null} ["arguments"] Routine arguments + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [returnType] Routine returnType + * @property {google.cloud.bigquery.v2.IStandardSqlTableType|null} [returnTableType] Routine returnTableType + * @property {Array.|null} [importedLibraries] Routine importedLibraries + * @property {string|null} [definitionBody] Routine definitionBody + * @property {string|null} [description] Routine description + * @property {google.cloud.bigquery.v2.Routine.DeterminismLevel|null} [determinismLevel] Routine determinismLevel + * @property {google.cloud.bigquery.v2.Routine.SecurityMode|null} [securityMode] Routine securityMode + * @property {google.protobuf.IBoolValue|null} [strictMode] Routine strictMode + * @property {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions|null} [remoteFunctionOptions] Routine remoteFunctionOptions + * @property {google.cloud.bigquery.v2.ISparkOptions|null} [sparkOptions] Routine sparkOptions + * @property {google.cloud.bigquery.v2.Routine.DataGovernanceType|null} [dataGovernanceType] Routine dataGovernanceType + * @property {google.cloud.bigquery.v2.IPythonOptions|null} [pythonOptions] Routine pythonOptions + * @property {google.cloud.bigquery.v2.IExternalRuntimeOptions|null} [externalRuntimeOptions] Routine externalRuntimeOptions + * @property {google.cloud.bigquery.v2.IRoutineBuildStatus|null} [buildStatus] Routine buildStatus + */ + + /** + * Constructs a new Routine. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Routine. + * @implements IRoutine + * @constructor + * @param {google.cloud.bigquery.v2.IRoutine=} [properties] Properties to set + */ + function Routine(properties) { + this["arguments"] = []; + this.importedLibraries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Routine etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.etag = ""; + + /** + * Routine routineReference. + * @member {google.cloud.bigquery.v2.IRoutineReference|null|undefined} routineReference + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.routineReference = null; + + /** + * Routine routineType. + * @member {google.cloud.bigquery.v2.Routine.RoutineType} routineType + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.routineType = 0; + + /** + * Routine creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Routine lastModifiedTime. + * @member {number|Long} lastModifiedTime + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.lastModifiedTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Routine language. + * @member {google.cloud.bigquery.v2.Routine.Language} language + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.language = 0; + + /** + * Routine arguments. + * @member {Array.} arguments + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype["arguments"] = $util.emptyArray; + + /** + * Routine returnType. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} returnType + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.returnType = null; + + /** + * Routine returnTableType. + * @member {google.cloud.bigquery.v2.IStandardSqlTableType|null|undefined} returnTableType + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.returnTableType = null; + + /** + * Routine importedLibraries. + * @member {Array.} importedLibraries + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.importedLibraries = $util.emptyArray; + + /** + * Routine definitionBody. + * @member {string} definitionBody + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.definitionBody = ""; + + /** + * Routine description. + * @member {string} description + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.description = ""; + + /** + * Routine determinismLevel. + * @member {google.cloud.bigquery.v2.Routine.DeterminismLevel} determinismLevel + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.determinismLevel = 0; + + /** + * Routine securityMode. + * @member {google.cloud.bigquery.v2.Routine.SecurityMode} securityMode + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.securityMode = 0; + + /** + * Routine strictMode. + * @member {google.protobuf.IBoolValue|null|undefined} strictMode + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.strictMode = null; + + /** + * Routine remoteFunctionOptions. + * @member {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions|null|undefined} remoteFunctionOptions + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.remoteFunctionOptions = null; + + /** + * Routine sparkOptions. + * @member {google.cloud.bigquery.v2.ISparkOptions|null|undefined} sparkOptions + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.sparkOptions = null; + + /** + * Routine dataGovernanceType. + * @member {google.cloud.bigquery.v2.Routine.DataGovernanceType} dataGovernanceType + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.dataGovernanceType = 0; + + /** + * Routine pythonOptions. + * @member {google.cloud.bigquery.v2.IPythonOptions|null|undefined} pythonOptions + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.pythonOptions = null; + + /** + * Routine externalRuntimeOptions. + * @member {google.cloud.bigquery.v2.IExternalRuntimeOptions|null|undefined} externalRuntimeOptions + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.externalRuntimeOptions = null; + + /** + * Routine buildStatus. + * @member {google.cloud.bigquery.v2.IRoutineBuildStatus|null|undefined} buildStatus + * @memberof google.cloud.bigquery.v2.Routine + * @instance + */ + Routine.prototype.buildStatus = null; + + /** + * Creates a new Routine instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {google.cloud.bigquery.v2.IRoutine=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Routine} Routine instance + */ + Routine.create = function create(properties) { + return new Routine(properties); + }; + + /** + * Encodes the specified Routine message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {google.cloud.bigquery.v2.IRoutine} message Routine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Routine.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.etag); + if (message.routineReference != null && Object.hasOwnProperty.call(message, "routineReference")) + $root.google.cloud.bigquery.v2.RoutineReference.encode(message.routineReference, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.routineType != null && Object.hasOwnProperty.call(message, "routineType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.routineType); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.creationTime); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.lastModifiedTime); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.language); + if (message["arguments"] != null && message["arguments"].length) + for (var i = 0; i < message["arguments"].length; ++i) + $root.google.cloud.bigquery.v2.Routine.Argument.encode(message["arguments"][i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.importedLibraries != null && message.importedLibraries.length) + for (var i = 0; i < message.importedLibraries.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.importedLibraries[i]); + if (message.definitionBody != null && Object.hasOwnProperty.call(message, "definitionBody")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.definitionBody); + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.returnType, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.determinismLevel != null && Object.hasOwnProperty.call(message, "determinismLevel")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.determinismLevel); + if (message.returnTableType != null && Object.hasOwnProperty.call(message, "returnTableType")) + $root.google.cloud.bigquery.v2.StandardSqlTableType.encode(message.returnTableType, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.strictMode != null && Object.hasOwnProperty.call(message, "strictMode")) + $root.google.protobuf.BoolValue.encode(message.strictMode, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.remoteFunctionOptions != null && Object.hasOwnProperty.call(message, "remoteFunctionOptions")) + $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.encode(message.remoteFunctionOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.sparkOptions != null && Object.hasOwnProperty.call(message, "sparkOptions")) + $root.google.cloud.bigquery.v2.SparkOptions.encode(message.sparkOptions, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.dataGovernanceType != null && Object.hasOwnProperty.call(message, "dataGovernanceType")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.dataGovernanceType); + if (message.securityMode != null && Object.hasOwnProperty.call(message, "securityMode")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.securityMode); + if (message.pythonOptions != null && Object.hasOwnProperty.call(message, "pythonOptions")) + $root.google.cloud.bigquery.v2.PythonOptions.encode(message.pythonOptions, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.externalRuntimeOptions != null && Object.hasOwnProperty.call(message, "externalRuntimeOptions")) + $root.google.cloud.bigquery.v2.ExternalRuntimeOptions.encode(message.externalRuntimeOptions, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.buildStatus != null && Object.hasOwnProperty.call(message, "buildStatus")) + $root.google.cloud.bigquery.v2.RoutineBuildStatus.encode(message.buildStatus, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Routine message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {google.cloud.bigquery.v2.IRoutine} message Routine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Routine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Routine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Routine} Routine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Routine.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Routine(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.etag = reader.string(); + break; + } + case 2: { + message.routineReference = $root.google.cloud.bigquery.v2.RoutineReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.routineType = reader.int32(); + break; + } + case 4: { + message.creationTime = reader.int64(); + break; + } + case 5: { + message.lastModifiedTime = reader.int64(); + break; + } + case 6: { + message.language = reader.int32(); + break; + } + case 7: { + if (!(message["arguments"] && message["arguments"].length)) + message["arguments"] = []; + message["arguments"].push($root.google.cloud.bigquery.v2.Routine.Argument.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + message.returnType = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.returnTableType = $root.google.cloud.bigquery.v2.StandardSqlTableType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + if (!(message.importedLibraries && message.importedLibraries.length)) + message.importedLibraries = []; + message.importedLibraries.push(reader.string()); + break; + } + case 9: { + message.definitionBody = reader.string(); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 12: { + message.determinismLevel = reader.int32(); + break; + } + case 18: { + message.securityMode = reader.int32(); + break; + } + case 14: { + message.strictMode = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 15: { + message.remoteFunctionOptions = $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.sparkOptions = $root.google.cloud.bigquery.v2.SparkOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.dataGovernanceType = reader.int32(); + break; + } + case 20: { + message.pythonOptions = $root.google.cloud.bigquery.v2.PythonOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 21: { + message.externalRuntimeOptions = $root.google.cloud.bigquery.v2.ExternalRuntimeOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.buildStatus = $root.google.cloud.bigquery.v2.RoutineBuildStatus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Routine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Routine} Routine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Routine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Routine message. + * @function verify + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Routine.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.routineReference != null && Object.hasOwnProperty.call(message, "routineReference")) { + var error = $root.google.cloud.bigquery.v2.RoutineReference.verify(message.routineReference, long + 1); + if (error) + return "routineReference." + error; + } + if (message.routineType != null && Object.hasOwnProperty.call(message, "routineType")) + switch (message.routineType) { + default: + return "routineType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (!$util.isInteger(message.lastModifiedTime) && !(message.lastModifiedTime && $util.isInteger(message.lastModifiedTime.low) && $util.isInteger(message.lastModifiedTime.high))) + return "lastModifiedTime: integer|Long expected"; + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + switch (message.language) { + default: + return "language: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message["arguments"] != null && Object.hasOwnProperty.call(message, "arguments")) { + if (!Array.isArray(message["arguments"])) + return "arguments: array expected"; + for (var i = 0; i < message["arguments"].length; ++i) { + var error = $root.google.cloud.bigquery.v2.Routine.Argument.verify(message["arguments"][i], long + 1); + if (error) + return "arguments." + error; + } + } + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.returnType, long + 1); + if (error) + return "returnType." + error; + } + if (message.returnTableType != null && Object.hasOwnProperty.call(message, "returnTableType")) { + var error = $root.google.cloud.bigquery.v2.StandardSqlTableType.verify(message.returnTableType, long + 1); + if (error) + return "returnTableType." + error; + } + if (message.importedLibraries != null && Object.hasOwnProperty.call(message, "importedLibraries")) { + if (!Array.isArray(message.importedLibraries)) + return "importedLibraries: array expected"; + for (var i = 0; i < message.importedLibraries.length; ++i) + if (!$util.isString(message.importedLibraries[i])) + return "importedLibraries: string[] expected"; + } + if (message.definitionBody != null && Object.hasOwnProperty.call(message, "definitionBody")) + if (!$util.isString(message.definitionBody)) + return "definitionBody: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.determinismLevel != null && Object.hasOwnProperty.call(message, "determinismLevel")) + switch (message.determinismLevel) { + default: + return "determinismLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.securityMode != null && Object.hasOwnProperty.call(message, "securityMode")) + switch (message.securityMode) { + default: + return "securityMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.strictMode != null && Object.hasOwnProperty.call(message, "strictMode")) { + var error = $root.google.protobuf.BoolValue.verify(message.strictMode, long + 1); + if (error) + return "strictMode." + error; + } + if (message.remoteFunctionOptions != null && Object.hasOwnProperty.call(message, "remoteFunctionOptions")) { + var error = $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.verify(message.remoteFunctionOptions, long + 1); + if (error) + return "remoteFunctionOptions." + error; + } + if (message.sparkOptions != null && Object.hasOwnProperty.call(message, "sparkOptions")) { + var error = $root.google.cloud.bigquery.v2.SparkOptions.verify(message.sparkOptions, long + 1); + if (error) + return "sparkOptions." + error; + } + if (message.dataGovernanceType != null && Object.hasOwnProperty.call(message, "dataGovernanceType")) + switch (message.dataGovernanceType) { + default: + return "dataGovernanceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.pythonOptions != null && Object.hasOwnProperty.call(message, "pythonOptions")) { + var error = $root.google.cloud.bigquery.v2.PythonOptions.verify(message.pythonOptions, long + 1); + if (error) + return "pythonOptions." + error; + } + if (message.externalRuntimeOptions != null && Object.hasOwnProperty.call(message, "externalRuntimeOptions")) { + var error = $root.google.cloud.bigquery.v2.ExternalRuntimeOptions.verify(message.externalRuntimeOptions, long + 1); + if (error) + return "externalRuntimeOptions." + error; + } + if (message.buildStatus != null && Object.hasOwnProperty.call(message, "buildStatus")) { + var error = $root.google.cloud.bigquery.v2.RoutineBuildStatus.verify(message.buildStatus, long + 1); + if (error) + return "buildStatus." + error; + } + return null; + }; + + /** + * Creates a Routine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Routine} Routine + */ + Routine.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Routine) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Routine: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Routine(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.routineReference != null) { + if (!$util.isObject(object.routineReference)) + throw TypeError(".google.cloud.bigquery.v2.Routine.routineReference: object expected"); + message.routineReference = $root.google.cloud.bigquery.v2.RoutineReference.fromObject(object.routineReference, long + 1); + } + switch (object.routineType) { + default: + if (typeof object.routineType === "number") { + message.routineType = object.routineType; + break; + } + break; + case "ROUTINE_TYPE_UNSPECIFIED": + case 0: + message.routineType = 0; + break; + case "SCALAR_FUNCTION": + case 1: + message.routineType = 1; + break; + case "PROCEDURE": + case 2: + message.routineType = 2; + break; + case "TABLE_VALUED_FUNCTION": + case 3: + message.routineType = 3; + break; + case "AGGREGATE_FUNCTION": + case 4: + message.routineType = 4; + break; + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.lastModifiedTime != null) + if ($util.Long) + message.lastModifiedTime = $util.Long.fromValue(object.lastModifiedTime, false); + else if (typeof object.lastModifiedTime === "string") + message.lastModifiedTime = parseInt(object.lastModifiedTime, 10); + else if (typeof object.lastModifiedTime === "number") + message.lastModifiedTime = object.lastModifiedTime; + else if (typeof object.lastModifiedTime === "object") + message.lastModifiedTime = new $util.LongBits(object.lastModifiedTime.low >>> 0, object.lastModifiedTime.high >>> 0).toNumber(); + switch (object.language) { + default: + if (typeof object.language === "number") { + message.language = object.language; + break; + } + break; + case "LANGUAGE_UNSPECIFIED": + case 0: + message.language = 0; + break; + case "SQL": + case 1: + message.language = 1; + break; + case "JAVASCRIPT": + case 2: + message.language = 2; + break; + case "PYTHON": + case 3: + message.language = 3; + break; + case "JAVA": + case 4: + message.language = 4; + break; + case "SCALA": + case 5: + message.language = 5; + break; + } + if (object["arguments"]) { + if (!Array.isArray(object["arguments"])) + throw TypeError(".google.cloud.bigquery.v2.Routine.arguments: array expected"); + message["arguments"] = []; + for (var i = 0; i < object["arguments"].length; ++i) { + if (!$util.isObject(object["arguments"][i])) + throw TypeError(".google.cloud.bigquery.v2.Routine.arguments: object expected"); + message["arguments"][i] = $root.google.cloud.bigquery.v2.Routine.Argument.fromObject(object["arguments"][i], long + 1); + } + } + if (object.returnType != null) { + if (!$util.isObject(object.returnType)) + throw TypeError(".google.cloud.bigquery.v2.Routine.returnType: object expected"); + message.returnType = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.returnType, long + 1); + } + if (object.returnTableType != null) { + if (!$util.isObject(object.returnTableType)) + throw TypeError(".google.cloud.bigquery.v2.Routine.returnTableType: object expected"); + message.returnTableType = $root.google.cloud.bigquery.v2.StandardSqlTableType.fromObject(object.returnTableType, long + 1); + } + if (object.importedLibraries) { + if (!Array.isArray(object.importedLibraries)) + throw TypeError(".google.cloud.bigquery.v2.Routine.importedLibraries: array expected"); + message.importedLibraries = []; + for (var i = 0; i < object.importedLibraries.length; ++i) + message.importedLibraries[i] = String(object.importedLibraries[i]); + } + if (object.definitionBody != null) + message.definitionBody = String(object.definitionBody); + if (object.description != null) + message.description = String(object.description); + switch (object.determinismLevel) { + default: + if (typeof object.determinismLevel === "number") { + message.determinismLevel = object.determinismLevel; + break; + } + break; + case "DETERMINISM_LEVEL_UNSPECIFIED": + case 0: + message.determinismLevel = 0; + break; + case "DETERMINISTIC": + case 1: + message.determinismLevel = 1; + break; + case "NOT_DETERMINISTIC": + case 2: + message.determinismLevel = 2; + break; + } + switch (object.securityMode) { + default: + if (typeof object.securityMode === "number") { + message.securityMode = object.securityMode; + break; + } + break; + case "SECURITY_MODE_UNSPECIFIED": + case 0: + message.securityMode = 0; + break; + case "DEFINER": + case 1: + message.securityMode = 1; + break; + case "INVOKER": + case 2: + message.securityMode = 2; + break; + } + if (object.strictMode != null) { + if (!$util.isObject(object.strictMode)) + throw TypeError(".google.cloud.bigquery.v2.Routine.strictMode: object expected"); + message.strictMode = $root.google.protobuf.BoolValue.fromObject(object.strictMode, long + 1); + } + if (object.remoteFunctionOptions != null) { + if (!$util.isObject(object.remoteFunctionOptions)) + throw TypeError(".google.cloud.bigquery.v2.Routine.remoteFunctionOptions: object expected"); + message.remoteFunctionOptions = $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.fromObject(object.remoteFunctionOptions, long + 1); + } + if (object.sparkOptions != null) { + if (!$util.isObject(object.sparkOptions)) + throw TypeError(".google.cloud.bigquery.v2.Routine.sparkOptions: object expected"); + message.sparkOptions = $root.google.cloud.bigquery.v2.SparkOptions.fromObject(object.sparkOptions, long + 1); + } + switch (object.dataGovernanceType) { + default: + if (typeof object.dataGovernanceType === "number") { + message.dataGovernanceType = object.dataGovernanceType; + break; + } + break; + case "DATA_GOVERNANCE_TYPE_UNSPECIFIED": + case 0: + message.dataGovernanceType = 0; + break; + case "DATA_MASKING": + case 1: + message.dataGovernanceType = 1; + break; + } + if (object.pythonOptions != null) { + if (!$util.isObject(object.pythonOptions)) + throw TypeError(".google.cloud.bigquery.v2.Routine.pythonOptions: object expected"); + message.pythonOptions = $root.google.cloud.bigquery.v2.PythonOptions.fromObject(object.pythonOptions, long + 1); + } + if (object.externalRuntimeOptions != null) { + if (!$util.isObject(object.externalRuntimeOptions)) + throw TypeError(".google.cloud.bigquery.v2.Routine.externalRuntimeOptions: object expected"); + message.externalRuntimeOptions = $root.google.cloud.bigquery.v2.ExternalRuntimeOptions.fromObject(object.externalRuntimeOptions, long + 1); + } + if (object.buildStatus != null) { + if (!$util.isObject(object.buildStatus)) + throw TypeError(".google.cloud.bigquery.v2.Routine.buildStatus: object expected"); + message.buildStatus = $root.google.cloud.bigquery.v2.RoutineBuildStatus.fromObject(object.buildStatus, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Routine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {google.cloud.bigquery.v2.Routine} message Routine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Routine.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object["arguments"] = []; + object.importedLibraries = []; + } + if (options.defaults) { + object.etag = ""; + object.routineReference = null; + object.routineType = options.enums === String ? "ROUTINE_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastModifiedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.lastModifiedTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.language = options.enums === String ? "LANGUAGE_UNSPECIFIED" : 0; + object.definitionBody = ""; + object.returnType = null; + object.description = ""; + object.determinismLevel = options.enums === String ? "DETERMINISM_LEVEL_UNSPECIFIED" : 0; + object.returnTableType = null; + object.strictMode = null; + object.remoteFunctionOptions = null; + object.sparkOptions = null; + object.dataGovernanceType = options.enums === String ? "DATA_GOVERNANCE_TYPE_UNSPECIFIED" : 0; + object.securityMode = options.enums === String ? "SECURITY_MODE_UNSPECIFIED" : 0; + object.pythonOptions = null; + object.externalRuntimeOptions = null; + object.buildStatus = null; + } + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.routineReference != null && Object.hasOwnProperty.call(message, "routineReference")) + object.routineReference = $root.google.cloud.bigquery.v2.RoutineReference.toObject(message.routineReference, options, q + 1); + if (message.routineType != null && Object.hasOwnProperty.call(message, "routineType")) + object.routineType = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.RoutineType[message.routineType] === undefined ? message.routineType : $root.google.cloud.bigquery.v2.Routine.RoutineType[message.routineType] : message.routineType; + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.lastModifiedTime = typeof message.lastModifiedTime === "number" ? BigInt(message.lastModifiedTime) : $util.Long.fromBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0, false).toBigInt(); + else if (typeof message.lastModifiedTime === "number") + object.lastModifiedTime = options.longs === String ? String(message.lastModifiedTime) : message.lastModifiedTime; + else + object.lastModifiedTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastModifiedTime) : options.longs === Number ? new $util.LongBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0).toNumber() : message.lastModifiedTime; + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + object.language = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.Language[message.language] === undefined ? message.language : $root.google.cloud.bigquery.v2.Routine.Language[message.language] : message.language; + if (message["arguments"] && message["arguments"].length) { + object["arguments"] = []; + for (var j = 0; j < message["arguments"].length; ++j) + object["arguments"][j] = $root.google.cloud.bigquery.v2.Routine.Argument.toObject(message["arguments"][j], options, q + 1); + } + if (message.importedLibraries && message.importedLibraries.length) { + object.importedLibraries = []; + for (var j = 0; j < message.importedLibraries.length; ++j) + object.importedLibraries[j] = message.importedLibraries[j]; + } + if (message.definitionBody != null && Object.hasOwnProperty.call(message, "definitionBody")) + object.definitionBody = message.definitionBody; + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) + object.returnType = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.returnType, options, q + 1); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.determinismLevel != null && Object.hasOwnProperty.call(message, "determinismLevel")) + object.determinismLevel = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.DeterminismLevel[message.determinismLevel] === undefined ? message.determinismLevel : $root.google.cloud.bigquery.v2.Routine.DeterminismLevel[message.determinismLevel] : message.determinismLevel; + if (message.returnTableType != null && Object.hasOwnProperty.call(message, "returnTableType")) + object.returnTableType = $root.google.cloud.bigquery.v2.StandardSqlTableType.toObject(message.returnTableType, options, q + 1); + if (message.strictMode != null && Object.hasOwnProperty.call(message, "strictMode")) + object.strictMode = $root.google.protobuf.BoolValue.toObject(message.strictMode, options, q + 1); + if (message.remoteFunctionOptions != null && Object.hasOwnProperty.call(message, "remoteFunctionOptions")) + object.remoteFunctionOptions = $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.toObject(message.remoteFunctionOptions, options, q + 1); + if (message.sparkOptions != null && Object.hasOwnProperty.call(message, "sparkOptions")) + object.sparkOptions = $root.google.cloud.bigquery.v2.SparkOptions.toObject(message.sparkOptions, options, q + 1); + if (message.dataGovernanceType != null && Object.hasOwnProperty.call(message, "dataGovernanceType")) + object.dataGovernanceType = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.DataGovernanceType[message.dataGovernanceType] === undefined ? message.dataGovernanceType : $root.google.cloud.bigquery.v2.Routine.DataGovernanceType[message.dataGovernanceType] : message.dataGovernanceType; + if (message.securityMode != null && Object.hasOwnProperty.call(message, "securityMode")) + object.securityMode = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.SecurityMode[message.securityMode] === undefined ? message.securityMode : $root.google.cloud.bigquery.v2.Routine.SecurityMode[message.securityMode] : message.securityMode; + if (message.pythonOptions != null && Object.hasOwnProperty.call(message, "pythonOptions")) + object.pythonOptions = $root.google.cloud.bigquery.v2.PythonOptions.toObject(message.pythonOptions, options, q + 1); + if (message.externalRuntimeOptions != null && Object.hasOwnProperty.call(message, "externalRuntimeOptions")) + object.externalRuntimeOptions = $root.google.cloud.bigquery.v2.ExternalRuntimeOptions.toObject(message.externalRuntimeOptions, options, q + 1); + if (message.buildStatus != null && Object.hasOwnProperty.call(message, "buildStatus")) + object.buildStatus = $root.google.cloud.bigquery.v2.RoutineBuildStatus.toObject(message.buildStatus, options, q + 1); + return object; + }; + + /** + * Converts this Routine to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Routine + * @instance + * @returns {Object.} JSON object + */ + Routine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Routine + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Routine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Routine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Routine"; + }; + + /** + * RoutineType enum. + * @name google.cloud.bigquery.v2.Routine.RoutineType + * @enum {number} + * @property {number} ROUTINE_TYPE_UNSPECIFIED=0 ROUTINE_TYPE_UNSPECIFIED value + * @property {number} SCALAR_FUNCTION=1 SCALAR_FUNCTION value + * @property {number} PROCEDURE=2 PROCEDURE value + * @property {number} TABLE_VALUED_FUNCTION=3 TABLE_VALUED_FUNCTION value + * @property {number} AGGREGATE_FUNCTION=4 AGGREGATE_FUNCTION value + */ + Routine.RoutineType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTINE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCALAR_FUNCTION"] = 1; + values[valuesById[2] = "PROCEDURE"] = 2; + values[valuesById[3] = "TABLE_VALUED_FUNCTION"] = 3; + values[valuesById[4] = "AGGREGATE_FUNCTION"] = 4; + return values; + })(); + + /** + * Language enum. + * @name google.cloud.bigquery.v2.Routine.Language + * @enum {number} + * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value + * @property {number} SQL=1 SQL value + * @property {number} JAVASCRIPT=2 JAVASCRIPT value + * @property {number} PYTHON=3 PYTHON value + * @property {number} JAVA=4 JAVA value + * @property {number} SCALA=5 SCALA value + */ + Routine.Language = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LANGUAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SQL"] = 1; + values[valuesById[2] = "JAVASCRIPT"] = 2; + values[valuesById[3] = "PYTHON"] = 3; + values[valuesById[4] = "JAVA"] = 4; + values[valuesById[5] = "SCALA"] = 5; + return values; + })(); + + Routine.Argument = (function() { + + /** + * Properties of an Argument. + * @memberof google.cloud.bigquery.v2.Routine + * @interface IArgument + * @property {string|null} [name] Argument name + * @property {google.cloud.bigquery.v2.Routine.Argument.ArgumentKind|null} [argumentKind] Argument argumentKind + * @property {google.cloud.bigquery.v2.Routine.Argument.Mode|null} [mode] Argument mode + * @property {google.cloud.bigquery.v2.IStandardSqlDataType|null} [dataType] Argument dataType + * @property {google.protobuf.IBoolValue|null} [isAggregate] Argument isAggregate + */ + + /** + * Constructs a new Argument. + * @memberof google.cloud.bigquery.v2.Routine + * @classdesc Represents an Argument. + * @implements IArgument + * @constructor + * @param {google.cloud.bigquery.v2.Routine.IArgument=} [properties] Properties to set + */ + function Argument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Argument name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + */ + Argument.prototype.name = ""; + + /** + * Argument argumentKind. + * @member {google.cloud.bigquery.v2.Routine.Argument.ArgumentKind} argumentKind + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + */ + Argument.prototype.argumentKind = 0; + + /** + * Argument mode. + * @member {google.cloud.bigquery.v2.Routine.Argument.Mode} mode + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + */ + Argument.prototype.mode = 0; + + /** + * Argument dataType. + * @member {google.cloud.bigquery.v2.IStandardSqlDataType|null|undefined} dataType + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + */ + Argument.prototype.dataType = null; + + /** + * Argument isAggregate. + * @member {google.protobuf.IBoolValue|null|undefined} isAggregate + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + */ + Argument.prototype.isAggregate = null; + + /** + * Creates a new Argument instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {google.cloud.bigquery.v2.Routine.IArgument=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Routine.Argument} Argument instance + */ + Argument.create = function create(properties) { + return new Argument(properties); + }; + + /** + * Encodes the specified Argument message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.Argument.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {google.cloud.bigquery.v2.Routine.IArgument} message Argument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Argument.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.argumentKind != null && Object.hasOwnProperty.call(message, "argumentKind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.argumentKind); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + $root.google.cloud.bigquery.v2.StandardSqlDataType.encode(message.dataType, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.isAggregate != null && Object.hasOwnProperty.call(message, "isAggregate")) + $root.google.protobuf.BoolValue.encode(message.isAggregate, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Argument message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.Argument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {google.cloud.bigquery.v2.Routine.IArgument} message Argument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Argument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Argument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Routine.Argument} Argument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Argument.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Routine.Argument(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.argumentKind = reader.int32(); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + case 4: { + message.dataType = $root.google.cloud.bigquery.v2.StandardSqlDataType.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.isAggregate = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Argument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Routine.Argument} Argument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Argument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Argument message. + * @function verify + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Argument.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.argumentKind != null && Object.hasOwnProperty.call(message, "argumentKind")) + switch (message.argumentKind) { + default: + return "argumentKind: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) { + var error = $root.google.cloud.bigquery.v2.StandardSqlDataType.verify(message.dataType, long + 1); + if (error) + return "dataType." + error; + } + if (message.isAggregate != null && Object.hasOwnProperty.call(message, "isAggregate")) { + var error = $root.google.protobuf.BoolValue.verify(message.isAggregate, long + 1); + if (error) + return "isAggregate." + error; + } + return null; + }; + + /** + * Creates an Argument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Routine.Argument} Argument + */ + Argument.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Routine.Argument) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Routine.Argument: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Routine.Argument(); + if (object.name != null) + message.name = String(object.name); + switch (object.argumentKind) { + default: + if (typeof object.argumentKind === "number") { + message.argumentKind = object.argumentKind; + break; + } + break; + case "ARGUMENT_KIND_UNSPECIFIED": + case 0: + message.argumentKind = 0; + break; + case "FIXED_TYPE": + case 1: + message.argumentKind = 1; + break; + case "ANY_TYPE": + case 2: + message.argumentKind = 2; + break; + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "IN": + case 1: + message.mode = 1; + break; + case "OUT": + case 2: + message.mode = 2; + break; + case "INOUT": + case 3: + message.mode = 3; + break; + } + if (object.dataType != null) { + if (!$util.isObject(object.dataType)) + throw TypeError(".google.cloud.bigquery.v2.Routine.Argument.dataType: object expected"); + message.dataType = $root.google.cloud.bigquery.v2.StandardSqlDataType.fromObject(object.dataType, long + 1); + } + if (object.isAggregate != null) { + if (!$util.isObject(object.isAggregate)) + throw TypeError(".google.cloud.bigquery.v2.Routine.Argument.isAggregate: object expected"); + message.isAggregate = $root.google.protobuf.BoolValue.fromObject(object.isAggregate, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Argument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {google.cloud.bigquery.v2.Routine.Argument} message Argument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Argument.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.argumentKind = options.enums === String ? "ARGUMENT_KIND_UNSPECIFIED" : 0; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.dataType = null; + object.isAggregate = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.argumentKind != null && Object.hasOwnProperty.call(message, "argumentKind")) + object.argumentKind = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.Argument.ArgumentKind[message.argumentKind] === undefined ? message.argumentKind : $root.google.cloud.bigquery.v2.Routine.Argument.ArgumentKind[message.argumentKind] : message.argumentKind; + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + object.mode = options.enums === String ? $root.google.cloud.bigquery.v2.Routine.Argument.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.bigquery.v2.Routine.Argument.Mode[message.mode] : message.mode; + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + object.dataType = $root.google.cloud.bigquery.v2.StandardSqlDataType.toObject(message.dataType, options, q + 1); + if (message.isAggregate != null && Object.hasOwnProperty.call(message, "isAggregate")) + object.isAggregate = $root.google.protobuf.BoolValue.toObject(message.isAggregate, options, q + 1); + return object; + }; + + /** + * Converts this Argument to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @instance + * @returns {Object.} JSON object + */ + Argument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Argument + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Routine.Argument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Argument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Routine.Argument"; + }; + + /** + * ArgumentKind enum. + * @name google.cloud.bigquery.v2.Routine.Argument.ArgumentKind + * @enum {number} + * @property {number} ARGUMENT_KIND_UNSPECIFIED=0 ARGUMENT_KIND_UNSPECIFIED value + * @property {number} FIXED_TYPE=1 FIXED_TYPE value + * @property {number} ANY_TYPE=2 ANY_TYPE value + */ + Argument.ArgumentKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARGUMENT_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIXED_TYPE"] = 1; + values[valuesById[2] = "ANY_TYPE"] = 2; + return values; + })(); + + /** + * Mode enum. + * @name google.cloud.bigquery.v2.Routine.Argument.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} OUT=2 OUT value + * @property {number} INOUT=3 INOUT value + */ + Argument.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "OUT"] = 2; + values[valuesById[3] = "INOUT"] = 3; + return values; + })(); + + return Argument; + })(); + + /** + * DeterminismLevel enum. + * @name google.cloud.bigquery.v2.Routine.DeterminismLevel + * @enum {number} + * @property {number} DETERMINISM_LEVEL_UNSPECIFIED=0 DETERMINISM_LEVEL_UNSPECIFIED value + * @property {number} DETERMINISTIC=1 DETERMINISTIC value + * @property {number} NOT_DETERMINISTIC=2 NOT_DETERMINISTIC value + */ + Routine.DeterminismLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DETERMINISM_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "DETERMINISTIC"] = 1; + values[valuesById[2] = "NOT_DETERMINISTIC"] = 2; + return values; + })(); + + /** + * SecurityMode enum. + * @name google.cloud.bigquery.v2.Routine.SecurityMode + * @enum {number} + * @property {number} SECURITY_MODE_UNSPECIFIED=0 SECURITY_MODE_UNSPECIFIED value + * @property {number} DEFINER=1 DEFINER value + * @property {number} INVOKER=2 INVOKER value + */ + Routine.SecurityMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SECURITY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFINER"] = 1; + values[valuesById[2] = "INVOKER"] = 2; + return values; + })(); + + Routine.RemoteFunctionOptions = (function() { + + /** + * Properties of a RemoteFunctionOptions. + * @memberof google.cloud.bigquery.v2.Routine + * @interface IRemoteFunctionOptions + * @property {string|null} [endpoint] RemoteFunctionOptions endpoint + * @property {string|null} [connection] RemoteFunctionOptions connection + * @property {Object.|null} [userDefinedContext] RemoteFunctionOptions userDefinedContext + * @property {number|Long|null} [maxBatchingRows] RemoteFunctionOptions maxBatchingRows + */ + + /** + * Constructs a new RemoteFunctionOptions. + * @memberof google.cloud.bigquery.v2.Routine + * @classdesc Represents a RemoteFunctionOptions. + * @implements IRemoteFunctionOptions + * @constructor + * @param {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions=} [properties] Properties to set + */ + function RemoteFunctionOptions(properties) { + this.userDefinedContext = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoteFunctionOptions endpoint. + * @member {string} endpoint + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @instance + */ + RemoteFunctionOptions.prototype.endpoint = ""; + + /** + * RemoteFunctionOptions connection. + * @member {string} connection + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @instance + */ + RemoteFunctionOptions.prototype.connection = ""; + + /** + * RemoteFunctionOptions userDefinedContext. + * @member {Object.} userDefinedContext + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @instance + */ + RemoteFunctionOptions.prototype.userDefinedContext = $util.emptyObject; + + /** + * RemoteFunctionOptions maxBatchingRows. + * @member {number|Long} maxBatchingRows + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @instance + */ + RemoteFunctionOptions.prototype.maxBatchingRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RemoteFunctionOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Routine.RemoteFunctionOptions} RemoteFunctionOptions instance + */ + RemoteFunctionOptions.create = function create(properties) { + return new RemoteFunctionOptions(properties); + }; + + /** + * Encodes the specified RemoteFunctionOptions message. Does not implicitly {@link google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions} message RemoteFunctionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteFunctionOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connection); + if (message.userDefinedContext != null && Object.hasOwnProperty.call(message, "userDefinedContext")) + for (var keys = Object.keys(message.userDefinedContext), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userDefinedContext[keys[i]]).ldelim(); + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxBatchingRows); + return writer; + }; + + /** + * Encodes the specified RemoteFunctionOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {google.cloud.bigquery.v2.Routine.IRemoteFunctionOptions} message RemoteFunctionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoteFunctionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RemoteFunctionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Routine.RemoteFunctionOptions} RemoteFunctionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteFunctionOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.connection = reader.string(); + break; + } + case 3: { + if (message.userDefinedContext === $util.emptyObject) + message.userDefinedContext = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.userDefinedContext, key); + message.userDefinedContext[key] = value; + break; + } + case 4: { + message.maxBatchingRows = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RemoteFunctionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Routine.RemoteFunctionOptions} RemoteFunctionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoteFunctionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoteFunctionOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoteFunctionOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.userDefinedContext != null && Object.hasOwnProperty.call(message, "userDefinedContext")) { + if (!$util.isObject(message.userDefinedContext)) + return "userDefinedContext: object expected"; + var key = Object.keys(message.userDefinedContext); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userDefinedContext[key[i]])) + return "userDefinedContext: string{k:string} expected"; + } + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (!$util.isInteger(message.maxBatchingRows) && !(message.maxBatchingRows && $util.isInteger(message.maxBatchingRows.low) && $util.isInteger(message.maxBatchingRows.high))) + return "maxBatchingRows: integer|Long expected"; + return null; + }; + + /** + * Creates a RemoteFunctionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Routine.RemoteFunctionOptions} RemoteFunctionOptions + */ + RemoteFunctionOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Routine.RemoteFunctionOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Routine.RemoteFunctionOptions(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.connection != null) + message.connection = String(object.connection); + if (object.userDefinedContext) { + if (!$util.isObject(object.userDefinedContext)) + throw TypeError(".google.cloud.bigquery.v2.Routine.RemoteFunctionOptions.userDefinedContext: object expected"); + message.userDefinedContext = {}; + for (var keys = Object.keys(object.userDefinedContext), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.userDefinedContext, keys[i]); + message.userDefinedContext[keys[i]] = String(object.userDefinedContext[keys[i]]); + } + } + if (object.maxBatchingRows != null) + if ($util.Long) + message.maxBatchingRows = $util.Long.fromValue(object.maxBatchingRows, false); + else if (typeof object.maxBatchingRows === "string") + message.maxBatchingRows = parseInt(object.maxBatchingRows, 10); + else if (typeof object.maxBatchingRows === "number") + message.maxBatchingRows = object.maxBatchingRows; + else if (typeof object.maxBatchingRows === "object") + message.maxBatchingRows = new $util.LongBits(object.maxBatchingRows.low >>> 0, object.maxBatchingRows.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RemoteFunctionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {google.cloud.bigquery.v2.Routine.RemoteFunctionOptions} message RemoteFunctionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoteFunctionOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.userDefinedContext = {}; + if (options.defaults) { + object.endpoint = ""; + object.connection = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBatchingRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxBatchingRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + object.endpoint = message.endpoint; + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + object.connection = message.connection; + var keys2; + if (message.userDefinedContext && (keys2 = Object.keys(message.userDefinedContext)).length) { + object.userDefinedContext = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.userDefinedContext, keys2[j]); + object.userDefinedContext[keys2[j]] = message.userDefinedContext[keys2[j]]; + } + } + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxBatchingRows = typeof message.maxBatchingRows === "number" ? BigInt(message.maxBatchingRows) : $util.Long.fromBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0, false).toBigInt(); + else if (typeof message.maxBatchingRows === "number") + object.maxBatchingRows = options.longs === String ? String(message.maxBatchingRows) : message.maxBatchingRows; + else + object.maxBatchingRows = options.longs === String ? $util.Long.prototype.toString.call(message.maxBatchingRows) : options.longs === Number ? new $util.LongBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0).toNumber() : message.maxBatchingRows; + return object; + }; + + /** + * Converts this RemoteFunctionOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @instance + * @returns {Object.} JSON object + */ + RemoteFunctionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoteFunctionOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Routine.RemoteFunctionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoteFunctionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Routine.RemoteFunctionOptions"; + }; + + return RemoteFunctionOptions; + })(); + + /** + * DataGovernanceType enum. + * @name google.cloud.bigquery.v2.Routine.DataGovernanceType + * @enum {number} + * @property {number} DATA_GOVERNANCE_TYPE_UNSPECIFIED=0 DATA_GOVERNANCE_TYPE_UNSPECIFIED value + * @property {number} DATA_MASKING=1 DATA_MASKING value + */ + Routine.DataGovernanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_GOVERNANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATA_MASKING"] = 1; + return values; + })(); + + return Routine; + })(); + + v2.PythonOptions = (function() { + + /** + * Properties of a PythonOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IPythonOptions + * @property {string|null} [entryPoint] PythonOptions entryPoint + * @property {Array.|null} [packages] PythonOptions packages + */ + + /** + * Constructs a new PythonOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PythonOptions. + * @implements IPythonOptions + * @constructor + * @param {google.cloud.bigquery.v2.IPythonOptions=} [properties] Properties to set + */ + function PythonOptions(properties) { + this.packages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonOptions entryPoint. + * @member {string} entryPoint + * @memberof google.cloud.bigquery.v2.PythonOptions + * @instance + */ + PythonOptions.prototype.entryPoint = ""; + + /** + * PythonOptions packages. + * @member {Array.} packages + * @memberof google.cloud.bigquery.v2.PythonOptions + * @instance + */ + PythonOptions.prototype.packages = $util.emptyArray; + + /** + * Creates a new PythonOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {google.cloud.bigquery.v2.IPythonOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PythonOptions} PythonOptions instance + */ + PythonOptions.create = function create(properties) { + return new PythonOptions(properties); + }; + + /** + * Encodes the specified PythonOptions message. Does not implicitly {@link google.cloud.bigquery.v2.PythonOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {google.cloud.bigquery.v2.IPythonOptions} message PythonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entryPoint); + if (message.packages != null && message.packages.length) + for (var i = 0; i < message.packages.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.packages[i]); + return writer; + }; + + /** + * Encodes the specified PythonOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PythonOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {google.cloud.bigquery.v2.IPythonOptions} message PythonOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PythonOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PythonOptions} PythonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PythonOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.entryPoint = reader.string(); + break; + } + case 2: { + if (!(message.packages && message.packages.length)) + message.packages = []; + message.packages.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PythonOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PythonOptions} PythonOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint")) + if (!$util.isString(message.entryPoint)) + return "entryPoint: string expected"; + if (message.packages != null && Object.hasOwnProperty.call(message, "packages")) { + if (!Array.isArray(message.packages)) + return "packages: array expected"; + for (var i = 0; i < message.packages.length; ++i) + if (!$util.isString(message.packages[i])) + return "packages: string[] expected"; + } + return null; + }; + + /** + * Creates a PythonOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PythonOptions} PythonOptions + */ + PythonOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PythonOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PythonOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PythonOptions(); + if (object.entryPoint != null) + message.entryPoint = String(object.entryPoint); + if (object.packages) { + if (!Array.isArray(object.packages)) + throw TypeError(".google.cloud.bigquery.v2.PythonOptions.packages: array expected"); + message.packages = []; + for (var i = 0; i < object.packages.length; ++i) + message.packages[i] = String(object.packages[i]); + } + return message; + }; + + /** + * Creates a plain object from a PythonOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {google.cloud.bigquery.v2.PythonOptions} message PythonOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.packages = []; + if (options.defaults) + object.entryPoint = ""; + if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint")) + object.entryPoint = message.entryPoint; + if (message.packages && message.packages.length) { + object.packages = []; + for (var j = 0; j < message.packages.length; ++j) + object.packages[j] = message.packages[j]; + } + return object; + }; + + /** + * Converts this PythonOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PythonOptions + * @instance + * @returns {Object.} JSON object + */ + PythonOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PythonOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PythonOptions"; + }; + + return PythonOptions; + })(); + + v2.ExternalRuntimeOptions = (function() { + + /** + * Properties of an ExternalRuntimeOptions. + * @memberof google.cloud.bigquery.v2 + * @interface IExternalRuntimeOptions + * @property {string|null} [containerMemory] ExternalRuntimeOptions containerMemory + * @property {number|null} [containerCpu] ExternalRuntimeOptions containerCpu + * @property {string|null} [runtimeConnection] ExternalRuntimeOptions runtimeConnection + * @property {number|Long|null} [maxBatchingRows] ExternalRuntimeOptions maxBatchingRows + * @property {string|null} [runtimeVersion] ExternalRuntimeOptions runtimeVersion + * @property {number|Long|null} [containerRequestConcurrency] ExternalRuntimeOptions containerRequestConcurrency + */ + + /** + * Constructs a new ExternalRuntimeOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an ExternalRuntimeOptions. + * @implements IExternalRuntimeOptions + * @constructor + * @param {google.cloud.bigquery.v2.IExternalRuntimeOptions=} [properties] Properties to set + */ + function ExternalRuntimeOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalRuntimeOptions containerMemory. + * @member {string} containerMemory + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.containerMemory = ""; + + /** + * ExternalRuntimeOptions containerCpu. + * @member {number} containerCpu + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.containerCpu = 0; + + /** + * ExternalRuntimeOptions runtimeConnection. + * @member {string} runtimeConnection + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.runtimeConnection = ""; + + /** + * ExternalRuntimeOptions maxBatchingRows. + * @member {number|Long} maxBatchingRows + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.maxBatchingRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExternalRuntimeOptions runtimeVersion. + * @member {string} runtimeVersion + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.runtimeVersion = ""; + + /** + * ExternalRuntimeOptions containerRequestConcurrency. + * @member {number|Long} containerRequestConcurrency + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + */ + ExternalRuntimeOptions.prototype.containerRequestConcurrency = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ExternalRuntimeOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalRuntimeOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ExternalRuntimeOptions} ExternalRuntimeOptions instance + */ + ExternalRuntimeOptions.create = function create(properties) { + return new ExternalRuntimeOptions(properties); + }; + + /** + * Encodes the specified ExternalRuntimeOptions message. Does not implicitly {@link google.cloud.bigquery.v2.ExternalRuntimeOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalRuntimeOptions} message ExternalRuntimeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalRuntimeOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.containerMemory != null && Object.hasOwnProperty.call(message, "containerMemory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.containerMemory); + if (message.containerCpu != null && Object.hasOwnProperty.call(message, "containerCpu")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.containerCpu); + if (message.runtimeConnection != null && Object.hasOwnProperty.call(message, "runtimeConnection")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.runtimeConnection); + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.maxBatchingRows); + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.runtimeVersion); + if (message.containerRequestConcurrency != null && Object.hasOwnProperty.call(message, "containerRequestConcurrency")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.containerRequestConcurrency); + return writer; + }; + + /** + * Encodes the specified ExternalRuntimeOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ExternalRuntimeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {google.cloud.bigquery.v2.IExternalRuntimeOptions} message ExternalRuntimeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalRuntimeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExternalRuntimeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ExternalRuntimeOptions} ExternalRuntimeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalRuntimeOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ExternalRuntimeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.containerMemory = reader.string(); + break; + } + case 2: { + message.containerCpu = reader.double(); + break; + } + case 3: { + message.runtimeConnection = reader.string(); + break; + } + case 4: { + message.maxBatchingRows = reader.int64(); + break; + } + case 5: { + message.runtimeVersion = reader.string(); + break; + } + case 6: { + message.containerRequestConcurrency = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalRuntimeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ExternalRuntimeOptions} ExternalRuntimeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalRuntimeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalRuntimeOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalRuntimeOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.containerMemory != null && Object.hasOwnProperty.call(message, "containerMemory")) + if (!$util.isString(message.containerMemory)) + return "containerMemory: string expected"; + if (message.containerCpu != null && Object.hasOwnProperty.call(message, "containerCpu")) + if (typeof message.containerCpu !== "number") + return "containerCpu: number expected"; + if (message.runtimeConnection != null && Object.hasOwnProperty.call(message, "runtimeConnection")) + if (!$util.isString(message.runtimeConnection)) + return "runtimeConnection: string expected"; + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (!$util.isInteger(message.maxBatchingRows) && !(message.maxBatchingRows && $util.isInteger(message.maxBatchingRows.low) && $util.isInteger(message.maxBatchingRows.high))) + return "maxBatchingRows: integer|Long expected"; + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + if (!$util.isString(message.runtimeVersion)) + return "runtimeVersion: string expected"; + if (message.containerRequestConcurrency != null && Object.hasOwnProperty.call(message, "containerRequestConcurrency")) + if (!$util.isInteger(message.containerRequestConcurrency) && !(message.containerRequestConcurrency && $util.isInteger(message.containerRequestConcurrency.low) && $util.isInteger(message.containerRequestConcurrency.high))) + return "containerRequestConcurrency: integer|Long expected"; + return null; + }; + + /** + * Creates an ExternalRuntimeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ExternalRuntimeOptions} ExternalRuntimeOptions + */ + ExternalRuntimeOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ExternalRuntimeOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ExternalRuntimeOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ExternalRuntimeOptions(); + if (object.containerMemory != null) + message.containerMemory = String(object.containerMemory); + if (object.containerCpu != null) + message.containerCpu = Number(object.containerCpu); + if (object.runtimeConnection != null) + message.runtimeConnection = String(object.runtimeConnection); + if (object.maxBatchingRows != null) + if ($util.Long) + message.maxBatchingRows = $util.Long.fromValue(object.maxBatchingRows, false); + else if (typeof object.maxBatchingRows === "string") + message.maxBatchingRows = parseInt(object.maxBatchingRows, 10); + else if (typeof object.maxBatchingRows === "number") + message.maxBatchingRows = object.maxBatchingRows; + else if (typeof object.maxBatchingRows === "object") + message.maxBatchingRows = new $util.LongBits(object.maxBatchingRows.low >>> 0, object.maxBatchingRows.high >>> 0).toNumber(); + if (object.runtimeVersion != null) + message.runtimeVersion = String(object.runtimeVersion); + if (object.containerRequestConcurrency != null) + if ($util.Long) + message.containerRequestConcurrency = $util.Long.fromValue(object.containerRequestConcurrency, false); + else if (typeof object.containerRequestConcurrency === "string") + message.containerRequestConcurrency = parseInt(object.containerRequestConcurrency, 10); + else if (typeof object.containerRequestConcurrency === "number") + message.containerRequestConcurrency = object.containerRequestConcurrency; + else if (typeof object.containerRequestConcurrency === "object") + message.containerRequestConcurrency = new $util.LongBits(object.containerRequestConcurrency.low >>> 0, object.containerRequestConcurrency.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ExternalRuntimeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {google.cloud.bigquery.v2.ExternalRuntimeOptions} message ExternalRuntimeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalRuntimeOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.containerMemory = ""; + object.containerCpu = 0; + object.runtimeConnection = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBatchingRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.maxBatchingRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.runtimeVersion = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.containerRequestConcurrency = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.containerRequestConcurrency = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.containerMemory != null && Object.hasOwnProperty.call(message, "containerMemory")) + object.containerMemory = message.containerMemory; + if (message.containerCpu != null && Object.hasOwnProperty.call(message, "containerCpu")) + object.containerCpu = options.json && !isFinite(message.containerCpu) ? String(message.containerCpu) : message.containerCpu; + if (message.runtimeConnection != null && Object.hasOwnProperty.call(message, "runtimeConnection")) + object.runtimeConnection = message.runtimeConnection; + if (message.maxBatchingRows != null && Object.hasOwnProperty.call(message, "maxBatchingRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxBatchingRows = typeof message.maxBatchingRows === "number" ? BigInt(message.maxBatchingRows) : $util.Long.fromBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0, false).toBigInt(); + else if (typeof message.maxBatchingRows === "number") + object.maxBatchingRows = options.longs === String ? String(message.maxBatchingRows) : message.maxBatchingRows; + else + object.maxBatchingRows = options.longs === String ? $util.Long.prototype.toString.call(message.maxBatchingRows) : options.longs === Number ? new $util.LongBits(message.maxBatchingRows.low >>> 0, message.maxBatchingRows.high >>> 0).toNumber() : message.maxBatchingRows; + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + object.runtimeVersion = message.runtimeVersion; + if (message.containerRequestConcurrency != null && Object.hasOwnProperty.call(message, "containerRequestConcurrency")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.containerRequestConcurrency = typeof message.containerRequestConcurrency === "number" ? BigInt(message.containerRequestConcurrency) : $util.Long.fromBits(message.containerRequestConcurrency.low >>> 0, message.containerRequestConcurrency.high >>> 0, false).toBigInt(); + else if (typeof message.containerRequestConcurrency === "number") + object.containerRequestConcurrency = options.longs === String ? String(message.containerRequestConcurrency) : message.containerRequestConcurrency; + else + object.containerRequestConcurrency = options.longs === String ? $util.Long.prototype.toString.call(message.containerRequestConcurrency) : options.longs === Number ? new $util.LongBits(message.containerRequestConcurrency.low >>> 0, message.containerRequestConcurrency.high >>> 0).toNumber() : message.containerRequestConcurrency; + return object; + }; + + /** + * Converts this ExternalRuntimeOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @instance + * @returns {Object.} JSON object + */ + ExternalRuntimeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalRuntimeOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ExternalRuntimeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalRuntimeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ExternalRuntimeOptions"; + }; + + return ExternalRuntimeOptions; + })(); + + v2.SparkOptions = (function() { + + /** + * Properties of a SparkOptions. + * @memberof google.cloud.bigquery.v2 + * @interface ISparkOptions + * @property {string|null} [connection] SparkOptions connection + * @property {string|null} [runtimeVersion] SparkOptions runtimeVersion + * @property {string|null} [containerImage] SparkOptions containerImage + * @property {Object.|null} [properties] SparkOptions properties + * @property {string|null} [mainFileUri] SparkOptions mainFileUri + * @property {Array.|null} [pyFileUris] SparkOptions pyFileUris + * @property {Array.|null} [jarUris] SparkOptions jarUris + * @property {Array.|null} [fileUris] SparkOptions fileUris + * @property {Array.|null} [archiveUris] SparkOptions archiveUris + * @property {string|null} [mainClass] SparkOptions mainClass + */ + + /** + * Constructs a new SparkOptions. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SparkOptions. + * @implements ISparkOptions + * @constructor + * @param {google.cloud.bigquery.v2.ISparkOptions=} [properties] Properties to set + */ + function SparkOptions(properties) { + this.properties = {}; + this.pyFileUris = []; + this.jarUris = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkOptions connection. + * @member {string} connection + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.connection = ""; + + /** + * SparkOptions runtimeVersion. + * @member {string} runtimeVersion + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.runtimeVersion = ""; + + /** + * SparkOptions containerImage. + * @member {string} containerImage + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.containerImage = ""; + + /** + * SparkOptions properties. + * @member {Object.} properties + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.properties = $util.emptyObject; + + /** + * SparkOptions mainFileUri. + * @member {string} mainFileUri + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.mainFileUri = ""; + + /** + * SparkOptions pyFileUris. + * @member {Array.} pyFileUris + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.pyFileUris = $util.emptyArray; + + /** + * SparkOptions jarUris. + * @member {Array.} jarUris + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.jarUris = $util.emptyArray; + + /** + * SparkOptions fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.fileUris = $util.emptyArray; + + /** + * SparkOptions archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.archiveUris = $util.emptyArray; + + /** + * SparkOptions mainClass. + * @member {string} mainClass + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + */ + SparkOptions.prototype.mainClass = ""; + + /** + * Creates a new SparkOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {google.cloud.bigquery.v2.ISparkOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SparkOptions} SparkOptions instance + */ + SparkOptions.create = function create(properties) { + return new SparkOptions(properties); + }; + + /** + * Encodes the specified SparkOptions message. Does not implicitly {@link google.cloud.bigquery.v2.SparkOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {google.cloud.bigquery.v2.ISparkOptions} message SparkOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connection); + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runtimeVersion); + if (message.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.containerImage); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.mainFileUri != null && Object.hasOwnProperty.call(message, "mainFileUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mainFileUri); + if (message.pyFileUris != null && message.pyFileUris.length) + for (var i = 0; i < message.pyFileUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pyFileUris[i]); + if (message.jarUris != null && message.jarUris.length) + for (var i = 0; i < message.jarUris.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.jarUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.archiveUris[i]); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.mainClass); + return writer; + }; + + /** + * Encodes the specified SparkOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SparkOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {google.cloud.bigquery.v2.ISparkOptions} message SparkOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SparkOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SparkOptions} SparkOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SparkOptions(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connection = reader.string(); + break; + } + case 2: { + message.runtimeVersion = reader.string(); + break; + } + case 3: { + message.containerImage = reader.string(); + break; + } + case 4: { + if (message.properties === $util.emptyObject) + message.properties = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.properties, key); + message.properties[key] = value; + break; + } + case 5: { + message.mainFileUri = reader.string(); + break; + } + case 6: { + if (!(message.pyFileUris && message.pyFileUris.length)) + message.pyFileUris = []; + message.pyFileUris.push(reader.string()); + break; + } + case 7: { + if (!(message.jarUris && message.jarUris.length)) + message.jarUris = []; + message.jarUris.push(reader.string()); + break; + } + case 8: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 9: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 10: { + message.mainClass = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SparkOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SparkOptions} SparkOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkOptions message. + * @function verify + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + if (!$util.isString(message.connection)) + return "connection: string expected"; + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + if (!$util.isString(message.runtimeVersion)) + return "runtimeVersion: string expected"; + if (message.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + if (!$util.isString(message.containerImage)) + return "containerImage: string expected"; + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.mainFileUri != null && Object.hasOwnProperty.call(message, "mainFileUri")) + if (!$util.isString(message.mainFileUri)) + return "mainFileUri: string expected"; + if (message.pyFileUris != null && Object.hasOwnProperty.call(message, "pyFileUris")) { + if (!Array.isArray(message.pyFileUris)) + return "pyFileUris: array expected"; + for (var i = 0; i < message.pyFileUris.length; ++i) + if (!$util.isString(message.pyFileUris[i])) + return "pyFileUris: string[] expected"; + } + if (message.jarUris != null && Object.hasOwnProperty.call(message, "jarUris")) { + if (!Array.isArray(message.jarUris)) + return "jarUris: array expected"; + for (var i = 0; i < message.jarUris.length; ++i) + if (!$util.isString(message.jarUris[i])) + return "jarUris: string[] expected"; + } + if (message.fileUris != null && Object.hasOwnProperty.call(message, "fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && Object.hasOwnProperty.call(message, "archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + if (!$util.isString(message.mainClass)) + return "mainClass: string expected"; + return null; + }; + + /** + * Creates a SparkOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SparkOptions} SparkOptions + */ + SparkOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SparkOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SparkOptions(); + if (object.connection != null) + message.connection = String(object.connection); + if (object.runtimeVersion != null) + message.runtimeVersion = String(object.runtimeVersion); + if (object.containerImage != null) + message.containerImage = String(object.containerImage); + if (object.properties) { + if (!$util.isObject(object.properties)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.properties, keys[i]); + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + } + if (object.mainFileUri != null) + message.mainFileUri = String(object.mainFileUri); + if (object.pyFileUris) { + if (!Array.isArray(object.pyFileUris)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions.pyFileUris: array expected"); + message.pyFileUris = []; + for (var i = 0; i < object.pyFileUris.length; ++i) + message.pyFileUris[i] = String(object.pyFileUris[i]); + } + if (object.jarUris) { + if (!Array.isArray(object.jarUris)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions.jarUris: array expected"); + message.jarUris = []; + for (var i = 0; i < object.jarUris.length; ++i) + message.jarUris[i] = String(object.jarUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.bigquery.v2.SparkOptions.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + return message; + }; + + /** + * Creates a plain object from a SparkOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {google.cloud.bigquery.v2.SparkOptions} message SparkOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.pyFileUris = []; + object.jarUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.connection = ""; + object.runtimeVersion = ""; + object.containerImage = ""; + object.mainFileUri = ""; + object.mainClass = ""; + } + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + object.connection = message.connection; + if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion")) + object.runtimeVersion = message.runtimeVersion; + if (message.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + object.containerImage = message.containerImage; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.properties, keys2[j]); + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + } + if (message.mainFileUri != null && Object.hasOwnProperty.call(message, "mainFileUri")) + object.mainFileUri = message.mainFileUri; + if (message.pyFileUris && message.pyFileUris.length) { + object.pyFileUris = []; + for (var j = 0; j < message.pyFileUris.length; ++j) + object.pyFileUris[j] = message.pyFileUris[j]; + } + if (message.jarUris && message.jarUris.length) { + object.jarUris = []; + for (var j = 0; j < message.jarUris.length; ++j) + object.jarUris[j] = message.jarUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + object.mainClass = message.mainClass; + return object; + }; + + /** + * Converts this SparkOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SparkOptions + * @instance + * @returns {Object.} JSON object + */ + SparkOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SparkOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SparkOptions"; + }; + + return SparkOptions; + })(); + + v2.RoutineBuildStatus = (function() { + + /** + * Properties of a RoutineBuildStatus. + * @memberof google.cloud.bigquery.v2 + * @interface IRoutineBuildStatus + * @property {google.cloud.bigquery.v2.RoutineBuildStatus.BuildState|null} [buildState] RoutineBuildStatus buildState + * @property {google.cloud.bigquery.v2.IErrorProto|null} [errorResult] RoutineBuildStatus errorResult + * @property {google.protobuf.ITimestamp|null} [buildStateUpdateTime] RoutineBuildStatus buildStateUpdateTime + * @property {google.protobuf.IDuration|null} [buildDuration] RoutineBuildStatus buildDuration + * @property {number|Long|null} [imageSizeBytes] RoutineBuildStatus imageSizeBytes + */ + + /** + * Constructs a new RoutineBuildStatus. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RoutineBuildStatus. + * @implements IRoutineBuildStatus + * @constructor + * @param {google.cloud.bigquery.v2.IRoutineBuildStatus=} [properties] Properties to set + */ + function RoutineBuildStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutineBuildStatus buildState. + * @member {google.cloud.bigquery.v2.RoutineBuildStatus.BuildState} buildState + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + */ + RoutineBuildStatus.prototype.buildState = 0; + + /** + * RoutineBuildStatus errorResult. + * @member {google.cloud.bigquery.v2.IErrorProto|null|undefined} errorResult + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + */ + RoutineBuildStatus.prototype.errorResult = null; + + /** + * RoutineBuildStatus buildStateUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} buildStateUpdateTime + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + */ + RoutineBuildStatus.prototype.buildStateUpdateTime = null; + + /** + * RoutineBuildStatus buildDuration. + * @member {google.protobuf.IDuration|null|undefined} buildDuration + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + */ + RoutineBuildStatus.prototype.buildDuration = null; + + /** + * RoutineBuildStatus imageSizeBytes. + * @member {number|Long} imageSizeBytes + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + */ + RoutineBuildStatus.prototype.imageSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RoutineBuildStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {google.cloud.bigquery.v2.IRoutineBuildStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RoutineBuildStatus} RoutineBuildStatus instance + */ + RoutineBuildStatus.create = function create(properties) { + return new RoutineBuildStatus(properties); + }; + + /** + * Encodes the specified RoutineBuildStatus message. Does not implicitly {@link google.cloud.bigquery.v2.RoutineBuildStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {google.cloud.bigquery.v2.IRoutineBuildStatus} message RoutineBuildStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutineBuildStatus.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.buildState != null && Object.hasOwnProperty.call(message, "buildState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.buildState); + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.errorResult, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.buildStateUpdateTime != null && Object.hasOwnProperty.call(message, "buildStateUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.buildStateUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.buildDuration != null && Object.hasOwnProperty.call(message, "buildDuration")) + $root.google.protobuf.Duration.encode(message.buildDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.imageSizeBytes != null && Object.hasOwnProperty.call(message, "imageSizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.imageSizeBytes); + return writer; + }; + + /** + * Encodes the specified RoutineBuildStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RoutineBuildStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {google.cloud.bigquery.v2.IRoutineBuildStatus} message RoutineBuildStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutineBuildStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RoutineBuildStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RoutineBuildStatus} RoutineBuildStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutineBuildStatus.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RoutineBuildStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.buildState = reader.int32(); + break; + } + case 2: { + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.buildStateUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.buildDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.imageSizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RoutineBuildStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RoutineBuildStatus} RoutineBuildStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutineBuildStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutineBuildStatus message. + * @function verify + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutineBuildStatus.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.buildState != null && Object.hasOwnProperty.call(message, "buildState")) + switch (message.buildState) { + default: + return "buildState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.errorResult, long + 1); + if (error) + return "errorResult." + error; + } + if (message.buildStateUpdateTime != null && Object.hasOwnProperty.call(message, "buildStateUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.buildStateUpdateTime, long + 1); + if (error) + return "buildStateUpdateTime." + error; + } + if (message.buildDuration != null && Object.hasOwnProperty.call(message, "buildDuration")) { + var error = $root.google.protobuf.Duration.verify(message.buildDuration, long + 1); + if (error) + return "buildDuration." + error; + } + if (message.imageSizeBytes != null && Object.hasOwnProperty.call(message, "imageSizeBytes")) + if (!$util.isInteger(message.imageSizeBytes) && !(message.imageSizeBytes && $util.isInteger(message.imageSizeBytes.low) && $util.isInteger(message.imageSizeBytes.high))) + return "imageSizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a RoutineBuildStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RoutineBuildStatus} RoutineBuildStatus + */ + RoutineBuildStatus.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RoutineBuildStatus) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RoutineBuildStatus: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RoutineBuildStatus(); + switch (object.buildState) { + default: + if (typeof object.buildState === "number") { + message.buildState = object.buildState; + break; + } + break; + case "BUILD_STATE_UNSPECIFIED": + case 0: + message.buildState = 0; + break; + case "IN_PROGRESS": + case 1: + message.buildState = 1; + break; + case "SUCCEEDED": + case 2: + message.buildState = 2; + break; + case "FAILED": + case 3: + message.buildState = 3; + break; + } + if (object.errorResult != null) { + if (!$util.isObject(object.errorResult)) + throw TypeError(".google.cloud.bigquery.v2.RoutineBuildStatus.errorResult: object expected"); + message.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.errorResult, long + 1); + } + if (object.buildStateUpdateTime != null) { + if (!$util.isObject(object.buildStateUpdateTime)) + throw TypeError(".google.cloud.bigquery.v2.RoutineBuildStatus.buildStateUpdateTime: object expected"); + message.buildStateUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.buildStateUpdateTime, long + 1); + } + if (object.buildDuration != null) { + if (!$util.isObject(object.buildDuration)) + throw TypeError(".google.cloud.bigquery.v2.RoutineBuildStatus.buildDuration: object expected"); + message.buildDuration = $root.google.protobuf.Duration.fromObject(object.buildDuration, long + 1); + } + if (object.imageSizeBytes != null) + if ($util.Long) + message.imageSizeBytes = $util.Long.fromValue(object.imageSizeBytes, false); + else if (typeof object.imageSizeBytes === "string") + message.imageSizeBytes = parseInt(object.imageSizeBytes, 10); + else if (typeof object.imageSizeBytes === "number") + message.imageSizeBytes = object.imageSizeBytes; + else if (typeof object.imageSizeBytes === "object") + message.imageSizeBytes = new $util.LongBits(object.imageSizeBytes.low >>> 0, object.imageSizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RoutineBuildStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {google.cloud.bigquery.v2.RoutineBuildStatus} message RoutineBuildStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutineBuildStatus.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.buildState = options.enums === String ? "BUILD_STATE_UNSPECIFIED" : 0; + object.errorResult = null; + object.buildStateUpdateTime = null; + object.buildDuration = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.imageSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.imageSizeBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.buildState != null && Object.hasOwnProperty.call(message, "buildState")) + object.buildState = options.enums === String ? $root.google.cloud.bigquery.v2.RoutineBuildStatus.BuildState[message.buildState] === undefined ? message.buildState : $root.google.cloud.bigquery.v2.RoutineBuildStatus.BuildState[message.buildState] : message.buildState; + if (message.errorResult != null && Object.hasOwnProperty.call(message, "errorResult")) + object.errorResult = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.errorResult, options, q + 1); + if (message.buildStateUpdateTime != null && Object.hasOwnProperty.call(message, "buildStateUpdateTime")) + object.buildStateUpdateTime = $root.google.protobuf.Timestamp.toObject(message.buildStateUpdateTime, options, q + 1); + if (message.buildDuration != null && Object.hasOwnProperty.call(message, "buildDuration")) + object.buildDuration = $root.google.protobuf.Duration.toObject(message.buildDuration, options, q + 1); + if (message.imageSizeBytes != null && Object.hasOwnProperty.call(message, "imageSizeBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.imageSizeBytes = typeof message.imageSizeBytes === "number" ? BigInt(message.imageSizeBytes) : $util.Long.fromBits(message.imageSizeBytes.low >>> 0, message.imageSizeBytes.high >>> 0, false).toBigInt(); + else if (typeof message.imageSizeBytes === "number") + object.imageSizeBytes = options.longs === String ? String(message.imageSizeBytes) : message.imageSizeBytes; + else + object.imageSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.imageSizeBytes) : options.longs === Number ? new $util.LongBits(message.imageSizeBytes.low >>> 0, message.imageSizeBytes.high >>> 0).toNumber() : message.imageSizeBytes; + return object; + }; + + /** + * Converts this RoutineBuildStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @instance + * @returns {Object.} JSON object + */ + RoutineBuildStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutineBuildStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RoutineBuildStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutineBuildStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RoutineBuildStatus"; + }; + + /** + * BuildState enum. + * @name google.cloud.bigquery.v2.RoutineBuildStatus.BuildState + * @enum {number} + * @property {number} BUILD_STATE_UNSPECIFIED=0 BUILD_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + RoutineBuildStatus.BuildState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BUILD_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return RoutineBuildStatus; + })(); + + v2.GetRoutineRequest = (function() { + + /** + * Properties of a GetRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetRoutineRequest + * @property {string|null} [projectId] GetRoutineRequest projectId + * @property {string|null} [datasetId] GetRoutineRequest datasetId + * @property {string|null} [routineId] GetRoutineRequest routineId + */ + + /** + * Constructs a new GetRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetRoutineRequest. + * @implements IGetRoutineRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetRoutineRequest=} [properties] Properties to set + */ + function GetRoutineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRoutineRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @instance + */ + GetRoutineRequest.prototype.projectId = ""; + + /** + * GetRoutineRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @instance + */ + GetRoutineRequest.prototype.datasetId = ""; + + /** + * GetRoutineRequest routineId. + * @member {string} routineId + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @instance + */ + GetRoutineRequest.prototype.routineId = ""; + + /** + * Creates a new GetRoutineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRoutineRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetRoutineRequest} GetRoutineRequest instance + */ + GetRoutineRequest.create = function create(properties) { + return new GetRoutineRequest(properties); + }; + + /** + * Encodes the specified GetRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetRoutineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRoutineRequest} message GetRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRoutineRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.routineId); + return writer; + }; + + /** + * Encodes the specified GetRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetRoutineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRoutineRequest} message GetRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRoutineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetRoutineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetRoutineRequest} GetRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRoutineRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetRoutineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.routineId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetRoutineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetRoutineRequest} GetRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRoutineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRoutineRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRoutineRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + if (!$util.isString(message.routineId)) + return "routineId: string expected"; + return null; + }; + + /** + * Creates a GetRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetRoutineRequest} GetRoutineRequest + */ + GetRoutineRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetRoutineRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetRoutineRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetRoutineRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.routineId != null) + message.routineId = String(object.routineId); + return message; + }; + + /** + * Creates a plain object from a GetRoutineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.GetRoutineRequest} message GetRoutineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRoutineRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.routineId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + object.routineId = message.routineId; + return object; + }; + + /** + * Converts this GetRoutineRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @instance + * @returns {Object.} JSON object + */ + GetRoutineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRoutineRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetRoutineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRoutineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetRoutineRequest"; + }; + + return GetRoutineRequest; + })(); + + v2.InsertRoutineRequest = (function() { + + /** + * Properties of an InsertRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IInsertRoutineRequest + * @property {string|null} [projectId] InsertRoutineRequest projectId + * @property {string|null} [datasetId] InsertRoutineRequest datasetId + * @property {google.cloud.bigquery.v2.IRoutine|null} [routine] InsertRoutineRequest routine + */ + + /** + * Constructs a new InsertRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an InsertRoutineRequest. + * @implements IInsertRoutineRequest + * @constructor + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest=} [properties] Properties to set + */ + function InsertRoutineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRoutineRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @instance + */ + InsertRoutineRequest.prototype.projectId = ""; + + /** + * InsertRoutineRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @instance + */ + InsertRoutineRequest.prototype.datasetId = ""; + + /** + * InsertRoutineRequest routine. + * @member {google.cloud.bigquery.v2.IRoutine|null|undefined} routine + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @instance + */ + InsertRoutineRequest.prototype.routine = null; + + /** + * Creates a new InsertRoutineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.InsertRoutineRequest} InsertRoutineRequest instance + */ + InsertRoutineRequest.create = function create(properties) { + return new InsertRoutineRequest(properties); + }; + + /** + * Encodes the specified InsertRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertRoutineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest} message InsertRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRoutineRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + $root.google.cloud.bigquery.v2.Routine.encode(message.routine, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertRoutineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertRoutineRequest} message InsertRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRoutineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an InsertRoutineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.InsertRoutineRequest} InsertRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRoutineRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.InsertRoutineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.routine = $root.google.cloud.bigquery.v2.Routine.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRoutineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.InsertRoutineRequest} InsertRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRoutineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRoutineRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRoutineRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) { + var error = $root.google.cloud.bigquery.v2.Routine.verify(message.routine, long + 1); + if (error) + return "routine." + error; + } + return null; + }; + + /** + * Creates an InsertRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.InsertRoutineRequest} InsertRoutineRequest + */ + InsertRoutineRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.InsertRoutineRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.InsertRoutineRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.InsertRoutineRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.routine != null) { + if (!$util.isObject(object.routine)) + throw TypeError(".google.cloud.bigquery.v2.InsertRoutineRequest.routine: object expected"); + message.routine = $root.google.cloud.bigquery.v2.Routine.fromObject(object.routine, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InsertRoutineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.InsertRoutineRequest} message InsertRoutineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRoutineRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.routine = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + object.routine = $root.google.cloud.bigquery.v2.Routine.toObject(message.routine, options, q + 1); + return object; + }; + + /** + * Converts this InsertRoutineRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRoutineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertRoutineRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.InsertRoutineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertRoutineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.InsertRoutineRequest"; + }; + + return InsertRoutineRequest; + })(); + + v2.UpdateRoutineRequest = (function() { + + /** + * Properties of an UpdateRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IUpdateRoutineRequest + * @property {string|null} [projectId] UpdateRoutineRequest projectId + * @property {string|null} [datasetId] UpdateRoutineRequest datasetId + * @property {string|null} [routineId] UpdateRoutineRequest routineId + * @property {google.cloud.bigquery.v2.IRoutine|null} [routine] UpdateRoutineRequest routine + */ + + /** + * Constructs a new UpdateRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an UpdateRoutineRequest. + * @implements IUpdateRoutineRequest + * @constructor + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest=} [properties] Properties to set + */ + function UpdateRoutineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRoutineRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @instance + */ + UpdateRoutineRequest.prototype.projectId = ""; + + /** + * UpdateRoutineRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @instance + */ + UpdateRoutineRequest.prototype.datasetId = ""; + + /** + * UpdateRoutineRequest routineId. + * @member {string} routineId + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @instance + */ + UpdateRoutineRequest.prototype.routineId = ""; + + /** + * UpdateRoutineRequest routine. + * @member {google.cloud.bigquery.v2.IRoutine|null|undefined} routine + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @instance + */ + UpdateRoutineRequest.prototype.routine = null; + + /** + * Creates a new UpdateRoutineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UpdateRoutineRequest} UpdateRoutineRequest instance + */ + UpdateRoutineRequest.create = function create(properties) { + return new UpdateRoutineRequest(properties); + }; + + /** + * Encodes the specified UpdateRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRoutineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest} message UpdateRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRoutineRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.routineId); + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + $root.google.cloud.bigquery.v2.Routine.encode(message.routine, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRoutineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRoutineRequest} message UpdateRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRoutineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateRoutineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UpdateRoutineRequest} UpdateRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRoutineRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UpdateRoutineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.routineId = reader.string(); + break; + } + case 4: { + message.routine = $root.google.cloud.bigquery.v2.Routine.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRoutineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UpdateRoutineRequest} UpdateRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRoutineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRoutineRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRoutineRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + if (!$util.isString(message.routineId)) + return "routineId: string expected"; + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) { + var error = $root.google.cloud.bigquery.v2.Routine.verify(message.routine, long + 1); + if (error) + return "routine." + error; + } + return null; + }; + + /** + * Creates an UpdateRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UpdateRoutineRequest} UpdateRoutineRequest + */ + UpdateRoutineRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UpdateRoutineRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UpdateRoutineRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UpdateRoutineRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.routineId != null) + message.routineId = String(object.routineId); + if (object.routine != null) { + if (!$util.isObject(object.routine)) + throw TypeError(".google.cloud.bigquery.v2.UpdateRoutineRequest.routine: object expected"); + message.routine = $root.google.cloud.bigquery.v2.Routine.fromObject(object.routine, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRoutineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.UpdateRoutineRequest} message UpdateRoutineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRoutineRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.routineId = ""; + object.routine = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + object.routineId = message.routineId; + if (message.routine != null && Object.hasOwnProperty.call(message, "routine")) + object.routine = $root.google.cloud.bigquery.v2.Routine.toObject(message.routine, options, q + 1); + return object; + }; + + /** + * Converts this UpdateRoutineRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRoutineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRoutineRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UpdateRoutineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRoutineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UpdateRoutineRequest"; + }; + + return UpdateRoutineRequest; + })(); + + v2.DeleteRoutineRequest = (function() { + + /** + * Properties of a DeleteRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteRoutineRequest + * @property {string|null} [projectId] DeleteRoutineRequest projectId + * @property {string|null} [datasetId] DeleteRoutineRequest datasetId + * @property {string|null} [routineId] DeleteRoutineRequest routineId + */ + + /** + * Constructs a new DeleteRoutineRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteRoutineRequest. + * @implements IDeleteRoutineRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest=} [properties] Properties to set + */ + function DeleteRoutineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRoutineRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @instance + */ + DeleteRoutineRequest.prototype.projectId = ""; + + /** + * DeleteRoutineRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @instance + */ + DeleteRoutineRequest.prototype.datasetId = ""; + + /** + * DeleteRoutineRequest routineId. + * @member {string} routineId + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @instance + */ + DeleteRoutineRequest.prototype.routineId = ""; + + /** + * Creates a new DeleteRoutineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteRoutineRequest} DeleteRoutineRequest instance + */ + DeleteRoutineRequest.create = function create(properties) { + return new DeleteRoutineRequest(properties); + }; + + /** + * Encodes the specified DeleteRoutineRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRoutineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest} message DeleteRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRoutineRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.routineId); + return writer; + }; + + /** + * Encodes the specified DeleteRoutineRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRoutineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRoutineRequest} message DeleteRoutineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRoutineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteRoutineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteRoutineRequest} DeleteRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRoutineRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteRoutineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.routineId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRoutineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteRoutineRequest} DeleteRoutineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRoutineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRoutineRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRoutineRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + if (!$util.isString(message.routineId)) + return "routineId: string expected"; + return null; + }; + + /** + * Creates a DeleteRoutineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteRoutineRequest} DeleteRoutineRequest + */ + DeleteRoutineRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteRoutineRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteRoutineRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteRoutineRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.routineId != null) + message.routineId = String(object.routineId); + return message; + }; + + /** + * Creates a plain object from a DeleteRoutineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteRoutineRequest} message DeleteRoutineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRoutineRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.routineId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.routineId != null && Object.hasOwnProperty.call(message, "routineId")) + object.routineId = message.routineId; + return object; + }; + + /** + * Converts this DeleteRoutineRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRoutineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRoutineRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteRoutineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRoutineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteRoutineRequest"; + }; + + return DeleteRoutineRequest; + })(); + + v2.ListRoutinesRequest = (function() { + + /** + * Properties of a ListRoutinesRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListRoutinesRequest + * @property {string|null} [projectId] ListRoutinesRequest projectId + * @property {string|null} [datasetId] ListRoutinesRequest datasetId + * @property {google.protobuf.IUInt32Value|null} [maxResults] ListRoutinesRequest maxResults + * @property {string|null} [pageToken] ListRoutinesRequest pageToken + * @property {string|null} [filter] ListRoutinesRequest filter + */ + + /** + * Constructs a new ListRoutinesRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListRoutinesRequest. + * @implements IListRoutinesRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListRoutinesRequest=} [properties] Properties to set + */ + function ListRoutinesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRoutinesRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + */ + ListRoutinesRequest.prototype.projectId = ""; + + /** + * ListRoutinesRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + */ + ListRoutinesRequest.prototype.datasetId = ""; + + /** + * ListRoutinesRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + */ + ListRoutinesRequest.prototype.maxResults = null; + + /** + * ListRoutinesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + */ + ListRoutinesRequest.prototype.pageToken = ""; + + /** + * ListRoutinesRequest filter. + * @member {string} filter + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + */ + ListRoutinesRequest.prototype.filter = ""; + + /** + * Creates a new ListRoutinesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListRoutinesRequest} ListRoutinesRequest instance + */ + ListRoutinesRequest.create = function create(properties) { + return new ListRoutinesRequest(properties); + }; + + /** + * Encodes the specified ListRoutinesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesRequest} message ListRoutinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutinesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRoutinesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesRequest} message ListRoutinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutinesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListRoutinesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListRoutinesRequest} ListRoutinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutinesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListRoutinesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutinesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListRoutinesRequest} ListRoutinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutinesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutinesRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutinesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRoutinesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListRoutinesRequest} ListRoutinesRequest + */ + ListRoutinesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListRoutinesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListRoutinesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListRoutinesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.ListRoutinesRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRoutinesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {google.cloud.bigquery.v2.ListRoutinesRequest} message ListRoutinesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutinesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.maxResults = null; + object.pageToken = ""; + object.filter = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRoutinesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRoutinesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRoutinesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListRoutinesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRoutinesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListRoutinesRequest"; + }; + + return ListRoutinesRequest; + })(); + + v2.ListRoutinesResponse = (function() { + + /** + * Properties of a ListRoutinesResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IListRoutinesResponse + * @property {Array.|null} [routines] ListRoutinesResponse routines + * @property {string|null} [nextPageToken] ListRoutinesResponse nextPageToken + */ + + /** + * Constructs a new ListRoutinesResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListRoutinesResponse. + * @implements IListRoutinesResponse + * @constructor + * @param {google.cloud.bigquery.v2.IListRoutinesResponse=} [properties] Properties to set + */ + function ListRoutinesResponse(properties) { + this.routines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRoutinesResponse routines. + * @member {Array.} routines + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @instance + */ + ListRoutinesResponse.prototype.routines = $util.emptyArray; + + /** + * ListRoutinesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @instance + */ + ListRoutinesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRoutinesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListRoutinesResponse} ListRoutinesResponse instance + */ + ListRoutinesResponse.create = function create(properties) { + return new ListRoutinesResponse(properties); + }; + + /** + * Encodes the specified ListRoutinesResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesResponse} message ListRoutinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutinesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.routines != null && message.routines.length) + for (var i = 0; i < message.routines.length; ++i) + $root.google.cloud.bigquery.v2.Routine.encode(message.routines[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRoutinesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRoutinesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRoutinesResponse} message ListRoutinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutinesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListRoutinesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListRoutinesResponse} ListRoutinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutinesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListRoutinesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.routines && message.routines.length)) + message.routines = []; + message.routines.push($root.google.cloud.bigquery.v2.Routine.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutinesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListRoutinesResponse} ListRoutinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutinesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutinesResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutinesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.routines != null && Object.hasOwnProperty.call(message, "routines")) { + if (!Array.isArray(message.routines)) + return "routines: array expected"; + for (var i = 0; i < message.routines.length; ++i) { + var error = $root.google.cloud.bigquery.v2.Routine.verify(message.routines[i], long + 1); + if (error) + return "routines." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRoutinesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListRoutinesResponse} ListRoutinesResponse + */ + ListRoutinesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListRoutinesResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListRoutinesResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListRoutinesResponse(); + if (object.routines) { + if (!Array.isArray(object.routines)) + throw TypeError(".google.cloud.bigquery.v2.ListRoutinesResponse.routines: array expected"); + message.routines = []; + for (var i = 0; i < object.routines.length; ++i) { + if (!$util.isObject(object.routines[i])) + throw TypeError(".google.cloud.bigquery.v2.ListRoutinesResponse.routines: object expected"); + message.routines[i] = $root.google.cloud.bigquery.v2.Routine.fromObject(object.routines[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRoutinesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {google.cloud.bigquery.v2.ListRoutinesResponse} message ListRoutinesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutinesResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.routines = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.routines && message.routines.length) { + object.routines = []; + for (var j = 0; j < message.routines.length; ++j) + object.routines[j] = $root.google.cloud.bigquery.v2.Routine.toObject(message.routines[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRoutinesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @instance + * @returns {Object.} JSON object + */ + ListRoutinesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRoutinesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListRoutinesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRoutinesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListRoutinesResponse"; + }; + + return ListRoutinesResponse; + })(); + + v2.RowAccessPolicyService = (function() { + + /** + * Constructs a new RowAccessPolicyService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RowAccessPolicyService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function RowAccessPolicyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RowAccessPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RowAccessPolicyService; + + /** + * Creates new RowAccessPolicyService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {RowAccessPolicyService} RPC service. Useful where requests and/or responses are streamed. + */ + RowAccessPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|listRowAccessPolicies}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef ListRowAccessPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} [response] ListRowAccessPoliciesResponse + */ + + /** + * Calls ListRowAccessPolicies. + * @function listRowAccessPolicies + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest} request ListRowAccessPoliciesRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.ListRowAccessPoliciesCallback} callback Node-style callback called with the error, if any, and ListRowAccessPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.listRowAccessPolicies = function listRowAccessPolicies(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listRowAccessPolicies, $root.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest, $root.google.cloud.bigquery.v2.ListRowAccessPoliciesResponse, request, callback); + }, "name", { value: "ListRowAccessPolicies" }); + + /** + * Calls ListRowAccessPolicies. + * @function listRowAccessPolicies + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest} request ListRowAccessPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|getRowAccessPolicy}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef GetRowAccessPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.RowAccessPolicy} [response] RowAccessPolicy + */ + + /** + * Calls GetRowAccessPolicy. + * @function getRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest} request GetRowAccessPolicyRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.GetRowAccessPolicyCallback} callback Node-style callback called with the error, if any, and RowAccessPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.getRowAccessPolicy = function getRowAccessPolicy(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getRowAccessPolicy, $root.google.cloud.bigquery.v2.GetRowAccessPolicyRequest, $root.google.cloud.bigquery.v2.RowAccessPolicy, request, callback); + }, "name", { value: "GetRowAccessPolicy" }); + + /** + * Calls GetRowAccessPolicy. + * @function getRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest} request GetRowAccessPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|createRowAccessPolicy}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef CreateRowAccessPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.RowAccessPolicy} [response] RowAccessPolicy + */ + + /** + * Calls CreateRowAccessPolicy. + * @function createRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest} request CreateRowAccessPolicyRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.CreateRowAccessPolicyCallback} callback Node-style callback called with the error, if any, and RowAccessPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.createRowAccessPolicy = function createRowAccessPolicy(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createRowAccessPolicy, $root.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest, $root.google.cloud.bigquery.v2.RowAccessPolicy, request, callback); + }, "name", { value: "CreateRowAccessPolicy" }); + + /** + * Calls CreateRowAccessPolicy. + * @function createRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest} request CreateRowAccessPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|updateRowAccessPolicy}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef UpdateRowAccessPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.RowAccessPolicy} [response] RowAccessPolicy + */ + + /** + * Calls UpdateRowAccessPolicy. + * @function updateRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest} request UpdateRowAccessPolicyRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.UpdateRowAccessPolicyCallback} callback Node-style callback called with the error, if any, and RowAccessPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.updateRowAccessPolicy = function updateRowAccessPolicy(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateRowAccessPolicy, $root.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest, $root.google.cloud.bigquery.v2.RowAccessPolicy, request, callback); + }, "name", { value: "UpdateRowAccessPolicy" }); + + /** + * Calls UpdateRowAccessPolicy. + * @function updateRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest} request UpdateRowAccessPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|deleteRowAccessPolicy}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef DeleteRowAccessPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRowAccessPolicy. + * @function deleteRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest} request DeleteRowAccessPolicyRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.DeleteRowAccessPolicyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.deleteRowAccessPolicy = function deleteRowAccessPolicy(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteRowAccessPolicy, $root.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRowAccessPolicy" }); + + /** + * Calls DeleteRowAccessPolicy. + * @function deleteRowAccessPolicy + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest} request DeleteRowAccessPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.RowAccessPolicyService|batchDeleteRowAccessPolicies}. + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @typedef BatchDeleteRowAccessPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls BatchDeleteRowAccessPolicies. + * @function batchDeleteRowAccessPolicies + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest} request BatchDeleteRowAccessPoliciesRequest message or plain object + * @param {google.cloud.bigquery.v2.RowAccessPolicyService.BatchDeleteRowAccessPoliciesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RowAccessPolicyService.prototype.batchDeleteRowAccessPolicies = function batchDeleteRowAccessPolicies(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, batchDeleteRowAccessPolicies, $root.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "BatchDeleteRowAccessPolicies" }); + + /** + * Calls BatchDeleteRowAccessPolicies. + * @function batchDeleteRowAccessPolicies + * @memberof google.cloud.bigquery.v2.RowAccessPolicyService + * @instance + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest} request BatchDeleteRowAccessPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RowAccessPolicyService; + })(); + + v2.ListRowAccessPoliciesRequest = (function() { + + /** + * Properties of a ListRowAccessPoliciesRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListRowAccessPoliciesRequest + * @property {string|null} [projectId] ListRowAccessPoliciesRequest projectId + * @property {string|null} [datasetId] ListRowAccessPoliciesRequest datasetId + * @property {string|null} [tableId] ListRowAccessPoliciesRequest tableId + * @property {string|null} [pageToken] ListRowAccessPoliciesRequest pageToken + * @property {number|null} [pageSize] ListRowAccessPoliciesRequest pageSize + */ + + /** + * Constructs a new ListRowAccessPoliciesRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListRowAccessPoliciesRequest. + * @implements IListRowAccessPoliciesRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest=} [properties] Properties to set + */ + function ListRowAccessPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRowAccessPoliciesRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + */ + ListRowAccessPoliciesRequest.prototype.projectId = ""; + + /** + * ListRowAccessPoliciesRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + */ + ListRowAccessPoliciesRequest.prototype.datasetId = ""; + + /** + * ListRowAccessPoliciesRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + */ + ListRowAccessPoliciesRequest.prototype.tableId = ""; + + /** + * ListRowAccessPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + */ + ListRowAccessPoliciesRequest.prototype.pageToken = ""; + + /** + * ListRowAccessPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + */ + ListRowAccessPoliciesRequest.prototype.pageSize = 0; + + /** + * Creates a new ListRowAccessPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesRequest} ListRowAccessPoliciesRequest instance + */ + ListRowAccessPoliciesRequest.create = function create(properties) { + return new ListRowAccessPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListRowAccessPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest} message ListRowAccessPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRowAccessPoliciesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListRowAccessPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesRequest} message ListRowAccessPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRowAccessPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListRowAccessPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesRequest} ListRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRowAccessPoliciesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListRowAccessPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesRequest} ListRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRowAccessPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRowAccessPoliciesRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRowAccessPoliciesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListRowAccessPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesRequest} ListRowAccessPoliciesRequest + */ + ListRowAccessPoliciesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListRowAccessPoliciesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListRowAccessPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.ListRowAccessPoliciesRequest} message ListRowAccessPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRowAccessPoliciesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListRowAccessPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRowAccessPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRowAccessPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRowAccessPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListRowAccessPoliciesRequest"; + }; + + return ListRowAccessPoliciesRequest; + })(); + + v2.ListRowAccessPoliciesResponse = (function() { + + /** + * Properties of a ListRowAccessPoliciesResponse. + * @memberof google.cloud.bigquery.v2 + * @interface IListRowAccessPoliciesResponse + * @property {Array.|null} [rowAccessPolicies] ListRowAccessPoliciesResponse rowAccessPolicies + * @property {string|null} [nextPageToken] ListRowAccessPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListRowAccessPoliciesResponse. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListRowAccessPoliciesResponse. + * @implements IListRowAccessPoliciesResponse + * @constructor + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesResponse=} [properties] Properties to set + */ + function ListRowAccessPoliciesResponse(properties) { + this.rowAccessPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRowAccessPoliciesResponse rowAccessPolicies. + * @member {Array.} rowAccessPolicies + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @instance + */ + ListRowAccessPoliciesResponse.prototype.rowAccessPolicies = $util.emptyArray; + + /** + * ListRowAccessPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @instance + */ + ListRowAccessPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRowAccessPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} ListRowAccessPoliciesResponse instance + */ + ListRowAccessPoliciesResponse.create = function create(properties) { + return new ListRowAccessPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListRowAccessPoliciesResponse message. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesResponse} message ListRowAccessPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRowAccessPoliciesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.rowAccessPolicies != null && message.rowAccessPolicies.length) + for (var i = 0; i < message.rowAccessPolicies.length; ++i) + $root.google.cloud.bigquery.v2.RowAccessPolicy.encode(message.rowAccessPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRowAccessPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {google.cloud.bigquery.v2.IListRowAccessPoliciesResponse} message ListRowAccessPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRowAccessPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListRowAccessPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} ListRowAccessPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRowAccessPoliciesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListRowAccessPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rowAccessPolicies && message.rowAccessPolicies.length)) + message.rowAccessPolicies = []; + message.rowAccessPolicies.push($root.google.cloud.bigquery.v2.RowAccessPolicy.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListRowAccessPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} ListRowAccessPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRowAccessPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRowAccessPoliciesResponse message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRowAccessPoliciesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rowAccessPolicies != null && Object.hasOwnProperty.call(message, "rowAccessPolicies")) { + if (!Array.isArray(message.rowAccessPolicies)) + return "rowAccessPolicies: array expected"; + for (var i = 0; i < message.rowAccessPolicies.length; ++i) { + var error = $root.google.cloud.bigquery.v2.RowAccessPolicy.verify(message.rowAccessPolicies[i], long + 1); + if (error) + return "rowAccessPolicies." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRowAccessPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} ListRowAccessPoliciesResponse + */ + ListRowAccessPoliciesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListRowAccessPoliciesResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListRowAccessPoliciesResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListRowAccessPoliciesResponse(); + if (object.rowAccessPolicies) { + if (!Array.isArray(object.rowAccessPolicies)) + throw TypeError(".google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.rowAccessPolicies: array expected"); + message.rowAccessPolicies = []; + for (var i = 0; i < object.rowAccessPolicies.length; ++i) { + if (!$util.isObject(object.rowAccessPolicies[i])) + throw TypeError(".google.cloud.bigquery.v2.ListRowAccessPoliciesResponse.rowAccessPolicies: object expected"); + message.rowAccessPolicies[i] = $root.google.cloud.bigquery.v2.RowAccessPolicy.fromObject(object.rowAccessPolicies[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRowAccessPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {google.cloud.bigquery.v2.ListRowAccessPoliciesResponse} message ListRowAccessPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRowAccessPoliciesResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.rowAccessPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.rowAccessPolicies && message.rowAccessPolicies.length) { + object.rowAccessPolicies = []; + for (var j = 0; j < message.rowAccessPolicies.length; ++j) + object.rowAccessPolicies[j] = $root.google.cloud.bigquery.v2.RowAccessPolicy.toObject(message.rowAccessPolicies[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRowAccessPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListRowAccessPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRowAccessPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListRowAccessPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRowAccessPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListRowAccessPoliciesResponse"; + }; + + return ListRowAccessPoliciesResponse; + })(); + + v2.GetRowAccessPolicyRequest = (function() { + + /** + * Properties of a GetRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetRowAccessPolicyRequest + * @property {string|null} [projectId] GetRowAccessPolicyRequest projectId + * @property {string|null} [datasetId] GetRowAccessPolicyRequest datasetId + * @property {string|null} [tableId] GetRowAccessPolicyRequest tableId + * @property {string|null} [policyId] GetRowAccessPolicyRequest policyId + */ + + /** + * Constructs a new GetRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetRowAccessPolicyRequest. + * @implements IGetRowAccessPolicyRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest=} [properties] Properties to set + */ + function GetRowAccessPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRowAccessPolicyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @instance + */ + GetRowAccessPolicyRequest.prototype.projectId = ""; + + /** + * GetRowAccessPolicyRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @instance + */ + GetRowAccessPolicyRequest.prototype.datasetId = ""; + + /** + * GetRowAccessPolicyRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @instance + */ + GetRowAccessPolicyRequest.prototype.tableId = ""; + + /** + * GetRowAccessPolicyRequest policyId. + * @member {string} policyId + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @instance + */ + GetRowAccessPolicyRequest.prototype.policyId = ""; + + /** + * Creates a new GetRowAccessPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetRowAccessPolicyRequest} GetRowAccessPolicyRequest instance + */ + GetRowAccessPolicyRequest.create = function create(properties) { + return new GetRowAccessPolicyRequest(properties); + }; + + /** + * Encodes the specified GetRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetRowAccessPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest} message GetRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRowAccessPolicyRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyId); + return writer; + }; + + /** + * Encodes the specified GetRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetRowAccessPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IGetRowAccessPolicyRequest} message GetRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRowAccessPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetRowAccessPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetRowAccessPolicyRequest} GetRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRowAccessPolicyRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.policyId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetRowAccessPolicyRequest} GetRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRowAccessPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRowAccessPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRowAccessPolicyRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + if (!$util.isString(message.policyId)) + return "policyId: string expected"; + return null; + }; + + /** + * Creates a GetRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetRowAccessPolicyRequest} GetRowAccessPolicyRequest + */ + GetRowAccessPolicyRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetRowAccessPolicyRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetRowAccessPolicyRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.policyId != null) + message.policyId = String(object.policyId); + return message; + }; + + /** + * Creates a plain object from a GetRowAccessPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.GetRowAccessPolicyRequest} message GetRowAccessPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRowAccessPolicyRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.policyId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + object.policyId = message.policyId; + return object; + }; + + /** + * Converts this GetRowAccessPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetRowAccessPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRowAccessPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetRowAccessPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRowAccessPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetRowAccessPolicyRequest"; + }; + + return GetRowAccessPolicyRequest; + })(); + + v2.CreateRowAccessPolicyRequest = (function() { + + /** + * Properties of a CreateRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @interface ICreateRowAccessPolicyRequest + * @property {string|null} [projectId] CreateRowAccessPolicyRequest projectId + * @property {string|null} [datasetId] CreateRowAccessPolicyRequest datasetId + * @property {string|null} [tableId] CreateRowAccessPolicyRequest tableId + * @property {google.cloud.bigquery.v2.IRowAccessPolicy|null} [rowAccessPolicy] CreateRowAccessPolicyRequest rowAccessPolicy + */ + + /** + * Constructs a new CreateRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a CreateRowAccessPolicyRequest. + * @implements ICreateRowAccessPolicyRequest + * @constructor + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest=} [properties] Properties to set + */ + function CreateRowAccessPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRowAccessPolicyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @instance + */ + CreateRowAccessPolicyRequest.prototype.projectId = ""; + + /** + * CreateRowAccessPolicyRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @instance + */ + CreateRowAccessPolicyRequest.prototype.datasetId = ""; + + /** + * CreateRowAccessPolicyRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @instance + */ + CreateRowAccessPolicyRequest.prototype.tableId = ""; + + /** + * CreateRowAccessPolicyRequest rowAccessPolicy. + * @member {google.cloud.bigquery.v2.IRowAccessPolicy|null|undefined} rowAccessPolicy + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @instance + */ + CreateRowAccessPolicyRequest.prototype.rowAccessPolicy = null; + + /** + * Creates a new CreateRowAccessPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.CreateRowAccessPolicyRequest} CreateRowAccessPolicyRequest instance + */ + CreateRowAccessPolicyRequest.create = function create(properties) { + return new CreateRowAccessPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.CreateRowAccessPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest} message CreateRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRowAccessPolicyRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) + $root.google.cloud.bigquery.v2.RowAccessPolicy.encode(message.rowAccessPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CreateRowAccessPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest} message CreateRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRowAccessPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateRowAccessPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.CreateRowAccessPolicyRequest} CreateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRowAccessPolicyRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.CreateRowAccessPolicyRequest} CreateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRowAccessPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRowAccessPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRowAccessPolicyRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) { + var error = $root.google.cloud.bigquery.v2.RowAccessPolicy.verify(message.rowAccessPolicy, long + 1); + if (error) + return "rowAccessPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.CreateRowAccessPolicyRequest} CreateRowAccessPolicyRequest + */ + CreateRowAccessPolicyRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.CreateRowAccessPolicyRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.rowAccessPolicy != null) { + if (!$util.isObject(object.rowAccessPolicy)) + throw TypeError(".google.cloud.bigquery.v2.CreateRowAccessPolicyRequest.rowAccessPolicy: object expected"); + message.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.fromObject(object.rowAccessPolicy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateRowAccessPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.CreateRowAccessPolicyRequest} message CreateRowAccessPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRowAccessPolicyRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.rowAccessPolicy = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) + object.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.toObject(message.rowAccessPolicy, options, q + 1); + return object; + }; + + /** + * Converts this CreateRowAccessPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRowAccessPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRowAccessPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.CreateRowAccessPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRowAccessPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.CreateRowAccessPolicyRequest"; + }; + + return CreateRowAccessPolicyRequest; + })(); + + v2.UpdateRowAccessPolicyRequest = (function() { + + /** + * Properties of an UpdateRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IUpdateRowAccessPolicyRequest + * @property {string|null} [projectId] UpdateRowAccessPolicyRequest projectId + * @property {string|null} [datasetId] UpdateRowAccessPolicyRequest datasetId + * @property {string|null} [tableId] UpdateRowAccessPolicyRequest tableId + * @property {string|null} [policyId] UpdateRowAccessPolicyRequest policyId + * @property {google.cloud.bigquery.v2.IRowAccessPolicy|null} [rowAccessPolicy] UpdateRowAccessPolicyRequest rowAccessPolicy + */ + + /** + * Constructs a new UpdateRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an UpdateRowAccessPolicyRequest. + * @implements IUpdateRowAccessPolicyRequest + * @constructor + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest=} [properties] Properties to set + */ + function UpdateRowAccessPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRowAccessPolicyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + */ + UpdateRowAccessPolicyRequest.prototype.projectId = ""; + + /** + * UpdateRowAccessPolicyRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + */ + UpdateRowAccessPolicyRequest.prototype.datasetId = ""; + + /** + * UpdateRowAccessPolicyRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + */ + UpdateRowAccessPolicyRequest.prototype.tableId = ""; + + /** + * UpdateRowAccessPolicyRequest policyId. + * @member {string} policyId + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + */ + UpdateRowAccessPolicyRequest.prototype.policyId = ""; + + /** + * UpdateRowAccessPolicyRequest rowAccessPolicy. + * @member {google.cloud.bigquery.v2.IRowAccessPolicy|null|undefined} rowAccessPolicy + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + */ + UpdateRowAccessPolicyRequest.prototype.rowAccessPolicy = null; + + /** + * Creates a new UpdateRowAccessPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest} UpdateRowAccessPolicyRequest instance + */ + UpdateRowAccessPolicyRequest.create = function create(properties) { + return new UpdateRowAccessPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest} message UpdateRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRowAccessPolicyRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyId); + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) + $root.google.cloud.bigquery.v2.RowAccessPolicy.encode(message.rowAccessPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest} message UpdateRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRowAccessPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateRowAccessPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest} UpdateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRowAccessPolicyRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.policyId = reader.string(); + break; + } + case 5: { + message.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest} UpdateRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRowAccessPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRowAccessPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRowAccessPolicyRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + if (!$util.isString(message.policyId)) + return "policyId: string expected"; + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) { + var error = $root.google.cloud.bigquery.v2.RowAccessPolicy.verify(message.rowAccessPolicy, long + 1); + if (error) + return "rowAccessPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest} UpdateRowAccessPolicyRequest + */ + UpdateRowAccessPolicyRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.policyId != null) + message.policyId = String(object.policyId); + if (object.rowAccessPolicy != null) { + if (!$util.isObject(object.rowAccessPolicy)) + throw TypeError(".google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest.rowAccessPolicy: object expected"); + message.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.fromObject(object.rowAccessPolicy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRowAccessPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest} message UpdateRowAccessPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRowAccessPolicyRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.policyId = ""; + object.rowAccessPolicy = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + object.policyId = message.policyId; + if (message.rowAccessPolicy != null && Object.hasOwnProperty.call(message, "rowAccessPolicy")) + object.rowAccessPolicy = $root.google.cloud.bigquery.v2.RowAccessPolicy.toObject(message.rowAccessPolicy, options, q + 1); + return object; + }; + + /** + * Converts this UpdateRowAccessPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRowAccessPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRowAccessPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRowAccessPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest"; + }; + + return UpdateRowAccessPolicyRequest; + })(); + + v2.DeleteRowAccessPolicyRequest = (function() { + + /** + * Properties of a DeleteRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteRowAccessPolicyRequest + * @property {string|null} [projectId] DeleteRowAccessPolicyRequest projectId + * @property {string|null} [datasetId] DeleteRowAccessPolicyRequest datasetId + * @property {string|null} [tableId] DeleteRowAccessPolicyRequest tableId + * @property {string|null} [policyId] DeleteRowAccessPolicyRequest policyId + * @property {boolean|null} [force] DeleteRowAccessPolicyRequest force + */ + + /** + * Constructs a new DeleteRowAccessPolicyRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteRowAccessPolicyRequest. + * @implements IDeleteRowAccessPolicyRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest=} [properties] Properties to set + */ + function DeleteRowAccessPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRowAccessPolicyRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + */ + DeleteRowAccessPolicyRequest.prototype.projectId = ""; + + /** + * DeleteRowAccessPolicyRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + */ + DeleteRowAccessPolicyRequest.prototype.datasetId = ""; + + /** + * DeleteRowAccessPolicyRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + */ + DeleteRowAccessPolicyRequest.prototype.tableId = ""; + + /** + * DeleteRowAccessPolicyRequest policyId. + * @member {string} policyId + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + */ + DeleteRowAccessPolicyRequest.prototype.policyId = ""; + + /** + * DeleteRowAccessPolicyRequest force. + * @member {boolean|null|undefined} force + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + */ + DeleteRowAccessPolicyRequest.prototype.force = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DeleteRowAccessPolicyRequest.prototype, "_force", { + get: $util.oneOfGetter($oneOfFields = ["force"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRowAccessPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest} DeleteRowAccessPolicyRequest instance + */ + DeleteRowAccessPolicyRequest.create = function create(properties) { + return new DeleteRowAccessPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteRowAccessPolicyRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest} message DeleteRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRowAccessPolicyRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteRowAccessPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest} message DeleteRowAccessPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRowAccessPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteRowAccessPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest} DeleteRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRowAccessPolicyRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.policyId = reader.string(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRowAccessPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest} DeleteRowAccessPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRowAccessPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRowAccessPolicyRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRowAccessPolicyRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + if (!$util.isString(message.policyId)) + return "policyId: string expected"; + if (message.force != null && Object.hasOwnProperty.call(message, "force")) { + properties._force = 1; + if (typeof message.force !== "boolean") + return "force: boolean expected"; + } + return null; + }; + + /** + * Creates a DeleteRowAccessPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest} DeleteRowAccessPolicyRequest + */ + DeleteRowAccessPolicyRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.policyId != null) + message.policyId = String(object.policyId); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteRowAccessPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest} message DeleteRowAccessPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRowAccessPolicyRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.policyId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.policyId != null && Object.hasOwnProperty.call(message, "policyId")) + object.policyId = message.policyId; + if (message.force != null && Object.hasOwnProperty.call(message, "force")) { + object.force = message.force; + if (options.oneofs) + object._force = "force"; + } + return object; + }; + + /** + * Converts this DeleteRowAccessPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRowAccessPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRowAccessPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRowAccessPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest"; + }; + + return DeleteRowAccessPolicyRequest; + })(); + + v2.BatchDeleteRowAccessPoliciesRequest = (function() { + + /** + * Properties of a BatchDeleteRowAccessPoliciesRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IBatchDeleteRowAccessPoliciesRequest + * @property {string|null} [projectId] BatchDeleteRowAccessPoliciesRequest projectId + * @property {string|null} [datasetId] BatchDeleteRowAccessPoliciesRequest datasetId + * @property {string|null} [tableId] BatchDeleteRowAccessPoliciesRequest tableId + * @property {Array.|null} [policyIds] BatchDeleteRowAccessPoliciesRequest policyIds + * @property {boolean|null} [force] BatchDeleteRowAccessPoliciesRequest force + */ + + /** + * Constructs a new BatchDeleteRowAccessPoliciesRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a BatchDeleteRowAccessPoliciesRequest. + * @implements IBatchDeleteRowAccessPoliciesRequest + * @constructor + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest=} [properties] Properties to set + */ + function BatchDeleteRowAccessPoliciesRequest(properties) { + this.policyIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteRowAccessPoliciesRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + */ + BatchDeleteRowAccessPoliciesRequest.prototype.projectId = ""; + + /** + * BatchDeleteRowAccessPoliciesRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + */ + BatchDeleteRowAccessPoliciesRequest.prototype.datasetId = ""; + + /** + * BatchDeleteRowAccessPoliciesRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + */ + BatchDeleteRowAccessPoliciesRequest.prototype.tableId = ""; + + /** + * BatchDeleteRowAccessPoliciesRequest policyIds. + * @member {Array.} policyIds + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + */ + BatchDeleteRowAccessPoliciesRequest.prototype.policyIds = $util.emptyArray; + + /** + * BatchDeleteRowAccessPoliciesRequest force. + * @member {boolean|null|undefined} force + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + */ + BatchDeleteRowAccessPoliciesRequest.prototype.force = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BatchDeleteRowAccessPoliciesRequest.prototype, "_force", { + get: $util.oneOfGetter($oneOfFields = ["force"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchDeleteRowAccessPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest} BatchDeleteRowAccessPoliciesRequest instance + */ + BatchDeleteRowAccessPoliciesRequest.create = function create(properties) { + return new BatchDeleteRowAccessPoliciesRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteRowAccessPoliciesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest} message BatchDeleteRowAccessPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteRowAccessPoliciesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.policyIds != null && message.policyIds.length) + for (var i = 0; i < message.policyIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.policyIds[i]); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified BatchDeleteRowAccessPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest} message BatchDeleteRowAccessPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteRowAccessPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteRowAccessPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest} BatchDeleteRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteRowAccessPoliciesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + if (!(message.policyIds && message.policyIds.length)) + message.policyIds = []; + message.policyIds.push(reader.string()); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteRowAccessPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest} BatchDeleteRowAccessPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteRowAccessPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteRowAccessPoliciesRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteRowAccessPoliciesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.policyIds != null && Object.hasOwnProperty.call(message, "policyIds")) { + if (!Array.isArray(message.policyIds)) + return "policyIds: array expected"; + for (var i = 0; i < message.policyIds.length; ++i) + if (!$util.isString(message.policyIds[i])) + return "policyIds: string[] expected"; + } + if (message.force != null && Object.hasOwnProperty.call(message, "force")) { + properties._force = 1; + if (typeof message.force !== "boolean") + return "force: boolean expected"; + } + return null; + }; + + /** + * Creates a BatchDeleteRowAccessPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest} BatchDeleteRowAccessPoliciesRequest + */ + BatchDeleteRowAccessPoliciesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.policyIds) { + if (!Array.isArray(object.policyIds)) + throw TypeError(".google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest.policyIds: array expected"); + message.policyIds = []; + for (var i = 0; i < object.policyIds.length; ++i) + message.policyIds[i] = String(object.policyIds[i]); + } + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a BatchDeleteRowAccessPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest} message BatchDeleteRowAccessPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteRowAccessPoliciesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.policyIds = []; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.policyIds && message.policyIds.length) { + object.policyIds = []; + for (var j = 0; j < message.policyIds.length; ++j) + object.policyIds[j] = message.policyIds[j]; + } + if (message.force != null && Object.hasOwnProperty.call(message, "force")) { + object.force = message.force; + if (options.oneofs) + object._force = "force"; + } + return object; + }; + + /** + * Converts this BatchDeleteRowAccessPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteRowAccessPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteRowAccessPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteRowAccessPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest"; + }; + + return BatchDeleteRowAccessPoliciesRequest; + })(); + + v2.RowAccessPolicy = (function() { + + /** + * Properties of a RowAccessPolicy. + * @memberof google.cloud.bigquery.v2 + * @interface IRowAccessPolicy + * @property {string|null} [etag] RowAccessPolicy etag + * @property {google.cloud.bigquery.v2.IRowAccessPolicyReference|null} [rowAccessPolicyReference] RowAccessPolicy rowAccessPolicyReference + * @property {string|null} [filterPredicate] RowAccessPolicy filterPredicate + * @property {google.protobuf.ITimestamp|null} [creationTime] RowAccessPolicy creationTime + * @property {google.protobuf.ITimestamp|null} [lastModifiedTime] RowAccessPolicy lastModifiedTime + * @property {Array.|null} [grantees] RowAccessPolicy grantees + */ + + /** + * Constructs a new RowAccessPolicy. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a RowAccessPolicy. + * @implements IRowAccessPolicy + * @constructor + * @param {google.cloud.bigquery.v2.IRowAccessPolicy=} [properties] Properties to set + */ + function RowAccessPolicy(properties) { + this.grantees = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowAccessPolicy etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.etag = ""; + + /** + * RowAccessPolicy rowAccessPolicyReference. + * @member {google.cloud.bigquery.v2.IRowAccessPolicyReference|null|undefined} rowAccessPolicyReference + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.rowAccessPolicyReference = null; + + /** + * RowAccessPolicy filterPredicate. + * @member {string} filterPredicate + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.filterPredicate = ""; + + /** + * RowAccessPolicy creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.creationTime = null; + + /** + * RowAccessPolicy lastModifiedTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastModifiedTime + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.lastModifiedTime = null; + + /** + * RowAccessPolicy grantees. + * @member {Array.} grantees + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + */ + RowAccessPolicy.prototype.grantees = $util.emptyArray; + + /** + * Creates a new RowAccessPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicy=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.RowAccessPolicy} RowAccessPolicy instance + */ + RowAccessPolicy.create = function create(properties) { + return new RowAccessPolicy(properties); + }; + + /** + * Encodes the specified RowAccessPolicy message. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicy} message RowAccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAccessPolicy.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.etag); + if (message.rowAccessPolicyReference != null && Object.hasOwnProperty.call(message, "rowAccessPolicyReference")) + $root.google.cloud.bigquery.v2.RowAccessPolicyReference.encode(message.rowAccessPolicyReference, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.filterPredicate != null && Object.hasOwnProperty.call(message, "filterPredicate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filterPredicate); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + $root.google.protobuf.Timestamp.encode(message.lastModifiedTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.grantees != null && message.grantees.length) + for (var i = 0; i < message.grantees.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.grantees[i]); + return writer; + }; + + /** + * Encodes the specified RowAccessPolicy message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.RowAccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {google.cloud.bigquery.v2.IRowAccessPolicy} message RowAccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RowAccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.RowAccessPolicy} RowAccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAccessPolicy.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.RowAccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.etag = reader.string(); + break; + } + case 2: { + message.rowAccessPolicyReference = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.filterPredicate = reader.string(); + break; + } + case 4: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.lastModifiedTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + if (!(message.grantees && message.grantees.length)) + message.grantees = []; + message.grantees.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RowAccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.RowAccessPolicy} RowAccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowAccessPolicy message. + * @function verify + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowAccessPolicy.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.rowAccessPolicyReference != null && Object.hasOwnProperty.call(message, "rowAccessPolicyReference")) { + var error = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.verify(message.rowAccessPolicyReference, long + 1); + if (error) + return "rowAccessPolicyReference." + error; + } + if (message.filterPredicate != null && Object.hasOwnProperty.call(message, "filterPredicate")) + if (!$util.isString(message.filterPredicate)) + return "filterPredicate: string expected"; + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime, long + 1); + if (error) + return "creationTime." + error; + } + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastModifiedTime, long + 1); + if (error) + return "lastModifiedTime." + error; + } + if (message.grantees != null && Object.hasOwnProperty.call(message, "grantees")) { + if (!Array.isArray(message.grantees)) + return "grantees: array expected"; + for (var i = 0; i < message.grantees.length; ++i) + if (!$util.isString(message.grantees[i])) + return "grantees: string[] expected"; + } + return null; + }; + + /** + * Creates a RowAccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.RowAccessPolicy} RowAccessPolicy + */ + RowAccessPolicy.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.RowAccessPolicy) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicy: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.RowAccessPolicy(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.rowAccessPolicyReference != null) { + if (!$util.isObject(object.rowAccessPolicyReference)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicy.rowAccessPolicyReference: object expected"); + message.rowAccessPolicyReference = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.fromObject(object.rowAccessPolicyReference, long + 1); + } + if (object.filterPredicate != null) + message.filterPredicate = String(object.filterPredicate); + if (object.creationTime != null) { + if (!$util.isObject(object.creationTime)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicy.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime, long + 1); + } + if (object.lastModifiedTime != null) { + if (!$util.isObject(object.lastModifiedTime)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicy.lastModifiedTime: object expected"); + message.lastModifiedTime = $root.google.protobuf.Timestamp.fromObject(object.lastModifiedTime, long + 1); + } + if (object.grantees) { + if (!Array.isArray(object.grantees)) + throw TypeError(".google.cloud.bigquery.v2.RowAccessPolicy.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) + message.grantees[i] = String(object.grantees[i]); + } + return message; + }; + + /** + * Creates a plain object from a RowAccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {google.cloud.bigquery.v2.RowAccessPolicy} message RowAccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowAccessPolicy.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.grantees = []; + if (options.defaults) { + object.etag = ""; + object.rowAccessPolicyReference = null; + object.filterPredicate = ""; + object.creationTime = null; + object.lastModifiedTime = null; + } + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.rowAccessPolicyReference != null && Object.hasOwnProperty.call(message, "rowAccessPolicyReference")) + object.rowAccessPolicyReference = $root.google.cloud.bigquery.v2.RowAccessPolicyReference.toObject(message.rowAccessPolicyReference, options, q + 1); + if (message.filterPredicate != null && Object.hasOwnProperty.call(message, "filterPredicate")) + object.filterPredicate = message.filterPredicate; + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options, q + 1); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + object.lastModifiedTime = $root.google.protobuf.Timestamp.toObject(message.lastModifiedTime, options, q + 1); + if (message.grantees && message.grantees.length) { + object.grantees = []; + for (var j = 0; j < message.grantees.length; ++j) + object.grantees[j] = message.grantees[j]; + } + return object; + }; + + /** + * Converts this RowAccessPolicy to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @instance + * @returns {Object.} JSON object + */ + RowAccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowAccessPolicy + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.RowAccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowAccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.RowAccessPolicy"; + }; + + return RowAccessPolicy; + })(); + + v2.TableService = (function() { + + /** + * Constructs a new TableService service. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TableService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TableService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TableService; + + /** + * Creates new TableService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.v2.TableService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TableService} RPC service. Useful where requests and/or responses are streamed. + */ + TableService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|getTable}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef GetTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Table} [response] Table + */ + + /** + * Calls GetTable. + * @function getTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IGetTableRequest} request GetTableRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.GetTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.getTable = function getTable(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getTable, $root.google.cloud.bigquery.v2.GetTableRequest, $root.google.cloud.bigquery.v2.Table, request, callback); + }, "name", { value: "GetTable" }); + + /** + * Calls GetTable. + * @function getTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IGetTableRequest} request GetTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|insertTable}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef InsertTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Table} [response] Table + */ + + /** + * Calls InsertTable. + * @function insertTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IInsertTableRequest} request InsertTableRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.InsertTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.insertTable = function insertTable(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insertTable, $root.google.cloud.bigquery.v2.InsertTableRequest, $root.google.cloud.bigquery.v2.Table, request, callback); + }, "name", { value: "InsertTable" }); + + /** + * Calls InsertTable. + * @function insertTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IInsertTableRequest} request InsertTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|patchTable}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef PatchTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Table} [response] Table + */ + + /** + * Calls PatchTable. + * @function patchTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} request UpdateOrPatchTableRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.PatchTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.patchTable = function patchTable(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patchTable, $root.google.cloud.bigquery.v2.UpdateOrPatchTableRequest, $root.google.cloud.bigquery.v2.Table, request, callback); + }, "name", { value: "PatchTable" }); + + /** + * Calls PatchTable. + * @function patchTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} request UpdateOrPatchTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|updateTable}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef UpdateTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.Table} [response] Table + */ + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} request UpdateOrPatchTableRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.UpdateTableCallback} callback Node-style callback called with the error, if any, and Table + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.updateTable = function updateTable(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateTable, $root.google.cloud.bigquery.v2.UpdateOrPatchTableRequest, $root.google.cloud.bigquery.v2.Table, request, callback); + }, "name", { value: "UpdateTable" }); + + /** + * Calls UpdateTable. + * @function updateTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} request UpdateOrPatchTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|deleteTable}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef DeleteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.DeleteTableCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.deleteTable = function deleteTable(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteTable, $root.google.cloud.bigquery.v2.DeleteTableRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTable" }); + + /** + * Calls DeleteTable. + * @function deleteTable + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IDeleteTableRequest} request DeleteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.v2.TableService|listTables}. + * @memberof google.cloud.bigquery.v2.TableService + * @typedef ListTablesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.v2.TableList} [response] TableList + */ + + /** + * Calls ListTables. + * @function listTables + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @param {google.cloud.bigquery.v2.TableService.ListTablesCallback} callback Node-style callback called with the error, if any, and TableList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TableService.prototype.listTables = function listTables(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listTables, $root.google.cloud.bigquery.v2.ListTablesRequest, $root.google.cloud.bigquery.v2.TableList, request, callback); + }, "name", { value: "ListTables" }); + + /** + * Calls ListTables. + * @function listTables + * @memberof google.cloud.bigquery.v2.TableService + * @instance + * @param {google.cloud.bigquery.v2.IListTablesRequest} request ListTablesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TableService; + })(); + + v2.TableReplicationInfo = (function() { + + /** + * Properties of a TableReplicationInfo. + * @memberof google.cloud.bigquery.v2 + * @interface ITableReplicationInfo + * @property {google.cloud.bigquery.v2.ITableReference|null} [sourceTable] TableReplicationInfo sourceTable + * @property {number|Long|null} [replicationIntervalMs] TableReplicationInfo replicationIntervalMs + * @property {number|Long|null} [replicatedSourceLastRefreshTime] TableReplicationInfo replicatedSourceLastRefreshTime + * @property {google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus|null} [replicationStatus] TableReplicationInfo replicationStatus + * @property {google.cloud.bigquery.v2.IErrorProto|null} [replicationError] TableReplicationInfo replicationError + */ + + /** + * Constructs a new TableReplicationInfo. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableReplicationInfo. + * @implements ITableReplicationInfo + * @constructor + * @param {google.cloud.bigquery.v2.ITableReplicationInfo=} [properties] Properties to set + */ + function TableReplicationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableReplicationInfo sourceTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} sourceTable + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + */ + TableReplicationInfo.prototype.sourceTable = null; + + /** + * TableReplicationInfo replicationIntervalMs. + * @member {number|Long} replicationIntervalMs + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + */ + TableReplicationInfo.prototype.replicationIntervalMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableReplicationInfo replicatedSourceLastRefreshTime. + * @member {number|Long} replicatedSourceLastRefreshTime + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + */ + TableReplicationInfo.prototype.replicatedSourceLastRefreshTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableReplicationInfo replicationStatus. + * @member {google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus} replicationStatus + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + */ + TableReplicationInfo.prototype.replicationStatus = 0; + + /** + * TableReplicationInfo replicationError. + * @member {google.cloud.bigquery.v2.IErrorProto|null|undefined} replicationError + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + */ + TableReplicationInfo.prototype.replicationError = null; + + /** + * Creates a new TableReplicationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {google.cloud.bigquery.v2.ITableReplicationInfo=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableReplicationInfo} TableReplicationInfo instance + */ + TableReplicationInfo.create = function create(properties) { + return new TableReplicationInfo(properties); + }; + + /** + * Encodes the specified TableReplicationInfo message. Does not implicitly {@link google.cloud.bigquery.v2.TableReplicationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {google.cloud.bigquery.v2.ITableReplicationInfo} message TableReplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReplicationInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.sourceTable, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.replicationIntervalMs != null && Object.hasOwnProperty.call(message, "replicationIntervalMs")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.replicationIntervalMs); + if (message.replicatedSourceLastRefreshTime != null && Object.hasOwnProperty.call(message, "replicatedSourceLastRefreshTime")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.replicatedSourceLastRefreshTime); + if (message.replicationStatus != null && Object.hasOwnProperty.call(message, "replicationStatus")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.replicationStatus); + if (message.replicationError != null && Object.hasOwnProperty.call(message, "replicationError")) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.replicationError, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableReplicationInfo message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableReplicationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {google.cloud.bigquery.v2.ITableReplicationInfo} message TableReplicationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReplicationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableReplicationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableReplicationInfo} TableReplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReplicationInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableReplicationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.replicationIntervalMs = reader.int64(); + break; + } + case 3: { + message.replicatedSourceLastRefreshTime = reader.int64(); + break; + } + case 4: { + message.replicationStatus = reader.int32(); + break; + } + case 5: { + message.replicationError = $root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableReplicationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableReplicationInfo} TableReplicationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReplicationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReplicationInfo message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReplicationInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.sourceTable, long + 1); + if (error) + return "sourceTable." + error; + } + if (message.replicationIntervalMs != null && Object.hasOwnProperty.call(message, "replicationIntervalMs")) + if (!$util.isInteger(message.replicationIntervalMs) && !(message.replicationIntervalMs && $util.isInteger(message.replicationIntervalMs.low) && $util.isInteger(message.replicationIntervalMs.high))) + return "replicationIntervalMs: integer|Long expected"; + if (message.replicatedSourceLastRefreshTime != null && Object.hasOwnProperty.call(message, "replicatedSourceLastRefreshTime")) + if (!$util.isInteger(message.replicatedSourceLastRefreshTime) && !(message.replicatedSourceLastRefreshTime && $util.isInteger(message.replicatedSourceLastRefreshTime.low) && $util.isInteger(message.replicatedSourceLastRefreshTime.high))) + return "replicatedSourceLastRefreshTime: integer|Long expected"; + if (message.replicationStatus != null && Object.hasOwnProperty.call(message, "replicationStatus")) + switch (message.replicationStatus) { + default: + return "replicationStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.replicationError != null && Object.hasOwnProperty.call(message, "replicationError")) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.replicationError, long + 1); + if (error) + return "replicationError." + error; + } + return null; + }; + + /** + * Creates a TableReplicationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableReplicationInfo} TableReplicationInfo + */ + TableReplicationInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableReplicationInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableReplicationInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableReplicationInfo(); + if (object.sourceTable != null) { + if (!$util.isObject(object.sourceTable)) + throw TypeError(".google.cloud.bigquery.v2.TableReplicationInfo.sourceTable: object expected"); + message.sourceTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.sourceTable, long + 1); + } + if (object.replicationIntervalMs != null) + if ($util.Long) + message.replicationIntervalMs = $util.Long.fromValue(object.replicationIntervalMs, false); + else if (typeof object.replicationIntervalMs === "string") + message.replicationIntervalMs = parseInt(object.replicationIntervalMs, 10); + else if (typeof object.replicationIntervalMs === "number") + message.replicationIntervalMs = object.replicationIntervalMs; + else if (typeof object.replicationIntervalMs === "object") + message.replicationIntervalMs = new $util.LongBits(object.replicationIntervalMs.low >>> 0, object.replicationIntervalMs.high >>> 0).toNumber(); + if (object.replicatedSourceLastRefreshTime != null) + if ($util.Long) + message.replicatedSourceLastRefreshTime = $util.Long.fromValue(object.replicatedSourceLastRefreshTime, false); + else if (typeof object.replicatedSourceLastRefreshTime === "string") + message.replicatedSourceLastRefreshTime = parseInt(object.replicatedSourceLastRefreshTime, 10); + else if (typeof object.replicatedSourceLastRefreshTime === "number") + message.replicatedSourceLastRefreshTime = object.replicatedSourceLastRefreshTime; + else if (typeof object.replicatedSourceLastRefreshTime === "object") + message.replicatedSourceLastRefreshTime = new $util.LongBits(object.replicatedSourceLastRefreshTime.low >>> 0, object.replicatedSourceLastRefreshTime.high >>> 0).toNumber(); + switch (object.replicationStatus) { + default: + if (typeof object.replicationStatus === "number") { + message.replicationStatus = object.replicationStatus; + break; + } + break; + case "REPLICATION_STATUS_UNSPECIFIED": + case 0: + message.replicationStatus = 0; + break; + case "ACTIVE": + case 1: + message.replicationStatus = 1; + break; + case "SOURCE_DELETED": + case 2: + message.replicationStatus = 2; + break; + case "PERMISSION_DENIED": + case 3: + message.replicationStatus = 3; + break; + case "UNSUPPORTED_CONFIGURATION": + case 4: + message.replicationStatus = 4; + break; + } + if (object.replicationError != null) { + if (!$util.isObject(object.replicationError)) + throw TypeError(".google.cloud.bigquery.v2.TableReplicationInfo.replicationError: object expected"); + message.replicationError = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.replicationError, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TableReplicationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {google.cloud.bigquery.v2.TableReplicationInfo} message TableReplicationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReplicationInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.sourceTable = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.replicationIntervalMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.replicationIntervalMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.replicatedSourceLastRefreshTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.replicatedSourceLastRefreshTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.replicationStatus = options.enums === String ? "REPLICATION_STATUS_UNSPECIFIED" : 0; + object.replicationError = null; + } + if (message.sourceTable != null && Object.hasOwnProperty.call(message, "sourceTable")) + object.sourceTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.sourceTable, options, q + 1); + if (message.replicationIntervalMs != null && Object.hasOwnProperty.call(message, "replicationIntervalMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.replicationIntervalMs = typeof message.replicationIntervalMs === "number" ? BigInt(message.replicationIntervalMs) : $util.Long.fromBits(message.replicationIntervalMs.low >>> 0, message.replicationIntervalMs.high >>> 0, false).toBigInt(); + else if (typeof message.replicationIntervalMs === "number") + object.replicationIntervalMs = options.longs === String ? String(message.replicationIntervalMs) : message.replicationIntervalMs; + else + object.replicationIntervalMs = options.longs === String ? $util.Long.prototype.toString.call(message.replicationIntervalMs) : options.longs === Number ? new $util.LongBits(message.replicationIntervalMs.low >>> 0, message.replicationIntervalMs.high >>> 0).toNumber() : message.replicationIntervalMs; + if (message.replicatedSourceLastRefreshTime != null && Object.hasOwnProperty.call(message, "replicatedSourceLastRefreshTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.replicatedSourceLastRefreshTime = typeof message.replicatedSourceLastRefreshTime === "number" ? BigInt(message.replicatedSourceLastRefreshTime) : $util.Long.fromBits(message.replicatedSourceLastRefreshTime.low >>> 0, message.replicatedSourceLastRefreshTime.high >>> 0, false).toBigInt(); + else if (typeof message.replicatedSourceLastRefreshTime === "number") + object.replicatedSourceLastRefreshTime = options.longs === String ? String(message.replicatedSourceLastRefreshTime) : message.replicatedSourceLastRefreshTime; + else + object.replicatedSourceLastRefreshTime = options.longs === String ? $util.Long.prototype.toString.call(message.replicatedSourceLastRefreshTime) : options.longs === Number ? new $util.LongBits(message.replicatedSourceLastRefreshTime.low >>> 0, message.replicatedSourceLastRefreshTime.high >>> 0).toNumber() : message.replicatedSourceLastRefreshTime; + if (message.replicationStatus != null && Object.hasOwnProperty.call(message, "replicationStatus")) + object.replicationStatus = options.enums === String ? $root.google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus[message.replicationStatus] === undefined ? message.replicationStatus : $root.google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus[message.replicationStatus] : message.replicationStatus; + if (message.replicationError != null && Object.hasOwnProperty.call(message, "replicationError")) + object.replicationError = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.replicationError, options, q + 1); + return object; + }; + + /** + * Converts this TableReplicationInfo to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @instance + * @returns {Object.} JSON object + */ + TableReplicationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableReplicationInfo + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableReplicationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReplicationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableReplicationInfo"; + }; + + /** + * ReplicationStatus enum. + * @name google.cloud.bigquery.v2.TableReplicationInfo.ReplicationStatus + * @enum {number} + * @property {number} REPLICATION_STATUS_UNSPECIFIED=0 REPLICATION_STATUS_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SOURCE_DELETED=2 SOURCE_DELETED value + * @property {number} PERMISSION_DENIED=3 PERMISSION_DENIED value + * @property {number} UNSUPPORTED_CONFIGURATION=4 UNSUPPORTED_CONFIGURATION value + */ + TableReplicationInfo.ReplicationStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPLICATION_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "SOURCE_DELETED"] = 2; + values[valuesById[3] = "PERMISSION_DENIED"] = 3; + values[valuesById[4] = "UNSUPPORTED_CONFIGURATION"] = 4; + return values; + })(); + + return TableReplicationInfo; + })(); + + v2.ViewDefinition = (function() { + + /** + * Properties of a ViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface IViewDefinition + * @property {string|null} [query] ViewDefinition query + * @property {Array.|null} [userDefinedFunctionResources] ViewDefinition userDefinedFunctionResources + * @property {google.protobuf.IBoolValue|null} [useLegacySql] ViewDefinition useLegacySql + * @property {boolean|null} [useExplicitColumnNames] ViewDefinition useExplicitColumnNames + * @property {google.cloud.bigquery.v2.IPrivacyPolicy|null} [privacyPolicy] ViewDefinition privacyPolicy + * @property {Array.|null} [foreignDefinitions] ViewDefinition foreignDefinitions + */ + + /** + * Constructs a new ViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ViewDefinition. + * @implements IViewDefinition + * @constructor + * @param {google.cloud.bigquery.v2.IViewDefinition=} [properties] Properties to set + */ + function ViewDefinition(properties) { + this.userDefinedFunctionResources = []; + this.foreignDefinitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViewDefinition query. + * @member {string} query + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.query = ""; + + /** + * ViewDefinition userDefinedFunctionResources. + * @member {Array.} userDefinedFunctionResources + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.userDefinedFunctionResources = $util.emptyArray; + + /** + * ViewDefinition useLegacySql. + * @member {google.protobuf.IBoolValue|null|undefined} useLegacySql + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.useLegacySql = null; + + /** + * ViewDefinition useExplicitColumnNames. + * @member {boolean} useExplicitColumnNames + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.useExplicitColumnNames = false; + + /** + * ViewDefinition privacyPolicy. + * @member {google.cloud.bigquery.v2.IPrivacyPolicy|null|undefined} privacyPolicy + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.privacyPolicy = null; + + /** + * ViewDefinition foreignDefinitions. + * @member {Array.} foreignDefinitions + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + */ + ViewDefinition.prototype.foreignDefinitions = $util.emptyArray; + + /** + * Creates a new ViewDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IViewDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ViewDefinition} ViewDefinition instance + */ + ViewDefinition.create = function create(properties) { + return new ViewDefinition(properties); + }; + + /** + * Encodes the specified ViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.ViewDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IViewDefinition} message ViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.userDefinedFunctionResources != null && message.userDefinedFunctionResources.length) + for (var i = 0; i < message.userDefinedFunctionResources.length; ++i) + $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.encode(message.userDefinedFunctionResources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + $root.google.protobuf.BoolValue.encode(message.useLegacySql, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.useExplicitColumnNames != null && Object.hasOwnProperty.call(message, "useExplicitColumnNames")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useExplicitColumnNames); + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) + $root.google.cloud.bigquery.v2.PrivacyPolicy.encode(message.privacyPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.foreignDefinitions != null && message.foreignDefinitions.length) + for (var i = 0; i < message.foreignDefinitions.length; ++i) + $root.google.cloud.bigquery.v2.ForeignViewDefinition.encode(message.foreignDefinitions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ViewDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IViewDefinition} message ViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ViewDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ViewDefinition} ViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ViewDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + if (!(message.userDefinedFunctionResources && message.userDefinedFunctionResources.length)) + message.userDefinedFunctionResources = []; + message.userDefinedFunctionResources.push($root.google.cloud.bigquery.v2.UserDefinedFunctionResource.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.useLegacySql = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.useExplicitColumnNames = reader.bool(); + break; + } + case 5: { + message.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + if (!(message.foreignDefinitions && message.foreignDefinitions.length)) + message.foreignDefinitions = []; + message.foreignDefinitions.push($root.google.cloud.bigquery.v2.ForeignViewDefinition.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ViewDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ViewDefinition} ViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViewDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViewDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.userDefinedFunctionResources != null && Object.hasOwnProperty.call(message, "userDefinedFunctionResources")) { + if (!Array.isArray(message.userDefinedFunctionResources)) + return "userDefinedFunctionResources: array expected"; + for (var i = 0; i < message.userDefinedFunctionResources.length; ++i) { + var error = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.verify(message.userDefinedFunctionResources[i], long + 1); + if (error) + return "userDefinedFunctionResources." + error; + } + } + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) { + var error = $root.google.protobuf.BoolValue.verify(message.useLegacySql, long + 1); + if (error) + return "useLegacySql." + error; + } + if (message.useExplicitColumnNames != null && Object.hasOwnProperty.call(message, "useExplicitColumnNames")) + if (typeof message.useExplicitColumnNames !== "boolean") + return "useExplicitColumnNames: boolean expected"; + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) { + var error = $root.google.cloud.bigquery.v2.PrivacyPolicy.verify(message.privacyPolicy, long + 1); + if (error) + return "privacyPolicy." + error; + } + if (message.foreignDefinitions != null && Object.hasOwnProperty.call(message, "foreignDefinitions")) { + if (!Array.isArray(message.foreignDefinitions)) + return "foreignDefinitions: array expected"; + for (var i = 0; i < message.foreignDefinitions.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ForeignViewDefinition.verify(message.foreignDefinitions[i], long + 1); + if (error) + return "foreignDefinitions." + error; + } + } + return null; + }; + + /** + * Creates a ViewDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ViewDefinition} ViewDefinition + */ + ViewDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ViewDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ViewDefinition(); + if (object.query != null) + message.query = String(object.query); + if (object.userDefinedFunctionResources) { + if (!Array.isArray(object.userDefinedFunctionResources)) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.userDefinedFunctionResources: array expected"); + message.userDefinedFunctionResources = []; + for (var i = 0; i < object.userDefinedFunctionResources.length; ++i) { + if (!$util.isObject(object.userDefinedFunctionResources[i])) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.userDefinedFunctionResources: object expected"); + message.userDefinedFunctionResources[i] = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.fromObject(object.userDefinedFunctionResources[i], long + 1); + } + } + if (object.useLegacySql != null) { + if (!$util.isObject(object.useLegacySql)) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.useLegacySql: object expected"); + message.useLegacySql = $root.google.protobuf.BoolValue.fromObject(object.useLegacySql, long + 1); + } + if (object.useExplicitColumnNames != null) + message.useExplicitColumnNames = Boolean(object.useExplicitColumnNames); + if (object.privacyPolicy != null) { + if (!$util.isObject(object.privacyPolicy)) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.privacyPolicy: object expected"); + message.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.fromObject(object.privacyPolicy, long + 1); + } + if (object.foreignDefinitions) { + if (!Array.isArray(object.foreignDefinitions)) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.foreignDefinitions: array expected"); + message.foreignDefinitions = []; + for (var i = 0; i < object.foreignDefinitions.length; ++i) { + if (!$util.isObject(object.foreignDefinitions[i])) + throw TypeError(".google.cloud.bigquery.v2.ViewDefinition.foreignDefinitions: object expected"); + message.foreignDefinitions[i] = $root.google.cloud.bigquery.v2.ForeignViewDefinition.fromObject(object.foreignDefinitions[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ViewDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {google.cloud.bigquery.v2.ViewDefinition} message ViewDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViewDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.userDefinedFunctionResources = []; + object.foreignDefinitions = []; + } + if (options.defaults) { + object.query = ""; + object.useLegacySql = null; + object.useExplicitColumnNames = false; + object.privacyPolicy = null; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = message.query; + if (message.userDefinedFunctionResources && message.userDefinedFunctionResources.length) { + object.userDefinedFunctionResources = []; + for (var j = 0; j < message.userDefinedFunctionResources.length; ++j) + object.userDefinedFunctionResources[j] = $root.google.cloud.bigquery.v2.UserDefinedFunctionResource.toObject(message.userDefinedFunctionResources[j], options, q + 1); + } + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + object.useLegacySql = $root.google.protobuf.BoolValue.toObject(message.useLegacySql, options, q + 1); + if (message.useExplicitColumnNames != null && Object.hasOwnProperty.call(message, "useExplicitColumnNames")) + object.useExplicitColumnNames = message.useExplicitColumnNames; + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) + object.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.toObject(message.privacyPolicy, options, q + 1); + if (message.foreignDefinitions && message.foreignDefinitions.length) { + object.foreignDefinitions = []; + for (var j = 0; j < message.foreignDefinitions.length; ++j) + object.foreignDefinitions[j] = $root.google.cloud.bigquery.v2.ForeignViewDefinition.toObject(message.foreignDefinitions[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ViewDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @instance + * @returns {Object.} JSON object + */ + ViewDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViewDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ViewDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViewDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ViewDefinition"; + }; + + return ViewDefinition; + })(); + + v2.ForeignViewDefinition = (function() { + + /** + * Properties of a ForeignViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface IForeignViewDefinition + * @property {string|null} [query] ForeignViewDefinition query + * @property {string|null} [dialect] ForeignViewDefinition dialect + */ + + /** + * Constructs a new ForeignViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ForeignViewDefinition. + * @implements IForeignViewDefinition + * @constructor + * @param {google.cloud.bigquery.v2.IForeignViewDefinition=} [properties] Properties to set + */ + function ForeignViewDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForeignViewDefinition query. + * @member {string} query + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @instance + */ + ForeignViewDefinition.prototype.query = ""; + + /** + * ForeignViewDefinition dialect. + * @member {string} dialect + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @instance + */ + ForeignViewDefinition.prototype.dialect = ""; + + /** + * Creates a new ForeignViewDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IForeignViewDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ForeignViewDefinition} ForeignViewDefinition instance + */ + ForeignViewDefinition.create = function create(properties) { + return new ForeignViewDefinition(properties); + }; + + /** + * Encodes the specified ForeignViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignViewDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IForeignViewDefinition} message ForeignViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignViewDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dialect); + return writer; + }; + + /** + * Encodes the specified ForeignViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignViewDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IForeignViewDefinition} message ForeignViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignViewDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ForeignViewDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ForeignViewDefinition} ForeignViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignViewDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ForeignViewDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 7: { + message.dialect = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForeignViewDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ForeignViewDefinition} ForeignViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignViewDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForeignViewDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForeignViewDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) + if (!$util.isString(message.dialect)) + return "dialect: string expected"; + return null; + }; + + /** + * Creates a ForeignViewDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ForeignViewDefinition} ForeignViewDefinition + */ + ForeignViewDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ForeignViewDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ForeignViewDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ForeignViewDefinition(); + if (object.query != null) + message.query = String(object.query); + if (object.dialect != null) + message.dialect = String(object.dialect); + return message; + }; + + /** + * Creates a plain object from a ForeignViewDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {google.cloud.bigquery.v2.ForeignViewDefinition} message ForeignViewDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForeignViewDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.query = ""; + object.dialect = ""; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = message.query; + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) + object.dialect = message.dialect; + return object; + }; + + /** + * Converts this ForeignViewDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @instance + * @returns {Object.} JSON object + */ + ForeignViewDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForeignViewDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ForeignViewDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForeignViewDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ForeignViewDefinition"; + }; + + return ForeignViewDefinition; + })(); + + v2.MaterializedViewDefinition = (function() { + + /** + * Properties of a MaterializedViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface IMaterializedViewDefinition + * @property {string|null} [query] MaterializedViewDefinition query + * @property {number|Long|null} [lastRefreshTime] MaterializedViewDefinition lastRefreshTime + * @property {google.protobuf.IBoolValue|null} [enableRefresh] MaterializedViewDefinition enableRefresh + * @property {google.protobuf.IUInt64Value|null} [refreshIntervalMs] MaterializedViewDefinition refreshIntervalMs + * @property {google.protobuf.IBoolValue|null} [allowNonIncrementalDefinition] MaterializedViewDefinition allowNonIncrementalDefinition + */ + + /** + * Constructs a new MaterializedViewDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MaterializedViewDefinition. + * @implements IMaterializedViewDefinition + * @constructor + * @param {google.cloud.bigquery.v2.IMaterializedViewDefinition=} [properties] Properties to set + */ + function MaterializedViewDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedViewDefinition query. + * @member {string} query + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + */ + MaterializedViewDefinition.prototype.query = ""; + + /** + * MaterializedViewDefinition lastRefreshTime. + * @member {number|Long} lastRefreshTime + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + */ + MaterializedViewDefinition.prototype.lastRefreshTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * MaterializedViewDefinition enableRefresh. + * @member {google.protobuf.IBoolValue|null|undefined} enableRefresh + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + */ + MaterializedViewDefinition.prototype.enableRefresh = null; + + /** + * MaterializedViewDefinition refreshIntervalMs. + * @member {google.protobuf.IUInt64Value|null|undefined} refreshIntervalMs + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + */ + MaterializedViewDefinition.prototype.refreshIntervalMs = null; + + /** + * MaterializedViewDefinition allowNonIncrementalDefinition. + * @member {google.protobuf.IBoolValue|null|undefined} allowNonIncrementalDefinition + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + */ + MaterializedViewDefinition.prototype.allowNonIncrementalDefinition = null; + + /** + * Creates a new MaterializedViewDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MaterializedViewDefinition} MaterializedViewDefinition instance + */ + MaterializedViewDefinition.create = function create(properties) { + return new MaterializedViewDefinition(properties); + }; + + /** + * Encodes the specified MaterializedViewDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewDefinition} message MaterializedViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.lastRefreshTime != null && Object.hasOwnProperty.call(message, "lastRefreshTime")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.lastRefreshTime); + if (message.enableRefresh != null && Object.hasOwnProperty.call(message, "enableRefresh")) + $root.google.protobuf.BoolValue.encode(message.enableRefresh, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.refreshIntervalMs != null && Object.hasOwnProperty.call(message, "refreshIntervalMs")) + $root.google.protobuf.UInt64Value.encode(message.refreshIntervalMs, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.allowNonIncrementalDefinition != null && Object.hasOwnProperty.call(message, "allowNonIncrementalDefinition")) + $root.google.protobuf.BoolValue.encode(message.allowNonIncrementalDefinition, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaterializedViewDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewDefinition} message MaterializedViewDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MaterializedViewDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MaterializedViewDefinition} MaterializedViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MaterializedViewDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.lastRefreshTime = reader.int64(); + break; + } + case 3: { + message.enableRefresh = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.refreshIntervalMs = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.allowNonIncrementalDefinition = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedViewDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MaterializedViewDefinition} MaterializedViewDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedViewDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedViewDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.lastRefreshTime != null && Object.hasOwnProperty.call(message, "lastRefreshTime")) + if (!$util.isInteger(message.lastRefreshTime) && !(message.lastRefreshTime && $util.isInteger(message.lastRefreshTime.low) && $util.isInteger(message.lastRefreshTime.high))) + return "lastRefreshTime: integer|Long expected"; + if (message.enableRefresh != null && Object.hasOwnProperty.call(message, "enableRefresh")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableRefresh, long + 1); + if (error) + return "enableRefresh." + error; + } + if (message.refreshIntervalMs != null && Object.hasOwnProperty.call(message, "refreshIntervalMs")) { + var error = $root.google.protobuf.UInt64Value.verify(message.refreshIntervalMs, long + 1); + if (error) + return "refreshIntervalMs." + error; + } + if (message.allowNonIncrementalDefinition != null && Object.hasOwnProperty.call(message, "allowNonIncrementalDefinition")) { + var error = $root.google.protobuf.BoolValue.verify(message.allowNonIncrementalDefinition, long + 1); + if (error) + return "allowNonIncrementalDefinition." + error; + } + return null; + }; + + /** + * Creates a MaterializedViewDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MaterializedViewDefinition} MaterializedViewDefinition + */ + MaterializedViewDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MaterializedViewDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MaterializedViewDefinition(); + if (object.query != null) + message.query = String(object.query); + if (object.lastRefreshTime != null) + if ($util.Long) + message.lastRefreshTime = $util.Long.fromValue(object.lastRefreshTime, false); + else if (typeof object.lastRefreshTime === "string") + message.lastRefreshTime = parseInt(object.lastRefreshTime, 10); + else if (typeof object.lastRefreshTime === "number") + message.lastRefreshTime = object.lastRefreshTime; + else if (typeof object.lastRefreshTime === "object") + message.lastRefreshTime = new $util.LongBits(object.lastRefreshTime.low >>> 0, object.lastRefreshTime.high >>> 0).toNumber(); + if (object.enableRefresh != null) { + if (!$util.isObject(object.enableRefresh)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewDefinition.enableRefresh: object expected"); + message.enableRefresh = $root.google.protobuf.BoolValue.fromObject(object.enableRefresh, long + 1); + } + if (object.refreshIntervalMs != null) { + if (!$util.isObject(object.refreshIntervalMs)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewDefinition.refreshIntervalMs: object expected"); + message.refreshIntervalMs = $root.google.protobuf.UInt64Value.fromObject(object.refreshIntervalMs, long + 1); + } + if (object.allowNonIncrementalDefinition != null) { + if (!$util.isObject(object.allowNonIncrementalDefinition)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewDefinition.allowNonIncrementalDefinition: object expected"); + message.allowNonIncrementalDefinition = $root.google.protobuf.BoolValue.fromObject(object.allowNonIncrementalDefinition, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MaterializedViewDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {google.cloud.bigquery.v2.MaterializedViewDefinition} message MaterializedViewDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedViewDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.query = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastRefreshTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.lastRefreshTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.enableRefresh = null; + object.refreshIntervalMs = null; + object.allowNonIncrementalDefinition = null; + } + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = message.query; + if (message.lastRefreshTime != null && Object.hasOwnProperty.call(message, "lastRefreshTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.lastRefreshTime = typeof message.lastRefreshTime === "number" ? BigInt(message.lastRefreshTime) : $util.Long.fromBits(message.lastRefreshTime.low >>> 0, message.lastRefreshTime.high >>> 0, false).toBigInt(); + else if (typeof message.lastRefreshTime === "number") + object.lastRefreshTime = options.longs === String ? String(message.lastRefreshTime) : message.lastRefreshTime; + else + object.lastRefreshTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastRefreshTime) : options.longs === Number ? new $util.LongBits(message.lastRefreshTime.low >>> 0, message.lastRefreshTime.high >>> 0).toNumber() : message.lastRefreshTime; + if (message.enableRefresh != null && Object.hasOwnProperty.call(message, "enableRefresh")) + object.enableRefresh = $root.google.protobuf.BoolValue.toObject(message.enableRefresh, options, q + 1); + if (message.refreshIntervalMs != null && Object.hasOwnProperty.call(message, "refreshIntervalMs")) + object.refreshIntervalMs = $root.google.protobuf.UInt64Value.toObject(message.refreshIntervalMs, options, q + 1); + if (message.allowNonIncrementalDefinition != null && Object.hasOwnProperty.call(message, "allowNonIncrementalDefinition")) + object.allowNonIncrementalDefinition = $root.google.protobuf.BoolValue.toObject(message.allowNonIncrementalDefinition, options, q + 1); + return object; + }; + + /** + * Converts this MaterializedViewDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @instance + * @returns {Object.} JSON object + */ + MaterializedViewDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedViewDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MaterializedViewDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedViewDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MaterializedViewDefinition"; + }; + + return MaterializedViewDefinition; + })(); + + v2.MaterializedViewStatus = (function() { + + /** + * Properties of a MaterializedViewStatus. + * @memberof google.cloud.bigquery.v2 + * @interface IMaterializedViewStatus + * @property {google.protobuf.ITimestamp|null} [refreshWatermark] MaterializedViewStatus refreshWatermark + * @property {google.cloud.bigquery.v2.IErrorProto|null} [lastRefreshStatus] MaterializedViewStatus lastRefreshStatus + */ + + /** + * Constructs a new MaterializedViewStatus. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a MaterializedViewStatus. + * @implements IMaterializedViewStatus + * @constructor + * @param {google.cloud.bigquery.v2.IMaterializedViewStatus=} [properties] Properties to set + */ + function MaterializedViewStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaterializedViewStatus refreshWatermark. + * @member {google.protobuf.ITimestamp|null|undefined} refreshWatermark + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @instance + */ + MaterializedViewStatus.prototype.refreshWatermark = null; + + /** + * MaterializedViewStatus lastRefreshStatus. + * @member {google.cloud.bigquery.v2.IErrorProto|null|undefined} lastRefreshStatus + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @instance + */ + MaterializedViewStatus.prototype.lastRefreshStatus = null; + + /** + * Creates a new MaterializedViewStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.MaterializedViewStatus} MaterializedViewStatus instance + */ + MaterializedViewStatus.create = function create(properties) { + return new MaterializedViewStatus(properties); + }; + + /** + * Encodes the specified MaterializedViewStatus message. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatus} message MaterializedViewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewStatus.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.refreshWatermark != null && Object.hasOwnProperty.call(message, "refreshWatermark")) + $root.google.protobuf.Timestamp.encode(message.refreshWatermark, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.lastRefreshStatus != null && Object.hasOwnProperty.call(message, "lastRefreshStatus")) + $root.google.cloud.bigquery.v2.ErrorProto.encode(message.lastRefreshStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaterializedViewStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.MaterializedViewStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {google.cloud.bigquery.v2.IMaterializedViewStatus} message MaterializedViewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaterializedViewStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MaterializedViewStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.MaterializedViewStatus} MaterializedViewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewStatus.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.MaterializedViewStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.refreshWatermark = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.lastRefreshStatus = $root.google.cloud.bigquery.v2.ErrorProto.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaterializedViewStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.MaterializedViewStatus} MaterializedViewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaterializedViewStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaterializedViewStatus message. + * @function verify + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaterializedViewStatus.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.refreshWatermark != null && Object.hasOwnProperty.call(message, "refreshWatermark")) { + var error = $root.google.protobuf.Timestamp.verify(message.refreshWatermark, long + 1); + if (error) + return "refreshWatermark." + error; + } + if (message.lastRefreshStatus != null && Object.hasOwnProperty.call(message, "lastRefreshStatus")) { + var error = $root.google.cloud.bigquery.v2.ErrorProto.verify(message.lastRefreshStatus, long + 1); + if (error) + return "lastRefreshStatus." + error; + } + return null; + }; + + /** + * Creates a MaterializedViewStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.MaterializedViewStatus} MaterializedViewStatus + */ + MaterializedViewStatus.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.MaterializedViewStatus) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatus: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.MaterializedViewStatus(); + if (object.refreshWatermark != null) { + if (!$util.isObject(object.refreshWatermark)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatus.refreshWatermark: object expected"); + message.refreshWatermark = $root.google.protobuf.Timestamp.fromObject(object.refreshWatermark, long + 1); + } + if (object.lastRefreshStatus != null) { + if (!$util.isObject(object.lastRefreshStatus)) + throw TypeError(".google.cloud.bigquery.v2.MaterializedViewStatus.lastRefreshStatus: object expected"); + message.lastRefreshStatus = $root.google.cloud.bigquery.v2.ErrorProto.fromObject(object.lastRefreshStatus, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MaterializedViewStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {google.cloud.bigquery.v2.MaterializedViewStatus} message MaterializedViewStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaterializedViewStatus.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.refreshWatermark = null; + object.lastRefreshStatus = null; + } + if (message.refreshWatermark != null && Object.hasOwnProperty.call(message, "refreshWatermark")) + object.refreshWatermark = $root.google.protobuf.Timestamp.toObject(message.refreshWatermark, options, q + 1); + if (message.lastRefreshStatus != null && Object.hasOwnProperty.call(message, "lastRefreshStatus")) + object.lastRefreshStatus = $root.google.cloud.bigquery.v2.ErrorProto.toObject(message.lastRefreshStatus, options, q + 1); + return object; + }; + + /** + * Converts this MaterializedViewStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @instance + * @returns {Object.} JSON object + */ + MaterializedViewStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaterializedViewStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.MaterializedViewStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaterializedViewStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.MaterializedViewStatus"; + }; + + return MaterializedViewStatus; + })(); + + v2.SnapshotDefinition = (function() { + + /** + * Properties of a SnapshotDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface ISnapshotDefinition + * @property {google.cloud.bigquery.v2.ITableReference|null} [baseTableReference] SnapshotDefinition baseTableReference + * @property {google.protobuf.ITimestamp|null} [snapshotTime] SnapshotDefinition snapshotTime + */ + + /** + * Constructs a new SnapshotDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a SnapshotDefinition. + * @implements ISnapshotDefinition + * @constructor + * @param {google.cloud.bigquery.v2.ISnapshotDefinition=} [properties] Properties to set + */ + function SnapshotDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotDefinition baseTableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} baseTableReference + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @instance + */ + SnapshotDefinition.prototype.baseTableReference = null; + + /** + * SnapshotDefinition snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @instance + */ + SnapshotDefinition.prototype.snapshotTime = null; + + /** + * Creates a new SnapshotDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {google.cloud.bigquery.v2.ISnapshotDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.SnapshotDefinition} SnapshotDefinition instance + */ + SnapshotDefinition.create = function create(properties) { + return new SnapshotDefinition(properties); + }; + + /** + * Encodes the specified SnapshotDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.SnapshotDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {google.cloud.bigquery.v2.ISnapshotDefinition} message SnapshotDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.baseTableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified SnapshotDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.SnapshotDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {google.cloud.bigquery.v2.ISnapshotDefinition} message SnapshotDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SnapshotDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.SnapshotDefinition} SnapshotDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.SnapshotDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.SnapshotDefinition} SnapshotDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.baseTableReference, long + 1); + if (error) + return "baseTableReference." + error; + } + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime, long + 1); + if (error) + return "snapshotTime." + error; + } + return null; + }; + + /** + * Creates a SnapshotDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.SnapshotDefinition} SnapshotDefinition + */ + SnapshotDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.SnapshotDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.SnapshotDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.SnapshotDefinition(); + if (object.baseTableReference != null) { + if (!$util.isObject(object.baseTableReference)) + throw TypeError(".google.cloud.bigquery.v2.SnapshotDefinition.baseTableReference: object expected"); + message.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.baseTableReference, long + 1); + } + if (object.snapshotTime != null) { + if (!$util.isObject(object.snapshotTime)) + throw TypeError(".google.cloud.bigquery.v2.SnapshotDefinition.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SnapshotDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {google.cloud.bigquery.v2.SnapshotDefinition} message SnapshotDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.baseTableReference = null; + object.snapshotTime = null; + } + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) + object.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.baseTableReference, options, q + 1); + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options, q + 1); + return object; + }; + + /** + * Converts this SnapshotDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @instance + * @returns {Object.} JSON object + */ + SnapshotDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.SnapshotDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.SnapshotDefinition"; + }; + + return SnapshotDefinition; + })(); + + v2.CloneDefinition = (function() { + + /** + * Properties of a CloneDefinition. + * @memberof google.cloud.bigquery.v2 + * @interface ICloneDefinition + * @property {google.cloud.bigquery.v2.ITableReference|null} [baseTableReference] CloneDefinition baseTableReference + * @property {google.protobuf.ITimestamp|null} [cloneTime] CloneDefinition cloneTime + */ + + /** + * Constructs a new CloneDefinition. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a CloneDefinition. + * @implements ICloneDefinition + * @constructor + * @param {google.cloud.bigquery.v2.ICloneDefinition=} [properties] Properties to set + */ + function CloneDefinition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloneDefinition baseTableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} baseTableReference + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @instance + */ + CloneDefinition.prototype.baseTableReference = null; + + /** + * CloneDefinition cloneTime. + * @member {google.protobuf.ITimestamp|null|undefined} cloneTime + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @instance + */ + CloneDefinition.prototype.cloneTime = null; + + /** + * Creates a new CloneDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {google.cloud.bigquery.v2.ICloneDefinition=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.CloneDefinition} CloneDefinition instance + */ + CloneDefinition.create = function create(properties) { + return new CloneDefinition(properties); + }; + + /** + * Encodes the specified CloneDefinition message. Does not implicitly {@link google.cloud.bigquery.v2.CloneDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {google.cloud.bigquery.v2.ICloneDefinition} message CloneDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneDefinition.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.baseTableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.cloneTime != null && Object.hasOwnProperty.call(message, "cloneTime")) + $root.google.protobuf.Timestamp.encode(message.cloneTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloneDefinition message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.CloneDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {google.cloud.bigquery.v2.ICloneDefinition} message CloneDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CloneDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.CloneDefinition} CloneDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneDefinition.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.CloneDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.cloneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CloneDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.CloneDefinition} CloneDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloneDefinition message. + * @function verify + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloneDefinition.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.baseTableReference, long + 1); + if (error) + return "baseTableReference." + error; + } + if (message.cloneTime != null && Object.hasOwnProperty.call(message, "cloneTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.cloneTime, long + 1); + if (error) + return "cloneTime." + error; + } + return null; + }; + + /** + * Creates a CloneDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.CloneDefinition} CloneDefinition + */ + CloneDefinition.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.CloneDefinition) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.CloneDefinition: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.CloneDefinition(); + if (object.baseTableReference != null) { + if (!$util.isObject(object.baseTableReference)) + throw TypeError(".google.cloud.bigquery.v2.CloneDefinition.baseTableReference: object expected"); + message.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.baseTableReference, long + 1); + } + if (object.cloneTime != null) { + if (!$util.isObject(object.cloneTime)) + throw TypeError(".google.cloud.bigquery.v2.CloneDefinition.cloneTime: object expected"); + message.cloneTime = $root.google.protobuf.Timestamp.fromObject(object.cloneTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CloneDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {google.cloud.bigquery.v2.CloneDefinition} message CloneDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloneDefinition.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.baseTableReference = null; + object.cloneTime = null; + } + if (message.baseTableReference != null && Object.hasOwnProperty.call(message, "baseTableReference")) + object.baseTableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.baseTableReference, options, q + 1); + if (message.cloneTime != null && Object.hasOwnProperty.call(message, "cloneTime")) + object.cloneTime = $root.google.protobuf.Timestamp.toObject(message.cloneTime, options, q + 1); + return object; + }; + + /** + * Converts this CloneDefinition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @instance + * @returns {Object.} JSON object + */ + CloneDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloneDefinition + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.CloneDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloneDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.CloneDefinition"; + }; + + return CloneDefinition; + })(); + + v2.Streamingbuffer = (function() { + + /** + * Properties of a Streamingbuffer. + * @memberof google.cloud.bigquery.v2 + * @interface IStreamingbuffer + * @property {number|Long|null} [estimatedBytes] Streamingbuffer estimatedBytes + * @property {number|Long|null} [estimatedRows] Streamingbuffer estimatedRows + * @property {number|Long|null} [oldestEntryTime] Streamingbuffer oldestEntryTime + */ + + /** + * Constructs a new Streamingbuffer. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Streamingbuffer. + * @implements IStreamingbuffer + * @constructor + * @param {google.cloud.bigquery.v2.IStreamingbuffer=} [properties] Properties to set + */ + function Streamingbuffer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Streamingbuffer estimatedBytes. + * @member {number|Long} estimatedBytes + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @instance + */ + Streamingbuffer.prototype.estimatedBytes = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Streamingbuffer estimatedRows. + * @member {number|Long} estimatedRows + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @instance + */ + Streamingbuffer.prototype.estimatedRows = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Streamingbuffer oldestEntryTime. + * @member {number|Long} oldestEntryTime + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @instance + */ + Streamingbuffer.prototype.oldestEntryTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Streamingbuffer instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {google.cloud.bigquery.v2.IStreamingbuffer=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Streamingbuffer} Streamingbuffer instance + */ + Streamingbuffer.create = function create(properties) { + return new Streamingbuffer(properties); + }; + + /** + * Encodes the specified Streamingbuffer message. Does not implicitly {@link google.cloud.bigquery.v2.Streamingbuffer.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {google.cloud.bigquery.v2.IStreamingbuffer} message Streamingbuffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Streamingbuffer.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.estimatedBytes != null && Object.hasOwnProperty.call(message, "estimatedBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.estimatedBytes); + if (message.estimatedRows != null && Object.hasOwnProperty.call(message, "estimatedRows")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.estimatedRows); + if (message.oldestEntryTime != null && Object.hasOwnProperty.call(message, "oldestEntryTime")) + writer.uint32(/* id 3, wireType 1 =*/25).fixed64(message.oldestEntryTime); + return writer; + }; + + /** + * Encodes the specified Streamingbuffer message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Streamingbuffer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {google.cloud.bigquery.v2.IStreamingbuffer} message Streamingbuffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Streamingbuffer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Streamingbuffer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Streamingbuffer} Streamingbuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Streamingbuffer.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Streamingbuffer(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.estimatedBytes = reader.uint64(); + break; + } + case 2: { + message.estimatedRows = reader.uint64(); + break; + } + case 3: { + message.oldestEntryTime = reader.fixed64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Streamingbuffer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Streamingbuffer} Streamingbuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Streamingbuffer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Streamingbuffer message. + * @function verify + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Streamingbuffer.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.estimatedBytes != null && Object.hasOwnProperty.call(message, "estimatedBytes")) + if (!$util.isInteger(message.estimatedBytes) && !(message.estimatedBytes && $util.isInteger(message.estimatedBytes.low) && $util.isInteger(message.estimatedBytes.high))) + return "estimatedBytes: integer|Long expected"; + if (message.estimatedRows != null && Object.hasOwnProperty.call(message, "estimatedRows")) + if (!$util.isInteger(message.estimatedRows) && !(message.estimatedRows && $util.isInteger(message.estimatedRows.low) && $util.isInteger(message.estimatedRows.high))) + return "estimatedRows: integer|Long expected"; + if (message.oldestEntryTime != null && Object.hasOwnProperty.call(message, "oldestEntryTime")) + if (!$util.isInteger(message.oldestEntryTime) && !(message.oldestEntryTime && $util.isInteger(message.oldestEntryTime.low) && $util.isInteger(message.oldestEntryTime.high))) + return "oldestEntryTime: integer|Long expected"; + return null; + }; + + /** + * Creates a Streamingbuffer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Streamingbuffer} Streamingbuffer + */ + Streamingbuffer.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Streamingbuffer) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Streamingbuffer: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Streamingbuffer(); + if (object.estimatedBytes != null) + if ($util.Long) + message.estimatedBytes = $util.Long.fromValue(object.estimatedBytes, true); + else if (typeof object.estimatedBytes === "string") + message.estimatedBytes = parseInt(object.estimatedBytes, 10); + else if (typeof object.estimatedBytes === "number") + message.estimatedBytes = object.estimatedBytes; + else if (typeof object.estimatedBytes === "object") + message.estimatedBytes = new $util.LongBits(object.estimatedBytes.low >>> 0, object.estimatedBytes.high >>> 0).toNumber(true); + if (object.estimatedRows != null) + if ($util.Long) + message.estimatedRows = $util.Long.fromValue(object.estimatedRows, true); + else if (typeof object.estimatedRows === "string") + message.estimatedRows = parseInt(object.estimatedRows, 10); + else if (typeof object.estimatedRows === "number") + message.estimatedRows = object.estimatedRows; + else if (typeof object.estimatedRows === "object") + message.estimatedRows = new $util.LongBits(object.estimatedRows.low >>> 0, object.estimatedRows.high >>> 0).toNumber(true); + if (object.oldestEntryTime != null) + if ($util.Long) + message.oldestEntryTime = $util.Long.fromValue(object.oldestEntryTime, true); + else if (typeof object.oldestEntryTime === "string") + message.oldestEntryTime = parseInt(object.oldestEntryTime, 10); + else if (typeof object.oldestEntryTime === "number") + message.oldestEntryTime = object.oldestEntryTime; + else if (typeof object.oldestEntryTime === "object") + message.oldestEntryTime = new $util.LongBits(object.oldestEntryTime.low >>> 0, object.oldestEntryTime.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Streamingbuffer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {google.cloud.bigquery.v2.Streamingbuffer} message Streamingbuffer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Streamingbuffer.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.estimatedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.estimatedBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.estimatedRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.estimatedRows = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.oldestEntryTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.oldestEntryTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.estimatedBytes != null && Object.hasOwnProperty.call(message, "estimatedBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.estimatedBytes = typeof message.estimatedBytes === "number" ? BigInt(message.estimatedBytes) : $util.Long.fromBits(message.estimatedBytes.low >>> 0, message.estimatedBytes.high >>> 0, true).toBigInt(); + else if (typeof message.estimatedBytes === "number") + object.estimatedBytes = options.longs === String ? String(message.estimatedBytes) : message.estimatedBytes; + else + object.estimatedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedBytes) : options.longs === Number ? new $util.LongBits(message.estimatedBytes.low >>> 0, message.estimatedBytes.high >>> 0).toNumber(true) : message.estimatedBytes; + if (message.estimatedRows != null && Object.hasOwnProperty.call(message, "estimatedRows")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.estimatedRows = typeof message.estimatedRows === "number" ? BigInt(message.estimatedRows) : $util.Long.fromBits(message.estimatedRows.low >>> 0, message.estimatedRows.high >>> 0, true).toBigInt(); + else if (typeof message.estimatedRows === "number") + object.estimatedRows = options.longs === String ? String(message.estimatedRows) : message.estimatedRows; + else + object.estimatedRows = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedRows) : options.longs === Number ? new $util.LongBits(message.estimatedRows.low >>> 0, message.estimatedRows.high >>> 0).toNumber(true) : message.estimatedRows; + if (message.oldestEntryTime != null && Object.hasOwnProperty.call(message, "oldestEntryTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.oldestEntryTime = typeof message.oldestEntryTime === "number" ? BigInt(message.oldestEntryTime) : $util.Long.fromBits(message.oldestEntryTime.low >>> 0, message.oldestEntryTime.high >>> 0, true).toBigInt(); + else if (typeof message.oldestEntryTime === "number") + object.oldestEntryTime = options.longs === String ? String(message.oldestEntryTime) : message.oldestEntryTime; + else + object.oldestEntryTime = options.longs === String ? $util.Long.prototype.toString.call(message.oldestEntryTime) : options.longs === Number ? new $util.LongBits(message.oldestEntryTime.low >>> 0, message.oldestEntryTime.high >>> 0).toNumber(true) : message.oldestEntryTime; + return object; + }; + + /** + * Converts this Streamingbuffer to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @instance + * @returns {Object.} JSON object + */ + Streamingbuffer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Streamingbuffer + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Streamingbuffer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Streamingbuffer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Streamingbuffer"; + }; + + return Streamingbuffer; + })(); + + v2.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.cloud.bigquery.v2 + * @interface ITable + * @property {string|null} [kind] Table kind + * @property {string|null} [etag] Table etag + * @property {string|null} [id] Table id + * @property {string|null} [selfLink] Table selfLink + * @property {google.cloud.bigquery.v2.ITableReference|null} [tableReference] Table tableReference + * @property {google.protobuf.IStringValue|null} [friendlyName] Table friendlyName + * @property {google.protobuf.IStringValue|null} [description] Table description + * @property {Object.|null} [labels] Table labels + * @property {google.cloud.bigquery.v2.ITableSchema|null} [schema] Table schema + * @property {google.cloud.bigquery.v2.ITimePartitioning|null} [timePartitioning] Table timePartitioning + * @property {google.cloud.bigquery.v2.IRangePartitioning|null} [rangePartitioning] Table rangePartitioning + * @property {google.cloud.bigquery.v2.IClustering|null} [clustering] Table clustering + * @property {google.protobuf.IBoolValue|null} [requirePartitionFilter] Table requirePartitionFilter + * @property {google.cloud.bigquery.v2.IPartitioningDefinition|null} [partitionDefinition] Table partitionDefinition + * @property {google.protobuf.IInt64Value|null} [numBytes] Table numBytes + * @property {google.protobuf.IInt64Value|null} [numPhysicalBytes] Table numPhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numLongTermBytes] Table numLongTermBytes + * @property {google.protobuf.IUInt64Value|null} [numRows] Table numRows + * @property {number|Long|null} [creationTime] Table creationTime + * @property {google.protobuf.IInt64Value|null} [expirationTime] Table expirationTime + * @property {number|Long|null} [lastModifiedTime] Table lastModifiedTime + * @property {string|null} [type] Table type + * @property {google.cloud.bigquery.v2.IViewDefinition|null} [view] Table view + * @property {google.cloud.bigquery.v2.IMaterializedViewDefinition|null} [materializedView] Table materializedView + * @property {google.cloud.bigquery.v2.IMaterializedViewStatus|null} [materializedViewStatus] Table materializedViewStatus + * @property {google.cloud.bigquery.v2.IExternalDataConfiguration|null} [externalDataConfiguration] Table externalDataConfiguration + * @property {google.cloud.bigquery.v2.IBigLakeConfiguration|null} [biglakeConfiguration] Table biglakeConfiguration + * @property {google.cloud.bigquery.v2.ManagedTableType|null} [managedTableType] Table managedTableType + * @property {string|null} [location] Table location + * @property {google.cloud.bigquery.v2.IStreamingbuffer|null} [streamingBuffer] Table streamingBuffer + * @property {google.cloud.bigquery.v2.IEncryptionConfiguration|null} [encryptionConfiguration] Table encryptionConfiguration + * @property {google.cloud.bigquery.v2.ISnapshotDefinition|null} [snapshotDefinition] Table snapshotDefinition + * @property {google.protobuf.IStringValue|null} [defaultCollation] Table defaultCollation + * @property {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode|null} [defaultRoundingMode] Table defaultRoundingMode + * @property {google.cloud.bigquery.v2.ICloneDefinition|null} [cloneDefinition] Table cloneDefinition + * @property {google.protobuf.IInt64Value|null} [numTimeTravelPhysicalBytes] Table numTimeTravelPhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numTotalLogicalBytes] Table numTotalLogicalBytes + * @property {google.protobuf.IInt64Value|null} [numActiveLogicalBytes] Table numActiveLogicalBytes + * @property {google.protobuf.IInt64Value|null} [numLongTermLogicalBytes] Table numLongTermLogicalBytes + * @property {google.protobuf.IInt64Value|null} [numCurrentPhysicalBytes] Table numCurrentPhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numTotalPhysicalBytes] Table numTotalPhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numActivePhysicalBytes] Table numActivePhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numLongTermPhysicalBytes] Table numLongTermPhysicalBytes + * @property {google.protobuf.IInt64Value|null} [numPartitions] Table numPartitions + * @property {string|null} [maxStaleness] Table maxStaleness + * @property {google.cloud.bigquery.v2.IRestrictionConfig|null} [restrictions] Table restrictions + * @property {google.cloud.bigquery.v2.ITableConstraints|null} [tableConstraints] Table tableConstraints + * @property {Object.|null} [resourceTags] Table resourceTags + * @property {google.cloud.bigquery.v2.ITableReplicationInfo|null} [tableReplicationInfo] Table tableReplicationInfo + * @property {Array.|null} [replicas] Table replicas + * @property {google.cloud.bigquery.v2.IExternalCatalogTableOptions|null} [externalCatalogTableOptions] Table externalCatalogTableOptions + */ + + /** + * Constructs a new Table. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.cloud.bigquery.v2.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.labels = {}; + this.resourceTags = {}; + this.replicas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Table kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.kind = ""; + + /** + * Table etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.etag = ""; + + /** + * Table id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.id = ""; + + /** + * Table selfLink. + * @member {string} selfLink + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.selfLink = ""; + + /** + * Table tableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.tableReference = null; + + /** + * Table friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.friendlyName = null; + + /** + * Table description. + * @member {google.protobuf.IStringValue|null|undefined} description + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.description = null; + + /** + * Table labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.labels = $util.emptyObject; + + /** + * Table schema. + * @member {google.cloud.bigquery.v2.ITableSchema|null|undefined} schema + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.schema = null; + + /** + * Table timePartitioning. + * @member {google.cloud.bigquery.v2.ITimePartitioning|null|undefined} timePartitioning + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.timePartitioning = null; + + /** + * Table rangePartitioning. + * @member {google.cloud.bigquery.v2.IRangePartitioning|null|undefined} rangePartitioning + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.rangePartitioning = null; + + /** + * Table clustering. + * @member {google.cloud.bigquery.v2.IClustering|null|undefined} clustering + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.clustering = null; + + /** + * Table requirePartitionFilter. + * @member {google.protobuf.IBoolValue|null|undefined} requirePartitionFilter + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.requirePartitionFilter = null; + + /** + * Table partitionDefinition. + * @member {google.cloud.bigquery.v2.IPartitioningDefinition|null|undefined} partitionDefinition + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.partitionDefinition = null; + + /** + * Table numBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numBytes = null; + + /** + * Table numPhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numPhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numPhysicalBytes = null; + + /** + * Table numLongTermBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numLongTermBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numLongTermBytes = null; + + /** + * Table numRows. + * @member {google.protobuf.IUInt64Value|null|undefined} numRows + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numRows = null; + + /** + * Table creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Table expirationTime. + * @member {google.protobuf.IInt64Value|null|undefined} expirationTime + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.expirationTime = null; + + /** + * Table lastModifiedTime. + * @member {number|Long} lastModifiedTime + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.lastModifiedTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Table type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.type = ""; + + /** + * Table view. + * @member {google.cloud.bigquery.v2.IViewDefinition|null|undefined} view + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.view = null; + + /** + * Table materializedView. + * @member {google.cloud.bigquery.v2.IMaterializedViewDefinition|null|undefined} materializedView + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.materializedView = null; + + /** + * Table materializedViewStatus. + * @member {google.cloud.bigquery.v2.IMaterializedViewStatus|null|undefined} materializedViewStatus + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.materializedViewStatus = null; + + /** + * Table externalDataConfiguration. + * @member {google.cloud.bigquery.v2.IExternalDataConfiguration|null|undefined} externalDataConfiguration + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.externalDataConfiguration = null; + + /** + * Table biglakeConfiguration. + * @member {google.cloud.bigquery.v2.IBigLakeConfiguration|null|undefined} biglakeConfiguration + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.biglakeConfiguration = null; + + /** + * Table managedTableType. + * @member {google.cloud.bigquery.v2.ManagedTableType} managedTableType + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.managedTableType = 0; + + /** + * Table location. + * @member {string} location + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.location = ""; + + /** + * Table streamingBuffer. + * @member {google.cloud.bigquery.v2.IStreamingbuffer|null|undefined} streamingBuffer + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.streamingBuffer = null; + + /** + * Table encryptionConfiguration. + * @member {google.cloud.bigquery.v2.IEncryptionConfiguration|null|undefined} encryptionConfiguration + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.encryptionConfiguration = null; + + /** + * Table snapshotDefinition. + * @member {google.cloud.bigquery.v2.ISnapshotDefinition|null|undefined} snapshotDefinition + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.snapshotDefinition = null; + + /** + * Table defaultCollation. + * @member {google.protobuf.IStringValue|null|undefined} defaultCollation + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.defaultCollation = null; + + /** + * Table defaultRoundingMode. + * @member {google.cloud.bigquery.v2.TableFieldSchema.RoundingMode} defaultRoundingMode + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.defaultRoundingMode = 0; + + /** + * Table cloneDefinition. + * @member {google.cloud.bigquery.v2.ICloneDefinition|null|undefined} cloneDefinition + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.cloneDefinition = null; + + /** + * Table numTimeTravelPhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numTimeTravelPhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numTimeTravelPhysicalBytes = null; + + /** + * Table numTotalLogicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numTotalLogicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numTotalLogicalBytes = null; + + /** + * Table numActiveLogicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numActiveLogicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numActiveLogicalBytes = null; + + /** + * Table numLongTermLogicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numLongTermLogicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numLongTermLogicalBytes = null; + + /** + * Table numCurrentPhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numCurrentPhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numCurrentPhysicalBytes = null; + + /** + * Table numTotalPhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numTotalPhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numTotalPhysicalBytes = null; + + /** + * Table numActivePhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numActivePhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numActivePhysicalBytes = null; + + /** + * Table numLongTermPhysicalBytes. + * @member {google.protobuf.IInt64Value|null|undefined} numLongTermPhysicalBytes + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numLongTermPhysicalBytes = null; + + /** + * Table numPartitions. + * @member {google.protobuf.IInt64Value|null|undefined} numPartitions + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.numPartitions = null; + + /** + * Table maxStaleness. + * @member {string} maxStaleness + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.maxStaleness = ""; + + /** + * Table restrictions. + * @member {google.cloud.bigquery.v2.IRestrictionConfig|null|undefined} restrictions + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.restrictions = null; + + /** + * Table tableConstraints. + * @member {google.cloud.bigquery.v2.ITableConstraints|null|undefined} tableConstraints + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.tableConstraints = null; + + /** + * Table resourceTags. + * @member {Object.} resourceTags + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.resourceTags = $util.emptyObject; + + /** + * Table tableReplicationInfo. + * @member {google.cloud.bigquery.v2.ITableReplicationInfo|null|undefined} tableReplicationInfo + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.tableReplicationInfo = null; + + /** + * Table replicas. + * @member {Array.} replicas + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.replicas = $util.emptyArray; + + /** + * Table externalCatalogTableOptions. + * @member {google.cloud.bigquery.v2.IExternalCatalogTableOptions|null|undefined} externalCatalogTableOptions + * @memberof google.cloud.bigquery.v2.Table + * @instance + */ + Table.prototype.externalCatalogTableOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Table.prototype, "_partitionDefinition", { + get: $util.oneOfGetter($oneOfFields = ["partitionDefinition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {google.cloud.bigquery.v2.ITable=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.cloud.bigquery.v2.Table.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {google.cloud.bigquery.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.selfLink); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.tableReference, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.protobuf.StringValue.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.bigquery.v2.TableSchema.encode(message.schema, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + $root.google.cloud.bigquery.v2.TimePartitioning.encode(message.timePartitioning, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); + if (message.numBytes != null && Object.hasOwnProperty.call(message, "numBytes")) + $root.google.protobuf.Int64Value.encode(message.numBytes, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.numLongTermBytes != null && Object.hasOwnProperty.call(message, "numLongTermBytes")) + $root.google.protobuf.Int64Value.encode(message.numLongTermBytes, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.numRows != null && Object.hasOwnProperty.call(message, "numRows")) + $root.google.protobuf.UInt64Value.encode(message.numRows, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.creationTime); + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + $root.google.protobuf.Int64Value.encode(message.expirationTime, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + writer.uint32(/* id 16, wireType 1 =*/129).fixed64(message.lastModifiedTime); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.type); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.cloud.bigquery.v2.ViewDefinition.encode(message.view, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); + if (message.externalDataConfiguration != null && Object.hasOwnProperty.call(message, "externalDataConfiguration")) + $root.google.cloud.bigquery.v2.ExternalDataConfiguration.encode(message.externalDataConfiguration, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.location); + if (message.streamingBuffer != null && Object.hasOwnProperty.call(message, "streamingBuffer")) + $root.google.cloud.bigquery.v2.Streamingbuffer.encode(message.streamingBuffer, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) + $root.google.cloud.bigquery.v2.EncryptionConfiguration.encode(message.encryptionConfiguration, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + $root.google.cloud.bigquery.v2.Clustering.encode(message.clustering, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + $root.google.cloud.bigquery.v2.MaterializedViewDefinition.encode(message.materializedView, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.numPhysicalBytes != null && Object.hasOwnProperty.call(message, "numPhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numPhysicalBytes, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + $root.google.cloud.bigquery.v2.RangePartitioning.encode(message.rangePartitioning, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + $root.google.protobuf.BoolValue.encode(message.requirePartitionFilter, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); + if (message.snapshotDefinition != null && Object.hasOwnProperty.call(message, "snapshotDefinition")) + $root.google.cloud.bigquery.v2.SnapshotDefinition.encode(message.snapshotDefinition, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) + $root.google.protobuf.StringValue.encode(message.defaultCollation, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); + if (message.cloneDefinition != null && Object.hasOwnProperty.call(message, "cloneDefinition")) + $root.google.cloud.bigquery.v2.CloneDefinition.encode(message.cloneDefinition, writer.uint32(/* id 31, wireType 2 =*/250).fork(), q + 1).ldelim(); + if (message.numTimeTravelPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTimeTravelPhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numTimeTravelPhysicalBytes, writer.uint32(/* id 33, wireType 2 =*/266).fork(), q + 1).ldelim(); + if (message.numTotalLogicalBytes != null && Object.hasOwnProperty.call(message, "numTotalLogicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numTotalLogicalBytes, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + if (message.numActiveLogicalBytes != null && Object.hasOwnProperty.call(message, "numActiveLogicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numActiveLogicalBytes, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); + if (message.numLongTermLogicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermLogicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numLongTermLogicalBytes, writer.uint32(/* id 36, wireType 2 =*/290).fork(), q + 1).ldelim(); + if (message.numTotalPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTotalPhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numTotalPhysicalBytes, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); + if (message.numActivePhysicalBytes != null && Object.hasOwnProperty.call(message, "numActivePhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numActivePhysicalBytes, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); + if (message.numLongTermPhysicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermPhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numLongTermPhysicalBytes, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); + if (message.numPartitions != null && Object.hasOwnProperty.call(message, "numPartitions")) + $root.google.protobuf.Int64Value.encode(message.numPartitions, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.maxStaleness); + if (message.materializedViewStatus != null && Object.hasOwnProperty.call(message, "materializedViewStatus")) + $root.google.cloud.bigquery.v2.MaterializedViewStatus.encode(message.materializedViewStatus, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + writer.uint32(/* id 44, wireType 0 =*/352).int32(message.defaultRoundingMode); + if (message.biglakeConfiguration != null && Object.hasOwnProperty.call(message, "biglakeConfiguration")) + $root.google.cloud.bigquery.v2.BigLakeConfiguration.encode(message.biglakeConfiguration, writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) + $root.google.cloud.bigquery.v2.RestrictionConfig.encode(message.restrictions, writer.uint32(/* id 46, wireType 2 =*/370).fork(), q + 1).ldelim(); + if (message.tableConstraints != null && Object.hasOwnProperty.call(message, "tableConstraints")) + $root.google.cloud.bigquery.v2.TableConstraints.encode(message.tableConstraints, writer.uint32(/* id 47, wireType 2 =*/378).fork(), q + 1).ldelim(); + if (message.resourceTags != null && Object.hasOwnProperty.call(message, "resourceTags")) + for (var keys = Object.keys(message.resourceTags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 48, wireType 2 =*/386).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceTags[keys[i]]).ldelim(); + if (message.tableReplicationInfo != null && Object.hasOwnProperty.call(message, "tableReplicationInfo")) + $root.google.cloud.bigquery.v2.TableReplicationInfo.encode(message.tableReplicationInfo, writer.uint32(/* id 49, wireType 2 =*/394).fork(), q + 1).ldelim(); + if (message.replicas != null && message.replicas.length) + for (var i = 0; i < message.replicas.length; ++i) + $root.google.cloud.bigquery.v2.TableReference.encode(message.replicas[i], writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + if (message.partitionDefinition != null && Object.hasOwnProperty.call(message, "partitionDefinition")) + $root.google.cloud.bigquery.v2.PartitioningDefinition.encode(message.partitionDefinition, writer.uint32(/* id 51, wireType 2 =*/410).fork(), q + 1).ldelim(); + if (message.numCurrentPhysicalBytes != null && Object.hasOwnProperty.call(message, "numCurrentPhysicalBytes")) + $root.google.protobuf.Int64Value.encode(message.numCurrentPhysicalBytes, writer.uint32(/* id 53, wireType 2 =*/426).fork(), q + 1).ldelim(); + if (message.externalCatalogTableOptions != null && Object.hasOwnProperty.call(message, "externalCatalogTableOptions")) + $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions.encode(message.externalCatalogTableOptions, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); + if (message.managedTableType != null && Object.hasOwnProperty.call(message, "managedTableType")) + writer.uint32(/* id 55, wireType 0 =*/440).int32(message.managedTableType); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {google.cloud.bigquery.v2.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Table message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.Table(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.id = reader.string(); + break; + } + case 4: { + message.selfLink = reader.string(); + break; + } + case 5: { + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.description = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 9: { + message.schema = $root.google.cloud.bigquery.v2.TableSchema.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.clustering = $root.google.cloud.bigquery.v2.Clustering.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + message.requirePartitionFilter = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 51: { + message.partitionDefinition = $root.google.cloud.bigquery.v2.PartitioningDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.numBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.numPhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.numLongTermBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.numRows = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.creationTime = reader.int64(); + break; + } + case 15: { + message.expirationTime = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 16: { + message.lastModifiedTime = reader.fixed64(); + break; + } + case 17: { + message.type = reader.string(); + break; + } + case 18: { + message.view = $root.google.cloud.bigquery.v2.ViewDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.materializedView = $root.google.cloud.bigquery.v2.MaterializedViewDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 42: { + message.materializedViewStatus = $root.google.cloud.bigquery.v2.MaterializedViewStatus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 19: { + message.externalDataConfiguration = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 45: { + message.biglakeConfiguration = $root.google.cloud.bigquery.v2.BigLakeConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 55: { + message.managedTableType = reader.int32(); + break; + } + case 20: { + message.location = reader.string(); + break; + } + case 21: { + message.streamingBuffer = $root.google.cloud.bigquery.v2.Streamingbuffer.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 29: { + message.snapshotDefinition = $root.google.cloud.bigquery.v2.SnapshotDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 30: { + message.defaultCollation = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 44: { + message.defaultRoundingMode = reader.int32(); + break; + } + case 31: { + message.cloneDefinition = $root.google.cloud.bigquery.v2.CloneDefinition.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.numTimeTravelPhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 34: { + message.numTotalLogicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 35: { + message.numActiveLogicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 36: { + message.numLongTermLogicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 53: { + message.numCurrentPhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 37: { + message.numTotalPhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 38: { + message.numActivePhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 39: { + message.numLongTermPhysicalBytes = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 40: { + message.numPartitions = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 41: { + message.maxStaleness = reader.string(); + break; + } + case 46: { + message.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 47: { + message.tableConstraints = $root.google.cloud.bigquery.v2.TableConstraints.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 48: { + if (message.resourceTags === $util.emptyObject) + message.resourceTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.resourceTags, key); + message.resourceTags[key] = value; + break; + } + case 49: { + message.tableReplicationInfo = $root.google.cloud.bigquery.v2.TableReplicationInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 50: { + if (!(message.replicas && message.replicas.length)) + message.replicas = []; + message.replicas.push($root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 54: { + message.externalCatalogTableOptions = $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Table message. + * @function verify + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Table.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.tableReference, long + 1); + if (error) + return "tableReference." + error; + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName, long + 1); + if (error) + return "friendlyName." + error; + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) { + var error = $root.google.protobuf.StringValue.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) { + var error = $root.google.cloud.bigquery.v2.TableSchema.verify(message.schema, long + 1); + if (error) + return "schema." + error; + } + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) { + var error = $root.google.cloud.bigquery.v2.TimePartitioning.verify(message.timePartitioning, long + 1); + if (error) + return "timePartitioning." + error; + } + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) { + var error = $root.google.cloud.bigquery.v2.RangePartitioning.verify(message.rangePartitioning, long + 1); + if (error) + return "rangePartitioning." + error; + } + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) { + var error = $root.google.cloud.bigquery.v2.Clustering.verify(message.clustering, long + 1); + if (error) + return "clustering." + error; + } + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) { + var error = $root.google.protobuf.BoolValue.verify(message.requirePartitionFilter, long + 1); + if (error) + return "requirePartitionFilter." + error; + } + if (message.partitionDefinition != null && Object.hasOwnProperty.call(message, "partitionDefinition")) { + properties._partitionDefinition = 1; + { + var error = $root.google.cloud.bigquery.v2.PartitioningDefinition.verify(message.partitionDefinition, long + 1); + if (error) + return "partitionDefinition." + error; + } + } + if (message.numBytes != null && Object.hasOwnProperty.call(message, "numBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numBytes, long + 1); + if (error) + return "numBytes." + error; + } + if (message.numPhysicalBytes != null && Object.hasOwnProperty.call(message, "numPhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numPhysicalBytes, long + 1); + if (error) + return "numPhysicalBytes." + error; + } + if (message.numLongTermBytes != null && Object.hasOwnProperty.call(message, "numLongTermBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numLongTermBytes, long + 1); + if (error) + return "numLongTermBytes." + error; + } + if (message.numRows != null && Object.hasOwnProperty.call(message, "numRows")) { + var error = $root.google.protobuf.UInt64Value.verify(message.numRows, long + 1); + if (error) + return "numRows." + error; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) { + var error = $root.google.protobuf.Int64Value.verify(message.expirationTime, long + 1); + if (error) + return "expirationTime." + error; + } + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (!$util.isInteger(message.lastModifiedTime) && !(message.lastModifiedTime && $util.isInteger(message.lastModifiedTime.low) && $util.isInteger(message.lastModifiedTime.high))) + return "lastModifiedTime: integer|Long expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) { + var error = $root.google.cloud.bigquery.v2.ViewDefinition.verify(message.view, long + 1); + if (error) + return "view." + error; + } + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) { + var error = $root.google.cloud.bigquery.v2.MaterializedViewDefinition.verify(message.materializedView, long + 1); + if (error) + return "materializedView." + error; + } + if (message.materializedViewStatus != null && Object.hasOwnProperty.call(message, "materializedViewStatus")) { + var error = $root.google.cloud.bigquery.v2.MaterializedViewStatus.verify(message.materializedViewStatus, long + 1); + if (error) + return "materializedViewStatus." + error; + } + if (message.externalDataConfiguration != null && Object.hasOwnProperty.call(message, "externalDataConfiguration")) { + var error = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.verify(message.externalDataConfiguration, long + 1); + if (error) + return "externalDataConfiguration." + error; + } + if (message.biglakeConfiguration != null && Object.hasOwnProperty.call(message, "biglakeConfiguration")) { + var error = $root.google.cloud.bigquery.v2.BigLakeConfiguration.verify(message.biglakeConfiguration, long + 1); + if (error) + return "biglakeConfiguration." + error; + } + if (message.managedTableType != null && Object.hasOwnProperty.call(message, "managedTableType")) + switch (message.managedTableType) { + default: + return "managedTableType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.streamingBuffer != null && Object.hasOwnProperty.call(message, "streamingBuffer")) { + var error = $root.google.cloud.bigquery.v2.Streamingbuffer.verify(message.streamingBuffer, long + 1); + if (error) + return "streamingBuffer." + error; + } + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) { + var error = $root.google.cloud.bigquery.v2.EncryptionConfiguration.verify(message.encryptionConfiguration, long + 1); + if (error) + return "encryptionConfiguration." + error; + } + if (message.snapshotDefinition != null && Object.hasOwnProperty.call(message, "snapshotDefinition")) { + var error = $root.google.cloud.bigquery.v2.SnapshotDefinition.verify(message.snapshotDefinition, long + 1); + if (error) + return "snapshotDefinition." + error; + } + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) { + var error = $root.google.protobuf.StringValue.verify(message.defaultCollation, long + 1); + if (error) + return "defaultCollation." + error; + } + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + switch (message.defaultRoundingMode) { + default: + return "defaultRoundingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cloneDefinition != null && Object.hasOwnProperty.call(message, "cloneDefinition")) { + var error = $root.google.cloud.bigquery.v2.CloneDefinition.verify(message.cloneDefinition, long + 1); + if (error) + return "cloneDefinition." + error; + } + if (message.numTimeTravelPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTimeTravelPhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numTimeTravelPhysicalBytes, long + 1); + if (error) + return "numTimeTravelPhysicalBytes." + error; + } + if (message.numTotalLogicalBytes != null && Object.hasOwnProperty.call(message, "numTotalLogicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numTotalLogicalBytes, long + 1); + if (error) + return "numTotalLogicalBytes." + error; + } + if (message.numActiveLogicalBytes != null && Object.hasOwnProperty.call(message, "numActiveLogicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numActiveLogicalBytes, long + 1); + if (error) + return "numActiveLogicalBytes." + error; + } + if (message.numLongTermLogicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermLogicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numLongTermLogicalBytes, long + 1); + if (error) + return "numLongTermLogicalBytes." + error; + } + if (message.numCurrentPhysicalBytes != null && Object.hasOwnProperty.call(message, "numCurrentPhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numCurrentPhysicalBytes, long + 1); + if (error) + return "numCurrentPhysicalBytes." + error; + } + if (message.numTotalPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTotalPhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numTotalPhysicalBytes, long + 1); + if (error) + return "numTotalPhysicalBytes." + error; + } + if (message.numActivePhysicalBytes != null && Object.hasOwnProperty.call(message, "numActivePhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numActivePhysicalBytes, long + 1); + if (error) + return "numActivePhysicalBytes." + error; + } + if (message.numLongTermPhysicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermPhysicalBytes")) { + var error = $root.google.protobuf.Int64Value.verify(message.numLongTermPhysicalBytes, long + 1); + if (error) + return "numLongTermPhysicalBytes." + error; + } + if (message.numPartitions != null && Object.hasOwnProperty.call(message, "numPartitions")) { + var error = $root.google.protobuf.Int64Value.verify(message.numPartitions, long + 1); + if (error) + return "numPartitions." + error; + } + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) + if (!$util.isString(message.maxStaleness)) + return "maxStaleness: string expected"; + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) { + var error = $root.google.cloud.bigquery.v2.RestrictionConfig.verify(message.restrictions, long + 1); + if (error) + return "restrictions." + error; + } + if (message.tableConstraints != null && Object.hasOwnProperty.call(message, "tableConstraints")) { + var error = $root.google.cloud.bigquery.v2.TableConstraints.verify(message.tableConstraints, long + 1); + if (error) + return "tableConstraints." + error; + } + if (message.resourceTags != null && Object.hasOwnProperty.call(message, "resourceTags")) { + if (!$util.isObject(message.resourceTags)) + return "resourceTags: object expected"; + var key = Object.keys(message.resourceTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceTags[key[i]])) + return "resourceTags: string{k:string} expected"; + } + if (message.tableReplicationInfo != null && Object.hasOwnProperty.call(message, "tableReplicationInfo")) { + var error = $root.google.cloud.bigquery.v2.TableReplicationInfo.verify(message.tableReplicationInfo, long + 1); + if (error) + return "tableReplicationInfo." + error; + } + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) { + if (!Array.isArray(message.replicas)) + return "replicas: array expected"; + for (var i = 0; i < message.replicas.length; ++i) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.replicas[i], long + 1); + if (error) + return "replicas." + error; + } + } + if (message.externalCatalogTableOptions != null && Object.hasOwnProperty.call(message, "externalCatalogTableOptions")) { + var error = $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions.verify(message.externalCatalogTableOptions, long + 1); + if (error) + return "externalCatalogTableOptions." + error; + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.Table} Table + */ + Table.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.Table) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.Table: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.Table(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.tableReference != null) { + if (!$util.isObject(object.tableReference)) + throw TypeError(".google.cloud.bigquery.v2.Table.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.tableReference, long + 1); + } + if (object.friendlyName != null) { + if (!$util.isObject(object.friendlyName)) + throw TypeError(".google.cloud.bigquery.v2.Table.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName, long + 1); + } + if (object.description != null) { + if (!$util.isObject(object.description)) + throw TypeError(".google.cloud.bigquery.v2.Table.description: object expected"); + message.description = $root.google.protobuf.StringValue.fromObject(object.description, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.Table.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.schema != null) { + if (!$util.isObject(object.schema)) + throw TypeError(".google.cloud.bigquery.v2.Table.schema: object expected"); + message.schema = $root.google.cloud.bigquery.v2.TableSchema.fromObject(object.schema, long + 1); + } + if (object.timePartitioning != null) { + if (!$util.isObject(object.timePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.Table.timePartitioning: object expected"); + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.fromObject(object.timePartitioning, long + 1); + } + if (object.rangePartitioning != null) { + if (!$util.isObject(object.rangePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.Table.rangePartitioning: object expected"); + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.fromObject(object.rangePartitioning, long + 1); + } + if (object.clustering != null) { + if (!$util.isObject(object.clustering)) + throw TypeError(".google.cloud.bigquery.v2.Table.clustering: object expected"); + message.clustering = $root.google.cloud.bigquery.v2.Clustering.fromObject(object.clustering, long + 1); + } + if (object.requirePartitionFilter != null) { + if (!$util.isObject(object.requirePartitionFilter)) + throw TypeError(".google.cloud.bigquery.v2.Table.requirePartitionFilter: object expected"); + message.requirePartitionFilter = $root.google.protobuf.BoolValue.fromObject(object.requirePartitionFilter, long + 1); + } + if (object.partitionDefinition != null) { + if (!$util.isObject(object.partitionDefinition)) + throw TypeError(".google.cloud.bigquery.v2.Table.partitionDefinition: object expected"); + message.partitionDefinition = $root.google.cloud.bigquery.v2.PartitioningDefinition.fromObject(object.partitionDefinition, long + 1); + } + if (object.numBytes != null) { + if (!$util.isObject(object.numBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numBytes: object expected"); + message.numBytes = $root.google.protobuf.Int64Value.fromObject(object.numBytes, long + 1); + } + if (object.numPhysicalBytes != null) { + if (!$util.isObject(object.numPhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numPhysicalBytes: object expected"); + message.numPhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numPhysicalBytes, long + 1); + } + if (object.numLongTermBytes != null) { + if (!$util.isObject(object.numLongTermBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numLongTermBytes: object expected"); + message.numLongTermBytes = $root.google.protobuf.Int64Value.fromObject(object.numLongTermBytes, long + 1); + } + if (object.numRows != null) { + if (!$util.isObject(object.numRows)) + throw TypeError(".google.cloud.bigquery.v2.Table.numRows: object expected"); + message.numRows = $root.google.protobuf.UInt64Value.fromObject(object.numRows, long + 1); + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.expirationTime != null) { + if (!$util.isObject(object.expirationTime)) + throw TypeError(".google.cloud.bigquery.v2.Table.expirationTime: object expected"); + message.expirationTime = $root.google.protobuf.Int64Value.fromObject(object.expirationTime, long + 1); + } + if (object.lastModifiedTime != null) + if ($util.Long) + message.lastModifiedTime = $util.Long.fromValue(object.lastModifiedTime, true); + else if (typeof object.lastModifiedTime === "string") + message.lastModifiedTime = parseInt(object.lastModifiedTime, 10); + else if (typeof object.lastModifiedTime === "number") + message.lastModifiedTime = object.lastModifiedTime; + else if (typeof object.lastModifiedTime === "object") + message.lastModifiedTime = new $util.LongBits(object.lastModifiedTime.low >>> 0, object.lastModifiedTime.high >>> 0).toNumber(true); + if (object.type != null) + message.type = String(object.type); + if (object.view != null) { + if (!$util.isObject(object.view)) + throw TypeError(".google.cloud.bigquery.v2.Table.view: object expected"); + message.view = $root.google.cloud.bigquery.v2.ViewDefinition.fromObject(object.view, long + 1); + } + if (object.materializedView != null) { + if (!$util.isObject(object.materializedView)) + throw TypeError(".google.cloud.bigquery.v2.Table.materializedView: object expected"); + message.materializedView = $root.google.cloud.bigquery.v2.MaterializedViewDefinition.fromObject(object.materializedView, long + 1); + } + if (object.materializedViewStatus != null) { + if (!$util.isObject(object.materializedViewStatus)) + throw TypeError(".google.cloud.bigquery.v2.Table.materializedViewStatus: object expected"); + message.materializedViewStatus = $root.google.cloud.bigquery.v2.MaterializedViewStatus.fromObject(object.materializedViewStatus, long + 1); + } + if (object.externalDataConfiguration != null) { + if (!$util.isObject(object.externalDataConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.Table.externalDataConfiguration: object expected"); + message.externalDataConfiguration = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.fromObject(object.externalDataConfiguration, long + 1); + } + if (object.biglakeConfiguration != null) { + if (!$util.isObject(object.biglakeConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.Table.biglakeConfiguration: object expected"); + message.biglakeConfiguration = $root.google.cloud.bigquery.v2.BigLakeConfiguration.fromObject(object.biglakeConfiguration, long + 1); + } + switch (object.managedTableType) { + default: + if (typeof object.managedTableType === "number") { + message.managedTableType = object.managedTableType; + break; + } + break; + case "MANAGED_TABLE_TYPE_UNSPECIFIED": + case 0: + message.managedTableType = 0; + break; + case "NATIVE": + case 1: + message.managedTableType = 1; + break; + case "BIGLAKE": + case 2: + message.managedTableType = 2; + break; + } + if (object.location != null) + message.location = String(object.location); + if (object.streamingBuffer != null) { + if (!$util.isObject(object.streamingBuffer)) + throw TypeError(".google.cloud.bigquery.v2.Table.streamingBuffer: object expected"); + message.streamingBuffer = $root.google.cloud.bigquery.v2.Streamingbuffer.fromObject(object.streamingBuffer, long + 1); + } + if (object.encryptionConfiguration != null) { + if (!$util.isObject(object.encryptionConfiguration)) + throw TypeError(".google.cloud.bigquery.v2.Table.encryptionConfiguration: object expected"); + message.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.fromObject(object.encryptionConfiguration, long + 1); + } + if (object.snapshotDefinition != null) { + if (!$util.isObject(object.snapshotDefinition)) + throw TypeError(".google.cloud.bigquery.v2.Table.snapshotDefinition: object expected"); + message.snapshotDefinition = $root.google.cloud.bigquery.v2.SnapshotDefinition.fromObject(object.snapshotDefinition, long + 1); + } + if (object.defaultCollation != null) { + if (!$util.isObject(object.defaultCollation)) + throw TypeError(".google.cloud.bigquery.v2.Table.defaultCollation: object expected"); + message.defaultCollation = $root.google.protobuf.StringValue.fromObject(object.defaultCollation, long + 1); + } + switch (object.defaultRoundingMode) { + default: + if (typeof object.defaultRoundingMode === "number") { + message.defaultRoundingMode = object.defaultRoundingMode; + break; + } + break; + case "ROUNDING_MODE_UNSPECIFIED": + case 0: + message.defaultRoundingMode = 0; + break; + case "ROUND_HALF_AWAY_FROM_ZERO": + case 1: + message.defaultRoundingMode = 1; + break; + case "ROUND_HALF_EVEN": + case 2: + message.defaultRoundingMode = 2; + break; + } + if (object.cloneDefinition != null) { + if (!$util.isObject(object.cloneDefinition)) + throw TypeError(".google.cloud.bigquery.v2.Table.cloneDefinition: object expected"); + message.cloneDefinition = $root.google.cloud.bigquery.v2.CloneDefinition.fromObject(object.cloneDefinition, long + 1); + } + if (object.numTimeTravelPhysicalBytes != null) { + if (!$util.isObject(object.numTimeTravelPhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numTimeTravelPhysicalBytes: object expected"); + message.numTimeTravelPhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numTimeTravelPhysicalBytes, long + 1); + } + if (object.numTotalLogicalBytes != null) { + if (!$util.isObject(object.numTotalLogicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numTotalLogicalBytes: object expected"); + message.numTotalLogicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numTotalLogicalBytes, long + 1); + } + if (object.numActiveLogicalBytes != null) { + if (!$util.isObject(object.numActiveLogicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numActiveLogicalBytes: object expected"); + message.numActiveLogicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numActiveLogicalBytes, long + 1); + } + if (object.numLongTermLogicalBytes != null) { + if (!$util.isObject(object.numLongTermLogicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numLongTermLogicalBytes: object expected"); + message.numLongTermLogicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numLongTermLogicalBytes, long + 1); + } + if (object.numCurrentPhysicalBytes != null) { + if (!$util.isObject(object.numCurrentPhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numCurrentPhysicalBytes: object expected"); + message.numCurrentPhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numCurrentPhysicalBytes, long + 1); + } + if (object.numTotalPhysicalBytes != null) { + if (!$util.isObject(object.numTotalPhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numTotalPhysicalBytes: object expected"); + message.numTotalPhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numTotalPhysicalBytes, long + 1); + } + if (object.numActivePhysicalBytes != null) { + if (!$util.isObject(object.numActivePhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numActivePhysicalBytes: object expected"); + message.numActivePhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numActivePhysicalBytes, long + 1); + } + if (object.numLongTermPhysicalBytes != null) { + if (!$util.isObject(object.numLongTermPhysicalBytes)) + throw TypeError(".google.cloud.bigquery.v2.Table.numLongTermPhysicalBytes: object expected"); + message.numLongTermPhysicalBytes = $root.google.protobuf.Int64Value.fromObject(object.numLongTermPhysicalBytes, long + 1); + } + if (object.numPartitions != null) { + if (!$util.isObject(object.numPartitions)) + throw TypeError(".google.cloud.bigquery.v2.Table.numPartitions: object expected"); + message.numPartitions = $root.google.protobuf.Int64Value.fromObject(object.numPartitions, long + 1); + } + if (object.maxStaleness != null) + message.maxStaleness = String(object.maxStaleness); + if (object.restrictions != null) { + if (!$util.isObject(object.restrictions)) + throw TypeError(".google.cloud.bigquery.v2.Table.restrictions: object expected"); + message.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.fromObject(object.restrictions, long + 1); + } + if (object.tableConstraints != null) { + if (!$util.isObject(object.tableConstraints)) + throw TypeError(".google.cloud.bigquery.v2.Table.tableConstraints: object expected"); + message.tableConstraints = $root.google.cloud.bigquery.v2.TableConstraints.fromObject(object.tableConstraints, long + 1); + } + if (object.resourceTags) { + if (!$util.isObject(object.resourceTags)) + throw TypeError(".google.cloud.bigquery.v2.Table.resourceTags: object expected"); + message.resourceTags = {}; + for (var keys = Object.keys(object.resourceTags), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.resourceTags, keys[i]); + message.resourceTags[keys[i]] = String(object.resourceTags[keys[i]]); + } + } + if (object.tableReplicationInfo != null) { + if (!$util.isObject(object.tableReplicationInfo)) + throw TypeError(".google.cloud.bigquery.v2.Table.tableReplicationInfo: object expected"); + message.tableReplicationInfo = $root.google.cloud.bigquery.v2.TableReplicationInfo.fromObject(object.tableReplicationInfo, long + 1); + } + if (object.replicas) { + if (!Array.isArray(object.replicas)) + throw TypeError(".google.cloud.bigquery.v2.Table.replicas: array expected"); + message.replicas = []; + for (var i = 0; i < object.replicas.length; ++i) { + if (!$util.isObject(object.replicas[i])) + throw TypeError(".google.cloud.bigquery.v2.Table.replicas: object expected"); + message.replicas[i] = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.replicas[i], long + 1); + } + } + if (object.externalCatalogTableOptions != null) { + if (!$util.isObject(object.externalCatalogTableOptions)) + throw TypeError(".google.cloud.bigquery.v2.Table.externalCatalogTableOptions: object expected"); + message.externalCatalogTableOptions = $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions.fromObject(object.externalCatalogTableOptions, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {google.cloud.bigquery.v2.Table} message Table + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Table.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.replicas = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.resourceTags = {}; + } + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.id = ""; + object.selfLink = ""; + object.tableReference = null; + object.friendlyName = null; + object.description = null; + object.schema = null; + object.timePartitioning = null; + object.numBytes = null; + object.numLongTermBytes = null; + object.numRows = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.expirationTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.lastModifiedTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.lastModifiedTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.type = ""; + object.view = null; + object.externalDataConfiguration = null; + object.location = ""; + object.streamingBuffer = null; + object.encryptionConfiguration = null; + object.clustering = null; + object.materializedView = null; + object.numPhysicalBytes = null; + object.rangePartitioning = null; + object.requirePartitionFilter = null; + object.snapshotDefinition = null; + object.defaultCollation = null; + object.cloneDefinition = null; + object.numTimeTravelPhysicalBytes = null; + object.numTotalLogicalBytes = null; + object.numActiveLogicalBytes = null; + object.numLongTermLogicalBytes = null; + object.numTotalPhysicalBytes = null; + object.numActivePhysicalBytes = null; + object.numLongTermPhysicalBytes = null; + object.numPartitions = null; + object.maxStaleness = ""; + object.materializedViewStatus = null; + object.defaultRoundingMode = options.enums === String ? "ROUNDING_MODE_UNSPECIFIED" : 0; + object.biglakeConfiguration = null; + object.restrictions = null; + object.tableConstraints = null; + object.tableReplicationInfo = null; + object.numCurrentPhysicalBytes = null; + object.externalCatalogTableOptions = null; + object.managedTableType = options.enums === String ? "MANAGED_TABLE_TYPE_UNSPECIFIED" : 0; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + object.selfLink = message.selfLink; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + object.tableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.tableReference, options, q + 1); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options, q + 1); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = $root.google.protobuf.StringValue.toObject(message.description, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + object.schema = $root.google.cloud.bigquery.v2.TableSchema.toObject(message.schema, options, q + 1); + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + object.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.toObject(message.timePartitioning, options, q + 1); + if (message.numBytes != null && Object.hasOwnProperty.call(message, "numBytes")) + object.numBytes = $root.google.protobuf.Int64Value.toObject(message.numBytes, options, q + 1); + if (message.numLongTermBytes != null && Object.hasOwnProperty.call(message, "numLongTermBytes")) + object.numLongTermBytes = $root.google.protobuf.Int64Value.toObject(message.numLongTermBytes, options, q + 1); + if (message.numRows != null && Object.hasOwnProperty.call(message, "numRows")) + object.numRows = $root.google.protobuf.UInt64Value.toObject(message.numRows, options, q + 1); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + object.expirationTime = $root.google.protobuf.Int64Value.toObject(message.expirationTime, options, q + 1); + if (message.lastModifiedTime != null && Object.hasOwnProperty.call(message, "lastModifiedTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.lastModifiedTime = typeof message.lastModifiedTime === "number" ? BigInt(message.lastModifiedTime) : $util.Long.fromBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0, true).toBigInt(); + else if (typeof message.lastModifiedTime === "number") + object.lastModifiedTime = options.longs === String ? String(message.lastModifiedTime) : message.lastModifiedTime; + else + object.lastModifiedTime = options.longs === String ? $util.Long.prototype.toString.call(message.lastModifiedTime) : options.longs === Number ? new $util.LongBits(message.lastModifiedTime.low >>> 0, message.lastModifiedTime.high >>> 0).toNumber(true) : message.lastModifiedTime; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = $root.google.cloud.bigquery.v2.ViewDefinition.toObject(message.view, options, q + 1); + if (message.externalDataConfiguration != null && Object.hasOwnProperty.call(message, "externalDataConfiguration")) + object.externalDataConfiguration = $root.google.cloud.bigquery.v2.ExternalDataConfiguration.toObject(message.externalDataConfiguration, options, q + 1); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + if (message.streamingBuffer != null && Object.hasOwnProperty.call(message, "streamingBuffer")) + object.streamingBuffer = $root.google.cloud.bigquery.v2.Streamingbuffer.toObject(message.streamingBuffer, options, q + 1); + if (message.encryptionConfiguration != null && Object.hasOwnProperty.call(message, "encryptionConfiguration")) + object.encryptionConfiguration = $root.google.cloud.bigquery.v2.EncryptionConfiguration.toObject(message.encryptionConfiguration, options, q + 1); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + object.clustering = $root.google.cloud.bigquery.v2.Clustering.toObject(message.clustering, options, q + 1); + if (message.materializedView != null && Object.hasOwnProperty.call(message, "materializedView")) + object.materializedView = $root.google.cloud.bigquery.v2.MaterializedViewDefinition.toObject(message.materializedView, options, q + 1); + if (message.numPhysicalBytes != null && Object.hasOwnProperty.call(message, "numPhysicalBytes")) + object.numPhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numPhysicalBytes, options, q + 1); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + object.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.toObject(message.rangePartitioning, options, q + 1); + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + object.requirePartitionFilter = $root.google.protobuf.BoolValue.toObject(message.requirePartitionFilter, options, q + 1); + if (message.snapshotDefinition != null && Object.hasOwnProperty.call(message, "snapshotDefinition")) + object.snapshotDefinition = $root.google.cloud.bigquery.v2.SnapshotDefinition.toObject(message.snapshotDefinition, options, q + 1); + if (message.defaultCollation != null && Object.hasOwnProperty.call(message, "defaultCollation")) + object.defaultCollation = $root.google.protobuf.StringValue.toObject(message.defaultCollation, options, q + 1); + if (message.cloneDefinition != null && Object.hasOwnProperty.call(message, "cloneDefinition")) + object.cloneDefinition = $root.google.cloud.bigquery.v2.CloneDefinition.toObject(message.cloneDefinition, options, q + 1); + if (message.numTimeTravelPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTimeTravelPhysicalBytes")) + object.numTimeTravelPhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numTimeTravelPhysicalBytes, options, q + 1); + if (message.numTotalLogicalBytes != null && Object.hasOwnProperty.call(message, "numTotalLogicalBytes")) + object.numTotalLogicalBytes = $root.google.protobuf.Int64Value.toObject(message.numTotalLogicalBytes, options, q + 1); + if (message.numActiveLogicalBytes != null && Object.hasOwnProperty.call(message, "numActiveLogicalBytes")) + object.numActiveLogicalBytes = $root.google.protobuf.Int64Value.toObject(message.numActiveLogicalBytes, options, q + 1); + if (message.numLongTermLogicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermLogicalBytes")) + object.numLongTermLogicalBytes = $root.google.protobuf.Int64Value.toObject(message.numLongTermLogicalBytes, options, q + 1); + if (message.numTotalPhysicalBytes != null && Object.hasOwnProperty.call(message, "numTotalPhysicalBytes")) + object.numTotalPhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numTotalPhysicalBytes, options, q + 1); + if (message.numActivePhysicalBytes != null && Object.hasOwnProperty.call(message, "numActivePhysicalBytes")) + object.numActivePhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numActivePhysicalBytes, options, q + 1); + if (message.numLongTermPhysicalBytes != null && Object.hasOwnProperty.call(message, "numLongTermPhysicalBytes")) + object.numLongTermPhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numLongTermPhysicalBytes, options, q + 1); + if (message.numPartitions != null && Object.hasOwnProperty.call(message, "numPartitions")) + object.numPartitions = $root.google.protobuf.Int64Value.toObject(message.numPartitions, options, q + 1); + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) + object.maxStaleness = message.maxStaleness; + if (message.materializedViewStatus != null && Object.hasOwnProperty.call(message, "materializedViewStatus")) + object.materializedViewStatus = $root.google.cloud.bigquery.v2.MaterializedViewStatus.toObject(message.materializedViewStatus, options, q + 1); + if (message.defaultRoundingMode != null && Object.hasOwnProperty.call(message, "defaultRoundingMode")) + object.defaultRoundingMode = options.enums === String ? $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.defaultRoundingMode] === undefined ? message.defaultRoundingMode : $root.google.cloud.bigquery.v2.TableFieldSchema.RoundingMode[message.defaultRoundingMode] : message.defaultRoundingMode; + if (message.biglakeConfiguration != null && Object.hasOwnProperty.call(message, "biglakeConfiguration")) + object.biglakeConfiguration = $root.google.cloud.bigquery.v2.BigLakeConfiguration.toObject(message.biglakeConfiguration, options, q + 1); + if (message.restrictions != null && Object.hasOwnProperty.call(message, "restrictions")) + object.restrictions = $root.google.cloud.bigquery.v2.RestrictionConfig.toObject(message.restrictions, options, q + 1); + if (message.tableConstraints != null && Object.hasOwnProperty.call(message, "tableConstraints")) + object.tableConstraints = $root.google.cloud.bigquery.v2.TableConstraints.toObject(message.tableConstraints, options, q + 1); + if (message.resourceTags && (keys2 = Object.keys(message.resourceTags)).length) { + object.resourceTags = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.resourceTags, keys2[j]); + object.resourceTags[keys2[j]] = message.resourceTags[keys2[j]]; + } + } + if (message.tableReplicationInfo != null && Object.hasOwnProperty.call(message, "tableReplicationInfo")) + object.tableReplicationInfo = $root.google.cloud.bigquery.v2.TableReplicationInfo.toObject(message.tableReplicationInfo, options, q + 1); + if (message.replicas && message.replicas.length) { + object.replicas = []; + for (var j = 0; j < message.replicas.length; ++j) + object.replicas[j] = $root.google.cloud.bigquery.v2.TableReference.toObject(message.replicas[j], options, q + 1); + } + if (message.partitionDefinition != null && Object.hasOwnProperty.call(message, "partitionDefinition")) { + object.partitionDefinition = $root.google.cloud.bigquery.v2.PartitioningDefinition.toObject(message.partitionDefinition, options, q + 1); + if (options.oneofs) + object._partitionDefinition = "partitionDefinition"; + } + if (message.numCurrentPhysicalBytes != null && Object.hasOwnProperty.call(message, "numCurrentPhysicalBytes")) + object.numCurrentPhysicalBytes = $root.google.protobuf.Int64Value.toObject(message.numCurrentPhysicalBytes, options, q + 1); + if (message.externalCatalogTableOptions != null && Object.hasOwnProperty.call(message, "externalCatalogTableOptions")) + object.externalCatalogTableOptions = $root.google.cloud.bigquery.v2.ExternalCatalogTableOptions.toObject(message.externalCatalogTableOptions, options, q + 1); + if (message.managedTableType != null && Object.hasOwnProperty.call(message, "managedTableType")) + object.managedTableType = options.enums === String ? $root.google.cloud.bigquery.v2.ManagedTableType[message.managedTableType] === undefined ? message.managedTableType : $root.google.cloud.bigquery.v2.ManagedTableType[message.managedTableType] : message.managedTableType; + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Table + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.Table + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.Table"; + }; + + return Table; + })(); + + v2.GetTableRequest = (function() { + + /** + * Properties of a GetTableRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IGetTableRequest + * @property {string|null} [projectId] GetTableRequest projectId + * @property {string|null} [datasetId] GetTableRequest datasetId + * @property {string|null} [tableId] GetTableRequest tableId + * @property {string|null} [selectedFields] GetTableRequest selectedFields + * @property {google.cloud.bigquery.v2.GetTableRequest.TableMetadataView|null} [view] GetTableRequest view + */ + + /** + * Constructs a new GetTableRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a GetTableRequest. + * @implements IGetTableRequest + * @constructor + * @param {google.cloud.bigquery.v2.IGetTableRequest=} [properties] Properties to set + */ + function GetTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTableRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.projectId = ""; + + /** + * GetTableRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.datasetId = ""; + + /** + * GetTableRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.tableId = ""; + + /** + * GetTableRequest selectedFields. + * @member {string} selectedFields + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.selectedFields = ""; + + /** + * GetTableRequest view. + * @member {google.cloud.bigquery.v2.GetTableRequest.TableMetadataView} view + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + */ + GetTableRequest.prototype.view = 0; + + /** + * Creates a new GetTableRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {google.cloud.bigquery.v2.IGetTableRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.GetTableRequest} GetTableRequest instance + */ + GetTableRequest.create = function create(properties) { + return new GetTableRequest(properties); + }; + + /** + * Encodes the specified GetTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.GetTableRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {google.cloud.bigquery.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.selectedFields != null && Object.hasOwnProperty.call(message, "selectedFields")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.selectedFields); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.GetTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {google.cloud.bigquery.v2.IGetTableRequest} message GetTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.GetTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.selectedFields = reader.string(); + break; + } + case 5: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.GetTableRequest} GetTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTableRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTableRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.selectedFields != null && Object.hasOwnProperty.call(message, "selectedFields")) + if (!$util.isString(message.selectedFields)) + return "selectedFields: string expected"; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a GetTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.GetTableRequest} GetTableRequest + */ + GetTableRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.GetTableRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.GetTableRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.GetTableRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.selectedFields != null) + message.selectedFields = String(object.selectedFields); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "TABLE_METADATA_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "STORAGE_STATS": + case 2: + message.view = 2; + break; + case "FULL": + case 3: + message.view = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {google.cloud.bigquery.v2.GetTableRequest} message GetTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTableRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.selectedFields = ""; + object.view = options.enums === String ? "TABLE_METADATA_VIEW_UNSPECIFIED" : 0; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.selectedFields != null && Object.hasOwnProperty.call(message, "selectedFields")) + object.selectedFields = message.selectedFields; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = options.enums === String ? $root.google.cloud.bigquery.v2.GetTableRequest.TableMetadataView[message.view] === undefined ? message.view : $root.google.cloud.bigquery.v2.GetTableRequest.TableMetadataView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetTableRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @instance + * @returns {Object.} JSON object + */ + GetTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTableRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.GetTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.GetTableRequest"; + }; + + /** + * TableMetadataView enum. + * @name google.cloud.bigquery.v2.GetTableRequest.TableMetadataView + * @enum {number} + * @property {number} TABLE_METADATA_VIEW_UNSPECIFIED=0 TABLE_METADATA_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} STORAGE_STATS=2 STORAGE_STATS value + * @property {number} FULL=3 FULL value + */ + GetTableRequest.TableMetadataView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TABLE_METADATA_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "STORAGE_STATS"] = 2; + values[valuesById[3] = "FULL"] = 3; + return values; + })(); + + return GetTableRequest; + })(); + + v2.InsertTableRequest = (function() { + + /** + * Properties of an InsertTableRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IInsertTableRequest + * @property {string|null} [projectId] InsertTableRequest projectId + * @property {string|null} [datasetId] InsertTableRequest datasetId + * @property {google.cloud.bigquery.v2.ITable|null} [table] InsertTableRequest table + */ + + /** + * Constructs a new InsertTableRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an InsertTableRequest. + * @implements IInsertTableRequest + * @constructor + * @param {google.cloud.bigquery.v2.IInsertTableRequest=} [properties] Properties to set + */ + function InsertTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTableRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @instance + */ + InsertTableRequest.prototype.projectId = ""; + + /** + * InsertTableRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @instance + */ + InsertTableRequest.prototype.datasetId = ""; + + /** + * InsertTableRequest table. + * @member {google.cloud.bigquery.v2.ITable|null|undefined} table + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @instance + */ + InsertTableRequest.prototype.table = null; + + /** + * Creates a new InsertTableRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertTableRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.InsertTableRequest} InsertTableRequest instance + */ + InsertTableRequest.create = function create(properties) { + return new InsertTableRequest(properties); + }; + + /** + * Encodes the specified InsertTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.InsertTableRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertTableRequest} message InsertTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTableRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.cloud.bigquery.v2.Table.encode(message.table, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.InsertTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {google.cloud.bigquery.v2.IInsertTableRequest} message InsertTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an InsertTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.InsertTableRequest} InsertTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTableRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.InsertTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 4: { + message.table = $root.google.cloud.bigquery.v2.Table.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.InsertTableRequest} InsertTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTableRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTableRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { + var error = $root.google.cloud.bigquery.v2.Table.verify(message.table, long + 1); + if (error) + return "table." + error; + } + return null; + }; + + /** + * Creates an InsertTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.InsertTableRequest} InsertTableRequest + */ + InsertTableRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.InsertTableRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.InsertTableRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.InsertTableRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.table != null) { + if (!$util.isObject(object.table)) + throw TypeError(".google.cloud.bigquery.v2.InsertTableRequest.table: object expected"); + message.table = $root.google.cloud.bigquery.v2.Table.fromObject(object.table, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an InsertTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {google.cloud.bigquery.v2.InsertTableRequest} message InsertTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTableRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.table = null; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + object.table = $root.google.cloud.bigquery.v2.Table.toObject(message.table, options, q + 1); + return object; + }; + + /** + * Converts this InsertTableRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertTableRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.InsertTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.InsertTableRequest"; + }; + + return InsertTableRequest; + })(); + + v2.UpdateOrPatchTableRequest = (function() { + + /** + * Properties of an UpdateOrPatchTableRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IUpdateOrPatchTableRequest + * @property {string|null} [projectId] UpdateOrPatchTableRequest projectId + * @property {string|null} [datasetId] UpdateOrPatchTableRequest datasetId + * @property {string|null} [tableId] UpdateOrPatchTableRequest tableId + * @property {google.cloud.bigquery.v2.ITable|null} [table] UpdateOrPatchTableRequest table + * @property {boolean|null} [autodetectSchema] UpdateOrPatchTableRequest autodetectSchema + */ + + /** + * Constructs a new UpdateOrPatchTableRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents an UpdateOrPatchTableRequest. + * @implements IUpdateOrPatchTableRequest + * @constructor + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest=} [properties] Properties to set + */ + function UpdateOrPatchTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateOrPatchTableRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + */ + UpdateOrPatchTableRequest.prototype.projectId = ""; + + /** + * UpdateOrPatchTableRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + */ + UpdateOrPatchTableRequest.prototype.datasetId = ""; + + /** + * UpdateOrPatchTableRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + */ + UpdateOrPatchTableRequest.prototype.tableId = ""; + + /** + * UpdateOrPatchTableRequest table. + * @member {google.cloud.bigquery.v2.ITable|null|undefined} table + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + */ + UpdateOrPatchTableRequest.prototype.table = null; + + /** + * UpdateOrPatchTableRequest autodetectSchema. + * @member {boolean} autodetectSchema + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + */ + UpdateOrPatchTableRequest.prototype.autodetectSchema = false; + + /** + * Creates a new UpdateOrPatchTableRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.UpdateOrPatchTableRequest} UpdateOrPatchTableRequest instance + */ + UpdateOrPatchTableRequest.create = function create(properties) { + return new UpdateOrPatchTableRequest(properties); + }; + + /** + * Encodes the specified UpdateOrPatchTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchTableRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} message UpdateOrPatchTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrPatchTableRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.cloud.bigquery.v2.Table.encode(message.table, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.autodetectSchema != null && Object.hasOwnProperty.call(message, "autodetectSchema")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.autodetectSchema); + return writer; + }; + + /** + * Encodes the specified UpdateOrPatchTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.UpdateOrPatchTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {google.cloud.bigquery.v2.IUpdateOrPatchTableRequest} message UpdateOrPatchTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateOrPatchTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateOrPatchTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.UpdateOrPatchTableRequest} UpdateOrPatchTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrPatchTableRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + case 4: { + message.table = $root.google.cloud.bigquery.v2.Table.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.autodetectSchema = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateOrPatchTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.UpdateOrPatchTableRequest} UpdateOrPatchTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateOrPatchTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateOrPatchTableRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateOrPatchTableRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { + var error = $root.google.cloud.bigquery.v2.Table.verify(message.table, long + 1); + if (error) + return "table." + error; + } + if (message.autodetectSchema != null && Object.hasOwnProperty.call(message, "autodetectSchema")) + if (typeof message.autodetectSchema !== "boolean") + return "autodetectSchema: boolean expected"; + return null; + }; + + /** + * Creates an UpdateOrPatchTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.UpdateOrPatchTableRequest} UpdateOrPatchTableRequest + */ + UpdateOrPatchTableRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.UpdateOrPatchTableRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.UpdateOrPatchTableRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.table != null) { + if (!$util.isObject(object.table)) + throw TypeError(".google.cloud.bigquery.v2.UpdateOrPatchTableRequest.table: object expected"); + message.table = $root.google.cloud.bigquery.v2.Table.fromObject(object.table, long + 1); + } + if (object.autodetectSchema != null) + message.autodetectSchema = Boolean(object.autodetectSchema); + return message; + }; + + /** + * Creates a plain object from an UpdateOrPatchTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {google.cloud.bigquery.v2.UpdateOrPatchTableRequest} message UpdateOrPatchTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateOrPatchTableRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + object.table = null; + object.autodetectSchema = false; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + object.table = $root.google.cloud.bigquery.v2.Table.toObject(message.table, options, q + 1); + if (message.autodetectSchema != null && Object.hasOwnProperty.call(message, "autodetectSchema")) + object.autodetectSchema = message.autodetectSchema; + return object; + }; + + /** + * Converts this UpdateOrPatchTableRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateOrPatchTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateOrPatchTableRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.UpdateOrPatchTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateOrPatchTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.UpdateOrPatchTableRequest"; + }; + + return UpdateOrPatchTableRequest; + })(); + + v2.DeleteTableRequest = (function() { + + /** + * Properties of a DeleteTableRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IDeleteTableRequest + * @property {string|null} [projectId] DeleteTableRequest projectId + * @property {string|null} [datasetId] DeleteTableRequest datasetId + * @property {string|null} [tableId] DeleteTableRequest tableId + */ + + /** + * Constructs a new DeleteTableRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a DeleteTableRequest. + * @implements IDeleteTableRequest + * @constructor + * @param {google.cloud.bigquery.v2.IDeleteTableRequest=} [properties] Properties to set + */ + function DeleteTableRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTableRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @instance + */ + DeleteTableRequest.prototype.projectId = ""; + + /** + * DeleteTableRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @instance + */ + DeleteTableRequest.prototype.datasetId = ""; + + /** + * DeleteTableRequest tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @instance + */ + DeleteTableRequest.prototype.tableId = ""; + + /** + * Creates a new DeleteTableRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteTableRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.DeleteTableRequest} DeleteTableRequest instance + */ + DeleteTableRequest.create = function create(properties) { + return new DeleteTableRequest(properties); + }; + + /** + * Encodes the specified DeleteTableRequest message. Does not implicitly {@link google.cloud.bigquery.v2.DeleteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified DeleteTableRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.DeleteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {google.cloud.bigquery.v2.IDeleteTableRequest} message DeleteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.DeleteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.DeleteTableRequest} DeleteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTableRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTableRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a DeleteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.DeleteTableRequest} DeleteTableRequest + */ + DeleteTableRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.DeleteTableRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.DeleteTableRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.DeleteTableRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a DeleteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {google.cloud.bigquery.v2.DeleteTableRequest} message DeleteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTableRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this DeleteTableRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTableRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.DeleteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.DeleteTableRequest"; + }; + + return DeleteTableRequest; + })(); + + v2.ListTablesRequest = (function() { + + /** + * Properties of a ListTablesRequest. + * @memberof google.cloud.bigquery.v2 + * @interface IListTablesRequest + * @property {string|null} [projectId] ListTablesRequest projectId + * @property {string|null} [datasetId] ListTablesRequest datasetId + * @property {google.protobuf.IUInt32Value|null} [maxResults] ListTablesRequest maxResults + * @property {string|null} [pageToken] ListTablesRequest pageToken + */ + + /** + * Constructs a new ListTablesRequest. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListTablesRequest. + * @implements IListTablesRequest + * @constructor + * @param {google.cloud.bigquery.v2.IListTablesRequest=} [properties] Properties to set + */ + function ListTablesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTablesRequest projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.projectId = ""; + + /** + * ListTablesRequest datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.datasetId = ""; + + /** + * ListTablesRequest maxResults. + * @member {google.protobuf.IUInt32Value|null|undefined} maxResults + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.maxResults = null; + + /** + * ListTablesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @instance + */ + ListTablesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTablesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {google.cloud.bigquery.v2.IListTablesRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListTablesRequest} ListTablesRequest instance + */ + ListTablesRequest.create = function create(properties) { + return new ListTablesRequest(properties); + }; + + /** + * Encodes the specified ListTablesRequest message. Does not implicitly {@link google.cloud.bigquery.v2.ListTablesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {google.cloud.bigquery.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + $root.google.protobuf.UInt32Value.encode(message.maxResults, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTablesRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListTablesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {google.cloud.bigquery.v2.IListTablesRequest} message ListTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTablesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListTablesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.maxResults = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListTablesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListTablesRequest} ListTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTablesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTablesRequest message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTablesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) { + var error = $root.google.protobuf.UInt32Value.verify(message.maxResults, long + 1); + if (error) + return "maxResults." + error; + } + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTablesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListTablesRequest} ListTablesRequest + */ + ListTablesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListTablesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListTablesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListTablesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.maxResults != null) { + if (!$util.isObject(object.maxResults)) + throw TypeError(".google.cloud.bigquery.v2.ListTablesRequest.maxResults: object expected"); + message.maxResults = $root.google.protobuf.UInt32Value.fromObject(object.maxResults, long + 1); + } + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTablesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {google.cloud.bigquery.v2.ListTablesRequest} message ListTablesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTablesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.maxResults = null; + object.pageToken = ""; + } + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + object.maxResults = $root.google.protobuf.UInt32Value.toObject(message.maxResults, options, q + 1); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTablesRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTablesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTablesRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListTablesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTablesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListTablesRequest"; + }; + + return ListTablesRequest; + })(); + + v2.ListFormatView = (function() { + + /** + * Properties of a ListFormatView. + * @memberof google.cloud.bigquery.v2 + * @interface IListFormatView + * @property {google.protobuf.IBoolValue|null} [useLegacySql] ListFormatView useLegacySql + * @property {google.cloud.bigquery.v2.IPrivacyPolicy|null} [privacyPolicy] ListFormatView privacyPolicy + */ + + /** + * Constructs a new ListFormatView. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListFormatView. + * @implements IListFormatView + * @constructor + * @param {google.cloud.bigquery.v2.IListFormatView=} [properties] Properties to set + */ + function ListFormatView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFormatView useLegacySql. + * @member {google.protobuf.IBoolValue|null|undefined} useLegacySql + * @memberof google.cloud.bigquery.v2.ListFormatView + * @instance + */ + ListFormatView.prototype.useLegacySql = null; + + /** + * ListFormatView privacyPolicy. + * @member {google.cloud.bigquery.v2.IPrivacyPolicy|null|undefined} privacyPolicy + * @memberof google.cloud.bigquery.v2.ListFormatView + * @instance + */ + ListFormatView.prototype.privacyPolicy = null; + + /** + * Creates a new ListFormatView instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {google.cloud.bigquery.v2.IListFormatView=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListFormatView} ListFormatView instance + */ + ListFormatView.create = function create(properties) { + return new ListFormatView(properties); + }; + + /** + * Encodes the specified ListFormatView message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatView.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {google.cloud.bigquery.v2.IListFormatView} message ListFormatView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatView.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + $root.google.protobuf.BoolValue.encode(message.useLegacySql, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) + $root.google.cloud.bigquery.v2.PrivacyPolicy.encode(message.privacyPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFormatView message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {google.cloud.bigquery.v2.IListFormatView} message ListFormatView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListFormatView message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListFormatView} ListFormatView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatView.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListFormatView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.useLegacySql = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFormatView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListFormatView} ListFormatView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFormatView message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFormatView.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) { + var error = $root.google.protobuf.BoolValue.verify(message.useLegacySql, long + 1); + if (error) + return "useLegacySql." + error; + } + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) { + var error = $root.google.cloud.bigquery.v2.PrivacyPolicy.verify(message.privacyPolicy, long + 1); + if (error) + return "privacyPolicy." + error; + } + return null; + }; + + /** + * Creates a ListFormatView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListFormatView} ListFormatView + */ + ListFormatView.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListFormatView) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatView: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListFormatView(); + if (object.useLegacySql != null) { + if (!$util.isObject(object.useLegacySql)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatView.useLegacySql: object expected"); + message.useLegacySql = $root.google.protobuf.BoolValue.fromObject(object.useLegacySql, long + 1); + } + if (object.privacyPolicy != null) { + if (!$util.isObject(object.privacyPolicy)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatView.privacyPolicy: object expected"); + message.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.fromObject(object.privacyPolicy, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListFormatView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {google.cloud.bigquery.v2.ListFormatView} message ListFormatView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFormatView.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.useLegacySql = null; + object.privacyPolicy = null; + } + if (message.useLegacySql != null && Object.hasOwnProperty.call(message, "useLegacySql")) + object.useLegacySql = $root.google.protobuf.BoolValue.toObject(message.useLegacySql, options, q + 1); + if (message.privacyPolicy != null && Object.hasOwnProperty.call(message, "privacyPolicy")) + object.privacyPolicy = $root.google.cloud.bigquery.v2.PrivacyPolicy.toObject(message.privacyPolicy, options, q + 1); + return object; + }; + + /** + * Converts this ListFormatView to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListFormatView + * @instance + * @returns {Object.} JSON object + */ + ListFormatView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFormatView + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListFormatView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFormatView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListFormatView"; + }; + + return ListFormatView; + })(); + + v2.ListFormatTable = (function() { + + /** + * Properties of a ListFormatTable. + * @memberof google.cloud.bigquery.v2 + * @interface IListFormatTable + * @property {string|null} [kind] ListFormatTable kind + * @property {string|null} [id] ListFormatTable id + * @property {google.cloud.bigquery.v2.ITableReference|null} [tableReference] ListFormatTable tableReference + * @property {google.protobuf.IStringValue|null} [friendlyName] ListFormatTable friendlyName + * @property {string|null} [type] ListFormatTable type + * @property {google.cloud.bigquery.v2.ITimePartitioning|null} [timePartitioning] ListFormatTable timePartitioning + * @property {google.cloud.bigquery.v2.IRangePartitioning|null} [rangePartitioning] ListFormatTable rangePartitioning + * @property {google.cloud.bigquery.v2.IClustering|null} [clustering] ListFormatTable clustering + * @property {Object.|null} [labels] ListFormatTable labels + * @property {google.cloud.bigquery.v2.IListFormatView|null} [view] ListFormatTable view + * @property {number|Long|null} [creationTime] ListFormatTable creationTime + * @property {number|Long|null} [expirationTime] ListFormatTable expirationTime + * @property {google.protobuf.IBoolValue|null} [requirePartitionFilter] ListFormatTable requirePartitionFilter + */ + + /** + * Constructs a new ListFormatTable. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ListFormatTable. + * @implements IListFormatTable + * @constructor + * @param {google.cloud.bigquery.v2.IListFormatTable=} [properties] Properties to set + */ + function ListFormatTable(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFormatTable kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.kind = ""; + + /** + * ListFormatTable id. + * @member {string} id + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.id = ""; + + /** + * ListFormatTable tableReference. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.tableReference = null; + + /** + * ListFormatTable friendlyName. + * @member {google.protobuf.IStringValue|null|undefined} friendlyName + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.friendlyName = null; + + /** + * ListFormatTable type. + * @member {string} type + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.type = ""; + + /** + * ListFormatTable timePartitioning. + * @member {google.cloud.bigquery.v2.ITimePartitioning|null|undefined} timePartitioning + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.timePartitioning = null; + + /** + * ListFormatTable rangePartitioning. + * @member {google.cloud.bigquery.v2.IRangePartitioning|null|undefined} rangePartitioning + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.rangePartitioning = null; + + /** + * ListFormatTable clustering. + * @member {google.cloud.bigquery.v2.IClustering|null|undefined} clustering + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.clustering = null; + + /** + * ListFormatTable labels. + * @member {Object.} labels + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.labels = $util.emptyObject; + + /** + * ListFormatTable view. + * @member {google.cloud.bigquery.v2.IListFormatView|null|undefined} view + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.view = null; + + /** + * ListFormatTable creationTime. + * @member {number|Long} creationTime + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.creationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ListFormatTable expirationTime. + * @member {number|Long} expirationTime + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.expirationTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ListFormatTable requirePartitionFilter. + * @member {google.protobuf.IBoolValue|null|undefined} requirePartitionFilter + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + */ + ListFormatTable.prototype.requirePartitionFilter = null; + + /** + * Creates a new ListFormatTable instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {google.cloud.bigquery.v2.IListFormatTable=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ListFormatTable} ListFormatTable instance + */ + ListFormatTable.create = function create(properties) { + return new ListFormatTable(properties); + }; + + /** + * Encodes the specified ListFormatTable message. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatTable.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {google.cloud.bigquery.v2.IListFormatTable} message ListFormatTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatTable.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.tableReference, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + $root.google.protobuf.StringValue.encode(message.friendlyName, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.type); + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + $root.google.cloud.bigquery.v2.TimePartitioning.encode(message.timePartitioning, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.cloud.bigquery.v2.ListFormatView.encode(message.view, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.creationTime); + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.expirationTime); + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + $root.google.cloud.bigquery.v2.Clustering.encode(message.clustering, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + $root.google.cloud.bigquery.v2.RangePartitioning.encode(message.rangePartitioning, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + $root.google.protobuf.BoolValue.encode(message.requirePartitionFilter, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFormatTable message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ListFormatTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {google.cloud.bigquery.v2.IListFormatTable} message ListFormatTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFormatTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListFormatTable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ListFormatTable} ListFormatTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatTable.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ListFormatTable(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.friendlyName = $root.google.protobuf.StringValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.type = reader.string(); + break; + } + case 6: { + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.clustering = $root.google.cloud.bigquery.v2.Clustering.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 8: { + message.view = $root.google.cloud.bigquery.v2.ListFormatView.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.creationTime = reader.int64(); + break; + } + case 10: { + message.expirationTime = reader.int64(); + break; + } + case 14: { + message.requirePartitionFilter = $root.google.protobuf.BoolValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListFormatTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ListFormatTable} ListFormatTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFormatTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFormatTable message. + * @function verify + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFormatTable.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.tableReference, long + 1); + if (error) + return "tableReference." + error; + } + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) { + var error = $root.google.protobuf.StringValue.verify(message.friendlyName, long + 1); + if (error) + return "friendlyName." + error; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) { + var error = $root.google.cloud.bigquery.v2.TimePartitioning.verify(message.timePartitioning, long + 1); + if (error) + return "timePartitioning." + error; + } + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) { + var error = $root.google.cloud.bigquery.v2.RangePartitioning.verify(message.rangePartitioning, long + 1); + if (error) + return "rangePartitioning." + error; + } + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) { + var error = $root.google.cloud.bigquery.v2.Clustering.verify(message.clustering, long + 1); + if (error) + return "clustering." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.view != null && Object.hasOwnProperty.call(message, "view")) { + var error = $root.google.cloud.bigquery.v2.ListFormatView.verify(message.view, long + 1); + if (error) + return "view." + error; + } + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (!$util.isInteger(message.creationTime) && !(message.creationTime && $util.isInteger(message.creationTime.low) && $util.isInteger(message.creationTime.high))) + return "creationTime: integer|Long expected"; + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + if (!$util.isInteger(message.expirationTime) && !(message.expirationTime && $util.isInteger(message.expirationTime.low) && $util.isInteger(message.expirationTime.high))) + return "expirationTime: integer|Long expected"; + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) { + var error = $root.google.protobuf.BoolValue.verify(message.requirePartitionFilter, long + 1); + if (error) + return "requirePartitionFilter." + error; + } + return null; + }; + + /** + * Creates a ListFormatTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ListFormatTable} ListFormatTable + */ + ListFormatTable.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ListFormatTable) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ListFormatTable(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.id != null) + message.id = String(object.id); + if (object.tableReference != null) { + if (!$util.isObject(object.tableReference)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.tableReference, long + 1); + } + if (object.friendlyName != null) { + if (!$util.isObject(object.friendlyName)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.friendlyName: object expected"); + message.friendlyName = $root.google.protobuf.StringValue.fromObject(object.friendlyName, long + 1); + } + if (object.type != null) + message.type = String(object.type); + if (object.timePartitioning != null) { + if (!$util.isObject(object.timePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.timePartitioning: object expected"); + message.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.fromObject(object.timePartitioning, long + 1); + } + if (object.rangePartitioning != null) { + if (!$util.isObject(object.rangePartitioning)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.rangePartitioning: object expected"); + message.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.fromObject(object.rangePartitioning, long + 1); + } + if (object.clustering != null) { + if (!$util.isObject(object.clustering)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.clustering: object expected"); + message.clustering = $root.google.cloud.bigquery.v2.Clustering.fromObject(object.clustering, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.view != null) { + if (!$util.isObject(object.view)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.view: object expected"); + message.view = $root.google.cloud.bigquery.v2.ListFormatView.fromObject(object.view, long + 1); + } + if (object.creationTime != null) + if ($util.Long) + message.creationTime = $util.Long.fromValue(object.creationTime, false); + else if (typeof object.creationTime === "string") + message.creationTime = parseInt(object.creationTime, 10); + else if (typeof object.creationTime === "number") + message.creationTime = object.creationTime; + else if (typeof object.creationTime === "object") + message.creationTime = new $util.LongBits(object.creationTime.low >>> 0, object.creationTime.high >>> 0).toNumber(); + if (object.expirationTime != null) + if ($util.Long) + message.expirationTime = $util.Long.fromValue(object.expirationTime, false); + else if (typeof object.expirationTime === "string") + message.expirationTime = parseInt(object.expirationTime, 10); + else if (typeof object.expirationTime === "number") + message.expirationTime = object.expirationTime; + else if (typeof object.expirationTime === "object") + message.expirationTime = new $util.LongBits(object.expirationTime.low >>> 0, object.expirationTime.high >>> 0).toNumber(); + if (object.requirePartitionFilter != null) { + if (!$util.isObject(object.requirePartitionFilter)) + throw TypeError(".google.cloud.bigquery.v2.ListFormatTable.requirePartitionFilter: object expected"); + message.requirePartitionFilter = $root.google.protobuf.BoolValue.fromObject(object.requirePartitionFilter, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListFormatTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {google.cloud.bigquery.v2.ListFormatTable} message ListFormatTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFormatTable.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.kind = ""; + object.id = ""; + object.tableReference = null; + object.friendlyName = null; + object.type = ""; + object.timePartitioning = null; + object.view = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.creationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.creationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expirationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.expirationTime = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.clustering = null; + object.rangePartitioning = null; + object.requirePartitionFilter = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + object.tableReference = $root.google.cloud.bigquery.v2.TableReference.toObject(message.tableReference, options, q + 1); + if (message.friendlyName != null && Object.hasOwnProperty.call(message, "friendlyName")) + object.friendlyName = $root.google.protobuf.StringValue.toObject(message.friendlyName, options, q + 1); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.timePartitioning != null && Object.hasOwnProperty.call(message, "timePartitioning")) + object.timePartitioning = $root.google.cloud.bigquery.v2.TimePartitioning.toObject(message.timePartitioning, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = $root.google.cloud.bigquery.v2.ListFormatView.toObject(message.view, options, q + 1); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.creationTime = typeof message.creationTime === "number" ? BigInt(message.creationTime) : $util.Long.fromBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0, false).toBigInt(); + else if (typeof message.creationTime === "number") + object.creationTime = options.longs === String ? String(message.creationTime) : message.creationTime; + else + object.creationTime = options.longs === String ? $util.Long.prototype.toString.call(message.creationTime) : options.longs === Number ? new $util.LongBits(message.creationTime.low >>> 0, message.creationTime.high >>> 0).toNumber() : message.creationTime; + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.expirationTime = typeof message.expirationTime === "number" ? BigInt(message.expirationTime) : $util.Long.fromBits(message.expirationTime.low >>> 0, message.expirationTime.high >>> 0, false).toBigInt(); + else if (typeof message.expirationTime === "number") + object.expirationTime = options.longs === String ? String(message.expirationTime) : message.expirationTime; + else + object.expirationTime = options.longs === String ? $util.Long.prototype.toString.call(message.expirationTime) : options.longs === Number ? new $util.LongBits(message.expirationTime.low >>> 0, message.expirationTime.high >>> 0).toNumber() : message.expirationTime; + if (message.clustering != null && Object.hasOwnProperty.call(message, "clustering")) + object.clustering = $root.google.cloud.bigquery.v2.Clustering.toObject(message.clustering, options, q + 1); + if (message.rangePartitioning != null && Object.hasOwnProperty.call(message, "rangePartitioning")) + object.rangePartitioning = $root.google.cloud.bigquery.v2.RangePartitioning.toObject(message.rangePartitioning, options, q + 1); + if (message.requirePartitionFilter != null && Object.hasOwnProperty.call(message, "requirePartitionFilter")) + object.requirePartitionFilter = $root.google.protobuf.BoolValue.toObject(message.requirePartitionFilter, options, q + 1); + return object; + }; + + /** + * Converts this ListFormatTable to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @instance + * @returns {Object.} JSON object + */ + ListFormatTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFormatTable + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ListFormatTable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFormatTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ListFormatTable"; + }; + + return ListFormatTable; + })(); + + v2.TableList = (function() { + + /** + * Properties of a TableList. + * @memberof google.cloud.bigquery.v2 + * @interface ITableList + * @property {string|null} [kind] TableList kind + * @property {string|null} [etag] TableList etag + * @property {string|null} [nextPageToken] TableList nextPageToken + * @property {Array.|null} [tables] TableList tables + * @property {google.protobuf.IInt32Value|null} [totalItems] TableList totalItems + */ + + /** + * Constructs a new TableList. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableList. + * @implements ITableList + * @constructor + * @param {google.cloud.bigquery.v2.ITableList=} [properties] Properties to set + */ + function TableList(properties) { + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableList kind. + * @member {string} kind + * @memberof google.cloud.bigquery.v2.TableList + * @instance + */ + TableList.prototype.kind = ""; + + /** + * TableList etag. + * @member {string} etag + * @memberof google.cloud.bigquery.v2.TableList + * @instance + */ + TableList.prototype.etag = ""; + + /** + * TableList nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.v2.TableList + * @instance + */ + TableList.prototype.nextPageToken = ""; + + /** + * TableList tables. + * @member {Array.} tables + * @memberof google.cloud.bigquery.v2.TableList + * @instance + */ + TableList.prototype.tables = $util.emptyArray; + + /** + * TableList totalItems. + * @member {google.protobuf.IInt32Value|null|undefined} totalItems + * @memberof google.cloud.bigquery.v2.TableList + * @instance + */ + TableList.prototype.totalItems = null; + + /** + * Creates a new TableList instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {google.cloud.bigquery.v2.ITableList=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableList} TableList instance + */ + TableList.create = function create(properties) { + return new TableList(properties); + }; + + /** + * Encodes the specified TableList message. Does not implicitly {@link google.cloud.bigquery.v2.TableList.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {google.cloud.bigquery.v2.ITableList} message TableList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableList.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.google.cloud.bigquery.v2.ListFormatTable.encode(message.tables[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.totalItems != null && Object.hasOwnProperty.call(message, "totalItems")) + $root.google.protobuf.Int32Value.encode(message.totalItems, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableList message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {google.cloud.bigquery.v2.ITableList} message TableList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableList} TableList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableList.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.google.cloud.bigquery.v2.ListFormatTable.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.totalItems = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableList} TableList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableList message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableList.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ListFormatTable.verify(message.tables[i], long + 1); + if (error) + return "tables." + error; + } + } + if (message.totalItems != null && Object.hasOwnProperty.call(message, "totalItems")) { + var error = $root.google.protobuf.Int32Value.verify(message.totalItems, long + 1); + if (error) + return "totalItems." + error; + } + return null; + }; + + /** + * Creates a TableList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableList} TableList + */ + TableList.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableList) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableList: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableList(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.etag != null) + message.etag = String(object.etag); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.bigquery.v2.TableList.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (!$util.isObject(object.tables[i])) + throw TypeError(".google.cloud.bigquery.v2.TableList.tables: object expected"); + message.tables[i] = $root.google.cloud.bigquery.v2.ListFormatTable.fromObject(object.tables[i], long + 1); + } + } + if (object.totalItems != null) { + if (!$util.isObject(object.totalItems)) + throw TypeError(".google.cloud.bigquery.v2.TableList.totalItems: object expected"); + message.totalItems = $root.google.protobuf.Int32Value.fromObject(object.totalItems, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TableList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {google.cloud.bigquery.v2.TableList} message TableList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableList.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.tables = []; + if (options.defaults) { + object.kind = ""; + object.etag = ""; + object.nextPageToken = ""; + object.totalItems = null; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + object.etag = message.etag; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.google.cloud.bigquery.v2.ListFormatTable.toObject(message.tables[j], options, q + 1); + } + if (message.totalItems != null && Object.hasOwnProperty.call(message, "totalItems")) + object.totalItems = $root.google.protobuf.Int32Value.toObject(message.totalItems, options, q + 1); + return object; + }; + + /** + * Converts this TableList to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableList + * @instance + * @returns {Object.} JSON object + */ + TableList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableList + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableList"; + }; + + return TableList; + })(); + + v2.PrimaryKey = (function() { + + /** + * Properties of a PrimaryKey. + * @memberof google.cloud.bigquery.v2 + * @interface IPrimaryKey + * @property {Array.|null} [columns] PrimaryKey columns + */ + + /** + * Constructs a new PrimaryKey. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a PrimaryKey. + * @implements IPrimaryKey + * @constructor + * @param {google.cloud.bigquery.v2.IPrimaryKey=} [properties] Properties to set + */ + function PrimaryKey(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryKey columns. + * @member {Array.} columns + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @instance + */ + PrimaryKey.prototype.columns = $util.emptyArray; + + /** + * Creates a new PrimaryKey instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {google.cloud.bigquery.v2.IPrimaryKey=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.PrimaryKey} PrimaryKey instance + */ + PrimaryKey.create = function create(properties) { + return new PrimaryKey(properties); + }; + + /** + * Encodes the specified PrimaryKey message. Does not implicitly {@link google.cloud.bigquery.v2.PrimaryKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {google.cloud.bigquery.v2.IPrimaryKey} message PrimaryKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryKey.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columns[i]); + return writer; + }; + + /** + * Encodes the specified PrimaryKey message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.PrimaryKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {google.cloud.bigquery.v2.IPrimaryKey} message PrimaryKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PrimaryKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.PrimaryKey} PrimaryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryKey.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.PrimaryKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.PrimaryKey} PrimaryKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryKey message. + * @function verify + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryKey.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) + if (!$util.isString(message.columns[i])) + return "columns: string[] expected"; + } + return null; + }; + + /** + * Creates a PrimaryKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.PrimaryKey} PrimaryKey + */ + PrimaryKey.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.PrimaryKey) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.PrimaryKey: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.PrimaryKey(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.bigquery.v2.PrimaryKey.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) + message.columns[i] = String(object.columns[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrimaryKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {google.cloud.bigquery.v2.PrimaryKey} message PrimaryKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryKey.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = message.columns[j]; + } + return object; + }; + + /** + * Converts this PrimaryKey to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @instance + * @returns {Object.} JSON object + */ + PrimaryKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryKey + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.PrimaryKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.PrimaryKey"; + }; + + return PrimaryKey; + })(); + + v2.ColumnReference = (function() { + + /** + * Properties of a ColumnReference. + * @memberof google.cloud.bigquery.v2 + * @interface IColumnReference + * @property {string|null} [referencingColumn] ColumnReference referencingColumn + * @property {string|null} [referencedColumn] ColumnReference referencedColumn + */ + + /** + * Constructs a new ColumnReference. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ColumnReference. + * @implements IColumnReference + * @constructor + * @param {google.cloud.bigquery.v2.IColumnReference=} [properties] Properties to set + */ + function ColumnReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnReference referencingColumn. + * @member {string} referencingColumn + * @memberof google.cloud.bigquery.v2.ColumnReference + * @instance + */ + ColumnReference.prototype.referencingColumn = ""; + + /** + * ColumnReference referencedColumn. + * @member {string} referencedColumn + * @memberof google.cloud.bigquery.v2.ColumnReference + * @instance + */ + ColumnReference.prototype.referencedColumn = ""; + + /** + * Creates a new ColumnReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {google.cloud.bigquery.v2.IColumnReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ColumnReference} ColumnReference instance + */ + ColumnReference.create = function create(properties) { + return new ColumnReference(properties); + }; + + /** + * Encodes the specified ColumnReference message. Does not implicitly {@link google.cloud.bigquery.v2.ColumnReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {google.cloud.bigquery.v2.IColumnReference} message ColumnReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.referencingColumn != null && Object.hasOwnProperty.call(message, "referencingColumn")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referencingColumn); + if (message.referencedColumn != null && Object.hasOwnProperty.call(message, "referencedColumn")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.referencedColumn); + return writer; + }; + + /** + * Encodes the specified ColumnReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ColumnReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {google.cloud.bigquery.v2.IColumnReference} message ColumnReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ColumnReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ColumnReference} ColumnReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ColumnReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referencingColumn = reader.string(); + break; + } + case 2: { + message.referencedColumn = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ColumnReference} ColumnReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnReference message. + * @function verify + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.referencingColumn != null && Object.hasOwnProperty.call(message, "referencingColumn")) + if (!$util.isString(message.referencingColumn)) + return "referencingColumn: string expected"; + if (message.referencedColumn != null && Object.hasOwnProperty.call(message, "referencedColumn")) + if (!$util.isString(message.referencedColumn)) + return "referencedColumn: string expected"; + return null; + }; + + /** + * Creates a ColumnReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ColumnReference} ColumnReference + */ + ColumnReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ColumnReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ColumnReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ColumnReference(); + if (object.referencingColumn != null) + message.referencingColumn = String(object.referencingColumn); + if (object.referencedColumn != null) + message.referencedColumn = String(object.referencedColumn); + return message; + }; + + /** + * Creates a plain object from a ColumnReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {google.cloud.bigquery.v2.ColumnReference} message ColumnReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.referencingColumn = ""; + object.referencedColumn = ""; + } + if (message.referencingColumn != null && Object.hasOwnProperty.call(message, "referencingColumn")) + object.referencingColumn = message.referencingColumn; + if (message.referencedColumn != null && Object.hasOwnProperty.call(message, "referencedColumn")) + object.referencedColumn = message.referencedColumn; + return object; + }; + + /** + * Converts this ColumnReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ColumnReference + * @instance + * @returns {Object.} JSON object + */ + ColumnReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ColumnReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ColumnReference"; + }; + + return ColumnReference; + })(); + + v2.ForeignKey = (function() { + + /** + * Properties of a ForeignKey. + * @memberof google.cloud.bigquery.v2 + * @interface IForeignKey + * @property {string|null} [name] ForeignKey name + * @property {google.cloud.bigquery.v2.ITableReference|null} [referencedTable] ForeignKey referencedTable + * @property {Array.|null} [columnReferences] ForeignKey columnReferences + */ + + /** + * Constructs a new ForeignKey. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a ForeignKey. + * @implements IForeignKey + * @constructor + * @param {google.cloud.bigquery.v2.IForeignKey=} [properties] Properties to set + */ + function ForeignKey(properties) { + this.columnReferences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForeignKey name. + * @member {string} name + * @memberof google.cloud.bigquery.v2.ForeignKey + * @instance + */ + ForeignKey.prototype.name = ""; + + /** + * ForeignKey referencedTable. + * @member {google.cloud.bigquery.v2.ITableReference|null|undefined} referencedTable + * @memberof google.cloud.bigquery.v2.ForeignKey + * @instance + */ + ForeignKey.prototype.referencedTable = null; + + /** + * ForeignKey columnReferences. + * @member {Array.} columnReferences + * @memberof google.cloud.bigquery.v2.ForeignKey + * @instance + */ + ForeignKey.prototype.columnReferences = $util.emptyArray; + + /** + * Creates a new ForeignKey instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {google.cloud.bigquery.v2.IForeignKey=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.ForeignKey} ForeignKey instance + */ + ForeignKey.create = function create(properties) { + return new ForeignKey(properties); + }; + + /** + * Encodes the specified ForeignKey message. Does not implicitly {@link google.cloud.bigquery.v2.ForeignKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {google.cloud.bigquery.v2.IForeignKey} message ForeignKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignKey.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.referencedTable != null && Object.hasOwnProperty.call(message, "referencedTable")) + $root.google.cloud.bigquery.v2.TableReference.encode(message.referencedTable, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.columnReferences != null && message.columnReferences.length) + for (var i = 0; i < message.columnReferences.length; ++i) + $root.google.cloud.bigquery.v2.ColumnReference.encode(message.columnReferences[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ForeignKey message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.ForeignKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {google.cloud.bigquery.v2.IForeignKey} message ForeignKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForeignKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ForeignKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.ForeignKey} ForeignKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignKey.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.ForeignKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.referencedTable = $root.google.cloud.bigquery.v2.TableReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.columnReferences && message.columnReferences.length)) + message.columnReferences = []; + message.columnReferences.push($root.google.cloud.bigquery.v2.ColumnReference.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForeignKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.ForeignKey} ForeignKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForeignKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForeignKey message. + * @function verify + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForeignKey.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.referencedTable != null && Object.hasOwnProperty.call(message, "referencedTable")) { + var error = $root.google.cloud.bigquery.v2.TableReference.verify(message.referencedTable, long + 1); + if (error) + return "referencedTable." + error; + } + if (message.columnReferences != null && Object.hasOwnProperty.call(message, "columnReferences")) { + if (!Array.isArray(message.columnReferences)) + return "columnReferences: array expected"; + for (var i = 0; i < message.columnReferences.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ColumnReference.verify(message.columnReferences[i], long + 1); + if (error) + return "columnReferences." + error; + } + } + return null; + }; + + /** + * Creates a ForeignKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.ForeignKey} ForeignKey + */ + ForeignKey.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.ForeignKey) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.ForeignKey: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.ForeignKey(); + if (object.name != null) + message.name = String(object.name); + if (object.referencedTable != null) { + if (!$util.isObject(object.referencedTable)) + throw TypeError(".google.cloud.bigquery.v2.ForeignKey.referencedTable: object expected"); + message.referencedTable = $root.google.cloud.bigquery.v2.TableReference.fromObject(object.referencedTable, long + 1); + } + if (object.columnReferences) { + if (!Array.isArray(object.columnReferences)) + throw TypeError(".google.cloud.bigquery.v2.ForeignKey.columnReferences: array expected"); + message.columnReferences = []; + for (var i = 0; i < object.columnReferences.length; ++i) { + if (!$util.isObject(object.columnReferences[i])) + throw TypeError(".google.cloud.bigquery.v2.ForeignKey.columnReferences: object expected"); + message.columnReferences[i] = $root.google.cloud.bigquery.v2.ColumnReference.fromObject(object.columnReferences[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ForeignKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {google.cloud.bigquery.v2.ForeignKey} message ForeignKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForeignKey.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.columnReferences = []; + if (options.defaults) { + object.name = ""; + object.referencedTable = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.referencedTable != null && Object.hasOwnProperty.call(message, "referencedTable")) + object.referencedTable = $root.google.cloud.bigquery.v2.TableReference.toObject(message.referencedTable, options, q + 1); + if (message.columnReferences && message.columnReferences.length) { + object.columnReferences = []; + for (var j = 0; j < message.columnReferences.length; ++j) + object.columnReferences[j] = $root.google.cloud.bigquery.v2.ColumnReference.toObject(message.columnReferences[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ForeignKey to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.ForeignKey + * @instance + * @returns {Object.} JSON object + */ + ForeignKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForeignKey + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.ForeignKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForeignKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.ForeignKey"; + }; + + return ForeignKey; + })(); + + v2.TableConstraints = (function() { + + /** + * Properties of a TableConstraints. + * @memberof google.cloud.bigquery.v2 + * @interface ITableConstraints + * @property {google.cloud.bigquery.v2.IPrimaryKey|null} [primaryKey] TableConstraints primaryKey + * @property {Array.|null} [foreignKeys] TableConstraints foreignKeys + */ + + /** + * Constructs a new TableConstraints. + * @memberof google.cloud.bigquery.v2 + * @classdesc Represents a TableConstraints. + * @implements ITableConstraints + * @constructor + * @param {google.cloud.bigquery.v2.ITableConstraints=} [properties] Properties to set + */ + function TableConstraints(properties) { + this.foreignKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableConstraints primaryKey. + * @member {google.cloud.bigquery.v2.IPrimaryKey|null|undefined} primaryKey + * @memberof google.cloud.bigquery.v2.TableConstraints + * @instance + */ + TableConstraints.prototype.primaryKey = null; + + /** + * TableConstraints foreignKeys. + * @member {Array.} foreignKeys + * @memberof google.cloud.bigquery.v2.TableConstraints + * @instance + */ + TableConstraints.prototype.foreignKeys = $util.emptyArray; + + /** + * Creates a new TableConstraints instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {google.cloud.bigquery.v2.ITableConstraints=} [properties] Properties to set + * @returns {google.cloud.bigquery.v2.TableConstraints} TableConstraints instance + */ + TableConstraints.create = function create(properties) { + return new TableConstraints(properties); + }; + + /** + * Encodes the specified TableConstraints message. Does not implicitly {@link google.cloud.bigquery.v2.TableConstraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {google.cloud.bigquery.v2.ITableConstraints} message TableConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableConstraints.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.primaryKey != null && Object.hasOwnProperty.call(message, "primaryKey")) + $root.google.cloud.bigquery.v2.PrimaryKey.encode(message.primaryKey, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.foreignKeys != null && message.foreignKeys.length) + for (var i = 0; i < message.foreignKeys.length; ++i) + $root.google.cloud.bigquery.v2.ForeignKey.encode(message.foreignKeys[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableConstraints message, length delimited. Does not implicitly {@link google.cloud.bigquery.v2.TableConstraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {google.cloud.bigquery.v2.ITableConstraints} message TableConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableConstraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TableConstraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.v2.TableConstraints} TableConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableConstraints.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.v2.TableConstraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.primaryKey = $root.google.cloud.bigquery.v2.PrimaryKey.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (!(message.foreignKeys && message.foreignKeys.length)) + message.foreignKeys = []; + message.foreignKeys.push($root.google.cloud.bigquery.v2.ForeignKey.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TableConstraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.v2.TableConstraints} TableConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableConstraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableConstraints message. + * @function verify + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableConstraints.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.primaryKey != null && Object.hasOwnProperty.call(message, "primaryKey")) { + var error = $root.google.cloud.bigquery.v2.PrimaryKey.verify(message.primaryKey, long + 1); + if (error) + return "primaryKey." + error; + } + if (message.foreignKeys != null && Object.hasOwnProperty.call(message, "foreignKeys")) { + if (!Array.isArray(message.foreignKeys)) + return "foreignKeys: array expected"; + for (var i = 0; i < message.foreignKeys.length; ++i) { + var error = $root.google.cloud.bigquery.v2.ForeignKey.verify(message.foreignKeys[i], long + 1); + if (error) + return "foreignKeys." + error; + } + } + return null; + }; + + /** + * Creates a TableConstraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.v2.TableConstraints} TableConstraints + */ + TableConstraints.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.cloud.bigquery.v2.TableConstraints) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.bigquery.v2.TableConstraints: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.cloud.bigquery.v2.TableConstraints(); + if (object.primaryKey != null) { + if (!$util.isObject(object.primaryKey)) + throw TypeError(".google.cloud.bigquery.v2.TableConstraints.primaryKey: object expected"); + message.primaryKey = $root.google.cloud.bigquery.v2.PrimaryKey.fromObject(object.primaryKey, long + 1); + } + if (object.foreignKeys) { + if (!Array.isArray(object.foreignKeys)) + throw TypeError(".google.cloud.bigquery.v2.TableConstraints.foreignKeys: array expected"); + message.foreignKeys = []; + for (var i = 0; i < object.foreignKeys.length; ++i) { + if (!$util.isObject(object.foreignKeys[i])) + throw TypeError(".google.cloud.bigquery.v2.TableConstraints.foreignKeys: object expected"); + message.foreignKeys[i] = $root.google.cloud.bigquery.v2.ForeignKey.fromObject(object.foreignKeys[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TableConstraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {google.cloud.bigquery.v2.TableConstraints} message TableConstraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableConstraints.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.foreignKeys = []; + if (options.defaults) + object.primaryKey = null; + if (message.primaryKey != null && Object.hasOwnProperty.call(message, "primaryKey")) + object.primaryKey = $root.google.cloud.bigquery.v2.PrimaryKey.toObject(message.primaryKey, options, q + 1); + if (message.foreignKeys && message.foreignKeys.length) { + object.foreignKeys = []; + for (var j = 0; j < message.foreignKeys.length; ++j) + object.foreignKeys[j] = $root.google.cloud.bigquery.v2.ForeignKey.toObject(message.foreignKeys[j], options, q + 1); + } + return object; + }; + + /** + * Converts this TableConstraints to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.v2.TableConstraints + * @instance + * @returns {Object.} JSON object + */ + TableConstraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableConstraints + * @function getTypeUrl + * @memberof google.cloud.bigquery.v2.TableConstraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.v2.TableConstraints"; + }; + + return TableConstraints; + })(); + + return v2; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rules != null && Object.hasOwnProperty.call(message, "rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i], long + 1); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Http) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Http: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (!$util.isObject(object.rules[i])) + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i], long + 1); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options, q + 1); + } + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && Object.hasOwnProperty.call(message, "put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && Object.hasOwnProperty.call(message, "post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom, long + 1); + if (error) + return "custom." + error; + } + } + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && Object.hasOwnProperty.call(message, "additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i], long + 1); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.HttpRule) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.HttpRule: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (!$util.isObject(object.custom)) + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom, long + 1); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (!$util.isObject(object.additionalBindings[i])) + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + object.selector = message.selector; + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && Object.hasOwnProperty.call(message, "put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && Object.hasOwnProperty.call(message, "post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = message.body; + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options, q + 1); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options, q + 1); + } + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CustomHttpPattern: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && Object.hasOwnProperty.call(message, "destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CommonLanguageSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (!$util.isObject(object.selectiveGapicGeneration)) + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options, q + 1); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ClientLibrarySettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (!$util.isObject(object.javaSettings)) + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); + } + if (object.cppSettings != null) { + if (!$util.isObject(object.cppSettings)) + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); + } + if (object.phpSettings != null) { + if (!$util.isObject(object.phpSettings)) + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); + } + if (object.pythonSettings != null) { + if (!$util.isObject(object.pythonSettings)) + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); + } + if (object.nodeSettings != null) { + if (!$util.isObject(object.nodeSettings)) + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); + } + if (object.dotnetSettings != null) { + if (!$util.isObject(object.dotnetSettings)) + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); + } + if (object.rubySettings != null) { + if (!$util.isObject(object.rubySettings)) + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); + } + if (object.goSettings != null) { + if (!$util.isObject(object.goSettings)) + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + object.version = message.version; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options, q + 1); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options, q + 1); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options, q + 1); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options, q + 1); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options, q + 1); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options, q + 1); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options, q + 1); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options, q + 1); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork(), q + 1).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methodSettings != null && Object.hasOwnProperty.call(message, "methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i], long + 1); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && Object.hasOwnProperty.call(message, "codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && Object.hasOwnProperty.call(message, "librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i], long + 1); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Publishing) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Publishing: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (!$util.isObject(object.methodSettings[i])) + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i], long + 1); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (!$util.isObject(object.librarySettings[i])) + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i], long + 1); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options, q + 1); + } + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options, q + 1); + } + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.serviceClassNames, key); + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.JavaSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.JavaSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (!$util.isObject(object.serviceClassNames)) + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.serviceClassNames, keys[i]); + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + } + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.serviceClassNames, keys2[j]); + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CppSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CppSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PhpSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PhpSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.experimentalFeatures != null) { + if (!$util.isObject(object.experimentalFeatures)) + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options, q + 1); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings.ExperimentalFeatures: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.NodeSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.NodeSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedResources, key); + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && Object.hasOwnProperty.call(message, "ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && Object.hasOwnProperty.call(message, "forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && Object.hasOwnProperty.call(message, "handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.DotnetSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (!$util.isObject(object.renamedServices)) + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + if (object.renamedResources) { + if (!$util.isObject(object.renamedResources)) + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedResources, keys[i]); + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedResources, keys2[j]); + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.RubySettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.RubySettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.GoSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.GoSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (!$util.isObject(object.renamedServices)) + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && Object.hasOwnProperty.call(message, "autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (!$util.isObject(object.longRunning)) + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + object.selector = message.selector; + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options, q + 1); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings.LongRunning: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (!$util.isObject(object.initialPollDelay)) + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (!$util.isObject(object.maxPollDelay)) + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); + } + if (object.totalPollTimeout != null) { + if (!$util.isObject(object.totalPollTimeout)) + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options, q + 1); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options, q + 1); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options, q + 1); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methods != null && Object.hasOwnProperty.call(message, "methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.SelectiveGapicGeneration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && Object.hasOwnProperty.call(message, "pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && Object.hasOwnProperty.call(message, "style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + object.nameField = message.nameField; + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + object.plural = message.plural; + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ResourceReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.file != null && Object.hasOwnProperty.call(message, "file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i], long + 1); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorSet: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (!$util.isObject(object.file[i])) + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options, q + 1); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.optionDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && Object.hasOwnProperty.call(message, "publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && Object.hasOwnProperty.call(message, "weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.optionDependency != null && Object.hasOwnProperty.call(message, "optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i], long + 1); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.service != null && Object.hasOwnProperty.call(message, "service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i], long + 1); + if (error) + return "service." + error; + } + } + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (!$util.isObject(object.messageType[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (!$util.isObject(object.enumType[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (!$util.isObject(object.service[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (!$util.isObject(object.extension[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options, long + 1); + } + if (object.sourceCodeInfo != null) { + if (!$util.isObject(object.sourceCodeInfo)) + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo, long + 1); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options, q + 1); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options, q + 1); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options, q + 1); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options, q + 1); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + object.syntax = message.syntax; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i], long + 1); + if (error) + return "field." + error; + } + } + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && Object.hasOwnProperty.call(message, "nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i], long + 1); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && Object.hasOwnProperty.call(message, "extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i], long + 1); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && Object.hasOwnProperty.call(message, "oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i], long + 1); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (!$util.isObject(object.field[i])) + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (!$util.isObject(object.extension[i])) + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (!$util.isObject(object.nestedType[i])) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (!$util.isObject(object.enumType[i])) + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (!$util.isObject(object.extensionRange[i])) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i], long + 1); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (!$util.isObject(object.oneofDecl[i])) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (!$util.isObject(object.reservedRange[i])) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options, q + 1); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options, q + 1); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options, q + 1); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options, q + 1); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options, q + 1); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options, q + 1); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ReservedRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && Object.hasOwnProperty.call(message, "declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i], long + 1); + if (error) + return "declaration." + error; + } + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (!$util.isObject(object.declaration[i])) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i], long + 1); + } + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options, q + 1); + } + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.Declaration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + object.fullName = message.fullName; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + object.reserved = message.reserved; + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + object.extendee = message.extendee; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options, q + 1); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i], long + 1); + if (error) + return "value." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (!$util.isObject(object.value[i])) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (!$util.isObject(object.reservedRange[i])) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options, q + 1); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options, q + 1); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto.EnumReservedRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && Object.hasOwnProperty.call(message, "method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i], long + 1); + if (error) + return "method." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (!$util.isObject(object.method[i])) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options, long + 1); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + object.inputType = message.inputType; + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + object.outputType = message.outputType; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options, q + 1); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i], long + 1); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (!$util.isObject(object[".google.api.resourceDefinition"][i])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options, q + 1); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"], long + 1); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MessageOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resource"] != null) { + if (!$util.isObject(object[".google.api.resource"])) + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options, q + 1); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && Object.hasOwnProperty.call(message, "targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && Object.hasOwnProperty.call(message, "editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i], long + 1); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"], long + 1); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (!$util.isObject(object.editionDefaults[i])) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i], long + 1); + } + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.featureSupport != null) { + if (!$util.isObject(object.featureSupport)) + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (!$util.isObject(object[".google.api.resourceReference"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + object.packed = message.packed; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + object.lazy = message.lazy; + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options, q + 1); + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options, q + 1); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.EditionDefault: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.FeatureSupport: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (!$util.isObject(object.featureSupport)) + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"], long + 1); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && Object.hasOwnProperty.call(message, ".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.http"] != null) { + if (!$util.isObject(object[".google.api.http"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"], long + 1); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options, q + 1); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i], long + 1); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (!$util.isObject(object.name[i])) + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i], long + 1); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue, true); + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue, false); + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options, q + 1); + } + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.positiveIntValue = typeof message.positiveIntValue === "number" ? BigInt(message.positiveIntValue) : $util.Long.fromBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0, true).toBigInt(); + else if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.negativeIntValue = typeof message.negativeIntValue === "number" ? BigInt(message.negativeIntValue) : $util.Long.fromBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0, false).toBigInt(); + else if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + if (!Object.hasOwnProperty.call(message, "namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!Object.hasOwnProperty.call(message, "isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption.NamePart: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && Object.hasOwnProperty.call(message, "namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && Object.hasOwnProperty.call(message, "isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSet: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaults != null && Object.hasOwnProperty.call(message, "defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i], long + 1); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (!$util.isObject(object.defaults[i])) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i], long + 1); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options, q + 1); + } + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (!$util.isObject(object.overridableFeatures)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); + } + if (object.fixedFeatures != null) { + if (!$util.isObject(object.fixedFeatures)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options, q + 1); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options, q + 1); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i], long + 1); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (!$util.isObject(object.location[i])) + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options, q + 1); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && Object.hasOwnProperty.call(message, "span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && Object.hasOwnProperty.call(message, "leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i], long + 1); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (!$util.isObject(object.annotation[i])) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options, q + 1); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + object.begin = message.begin; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Duration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Duration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + message.seconds = $util.Long.fromValue(object.seconds, false); + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.nanos = 0; + } + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DoubleValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FloatValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Int64Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + message.value = $util.Long.fromValue(object.value, false); + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.value = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.value = typeof message.value === "number" ? BigInt(message.value) : $util.Long.fromBits(message.value.low >>> 0, message.value.high >>> 0, false).toBigInt(); + else if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UInt64Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + message.value = $util.Long.fromValue(object.value, true); + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.value = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.value = typeof message.value === "number" ? BigInt(message.value) : $util.Long.fromBits(message.value.low >>> 0, message.value.high >>> 0, true).toBigInt(); + else if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Int32Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UInt32Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.BoolValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.StringValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.BytesValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Timestamp: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + message.seconds = $util.Long.fromValue(object.seconds, false); + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.nanos = 0; + } + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.fields, key); + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]], long + 1); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Struct) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Struct: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (!$util.isObject(object.fields)) + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.fields, keys[i]); + if (!$util.isObject(object.fields[keys[i]])) + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.fields, keys2[j]); + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options, q + 1); + } + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue, long + 1); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue, long + 1); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (!$util.isObject(object.structValue)) + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue, long + 1); + } + if (object.listValue != null) { + if (!$util.isObject(object.listValue)) + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options, q + 1); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options, q + 1); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i], long + 1); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ListValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (!$util.isObject(object.values[i])) + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.type.Expr) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.type.Expr: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + object.expression = message.expression; + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + object.title = message.title; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-api/protos/protos.json b/packages/google-cloud-bigquery-api/protos/protos.json new file mode 100644 index 000000000000..4f5c5105a182 --- /dev/null +++ b/packages/google-cloud-bigquery-api/protos/protos.json @@ -0,0 +1,13084 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "v2": { + "options": { + "go_package": "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb", + "java_multiple_files": true, + "java_outer_classname": "TableConstraintsProto", + "java_package": "com.google.cloud.bigquery.v2", + "(google.api.resource_definition).type": "storage.googleapis.com/Bucket", + "(google.api.resource_definition).pattern": "*" + }, + "nested": { + "BigLakeConfiguration": { + "fields": { + "connectionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileFormat": { + "type": "FileFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tableFormat": { + "type": "TableFormat", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FileFormat": { + "values": { + "FILE_FORMAT_UNSPECIFIED": 0, + "PARQUET": 1 + } + }, + "TableFormat": { + "values": { + "TABLE_FORMAT_UNSPECIFIED": 0, + "ICEBERG": 1 + } + } + } + }, + "Clustering": { + "fields": { + "fields": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DataFormatOptions": { + "fields": { + "useInt64Timestamp": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timestampOutputFormat": { + "type": "TimestampOutputFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TimestampOutputFormat": { + "values": { + "TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED": 0, + "FLOAT64": 1, + "INT64": 2, + "ISO8601_STRING": 3 + } + } + } + }, + "DatasetService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + } + } + ] + }, + "InsertDataset": { + "requestType": "InsertDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets", + "(google.api.http).body": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets", + "body": "dataset" + } + } + ] + }, + "PatchDataset": { + "requestType": "UpdateOrPatchDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}", + "(google.api.http).body": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}", + "body": "dataset" + } + } + ] + }, + "UpdateDataset": { + "requestType": "UpdateOrPatchDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}", + "(google.api.http).body": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}", + "body": "dataset" + } + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}" + } + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "DatasetList", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets" + } + } + ] + }, + "UndeleteDataset": { + "requestType": "UndeleteDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}:undelete", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}:undelete", + "body": "*" + } + } + ] + } + } + }, + "DatasetAccessEntry": { + "fields": { + "dataset": { + "type": "DatasetReference", + "id": 1 + }, + "targetTypes": { + "rule": "repeated", + "type": "TargetType", + "id": 2 + } + }, + "nested": { + "TargetType": { + "values": { + "TARGET_TYPE_UNSPECIFIED": 0, + "VIEWS": 1, + "ROUTINES": 2 + } + } + } + }, + "Access": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "userByEmail": { + "type": "string", + "id": 2 + }, + "groupByEmail": { + "type": "string", + "id": 3 + }, + "domain": { + "type": "string", + "id": 4 + }, + "specialGroup": { + "type": "string", + "id": 5 + }, + "iamMember": { + "type": "string", + "id": 7 + }, + "view": { + "type": "TableReference", + "id": 6 + }, + "routine": { + "type": "RoutineReference", + "id": 8 + }, + "dataset": { + "type": "DatasetAccessEntry", + "id": 9 + }, + "condition": { + "type": "google.type.Expr", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Dataset": { + "oneofs": { + "_catalogSource": { + "oneof": [ + "catalogSource" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selfLink": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "datasetReference": { + "type": "DatasetReference", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "google.protobuf.StringValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultTableExpirationMs": { + "type": "google.protobuf.Int64Value", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultPartitionExpirationMs": { + "type": "google.protobuf.Int64Value", + "id": 14 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "access": { + "rule": "repeated", + "type": "Access", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "creationTime": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifiedTime": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 13 + }, + "defaultEncryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 16 + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "google.protobuf.BoolValue", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "catalogSource": { + "type": "string", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "linkedDatasetSource": { + "type": "LinkedDatasetSource", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "linkedDatasetMetadata": { + "type": "LinkedDatasetMetadata", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalDatasetReference": { + "type": "ExternalDatasetReference", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "externalCatalogDatasetOptions": { + "type": "ExternalCatalogDatasetOptions", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "isCaseInsensitive": { + "type": "google.protobuf.BoolValue", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultCollation": { + "type": "google.protobuf.StringValue", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultRoundingMode": { + "type": "TableFieldSchema.RoundingMode", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxTimeTravelHours": { + "type": "google.protobuf.Int64Value", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "rule": "repeated", + "type": "GcpTag", + "id": 24, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageBillingModel": { + "type": "StorageBillingModel", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "restrictions": { + "type": "RestrictionConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceTags": { + "keyType": "string", + "type": "string", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "StorageBillingModel": { + "values": { + "STORAGE_BILLING_MODEL_UNSPECIFIED": 0, + "LOGICAL": 1, + "PHYSICAL": 2 + } + } + } + }, + "GcpTag": { + "fields": { + "tagKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tagValue": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LinkedDatasetSource": { + "fields": { + "sourceDataset": { + "type": "DatasetReference", + "id": 1 + } + } + }, + "LinkedDatasetMetadata": { + "fields": { + "linkState": { + "type": "LinkState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LinkState": { + "values": { + "LINK_STATE_UNSPECIFIED": 0, + "LINKED": 1, + "UNLINKED": 2 + } + } + } + }, + "GetDatasetRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetView": { + "type": "DatasetView", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessPolicyVersion": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DatasetView": { + "values": { + "DATASET_VIEW_UNSPECIFIED": 0, + "METADATA": 1, + "ACL": 2, + "FULL": 3 + } + } + } + }, + "InsertDatasetRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataset": { + "type": "Dataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "accessPolicyVersion": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateOrPatchDatasetRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataset": { + "type": "Dataset", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMode": { + "type": "UpdateMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessPolicyVersion": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UpdateMode": { + "values": { + "UPDATE_MODE_UNSPECIFIED": 0, + "UPDATE_METADATA": 1, + "UPDATE_ACL": 2, + "UPDATE_FULL": 3 + } + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deleteContents": { + "type": "bool", + "id": 3 + } + } + }, + "ListDatasetsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "all": { + "type": "bool", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListFormatDataset": { + "oneofs": { + "_catalogSource": { + "oneof": [ + "catalogSource" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "datasetReference": { + "type": "DatasetReference", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + }, + "type": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "catalogSource": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "externalDatasetReference": { + "type": "ExternalDatasetReference", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DatasetList": { + "fields": { + "kind": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "datasets": { + "rule": "repeated", + "type": "ListFormatDataset", + "id": 4 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "UndeleteDatasetRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deletionTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DatasetReference": { + "fields": { + "datasetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EncryptionConfiguration": { + "fields": { + "kmsKeyName": { + "type": "google.protobuf.StringValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExternalCatalogDatasetOptions": { + "fields": { + "parameters": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultStorageLocationUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExternalDatasetReference": { + "fields": { + "externalSource": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connection": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryconnection.googleapis.com/Connection" + } + } + } + }, + "RestrictionConfig": { + "fields": { + "type": { + "type": "RestrictionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RestrictionType": { + "values": { + "RESTRICTION_TYPE_UNSPECIFIED": 0, + "RESTRICTED_DATA_EGRESS": 1 + } + } + } + }, + "RoutineReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routineId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TableReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TableSchema": { + "fields": { + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 1 + }, + "foreignTypeInfo": { + "type": "ForeignTypeInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ForeignTypeInfo": { + "fields": { + "typeSystem": { + "type": "TypeSystem", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "TypeSystem": { + "values": { + "TYPE_SYSTEM_UNSPECIFIED": 0, + "HIVE": 1 + } + } + } + }, + "DataPolicyOption": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "DataPolicyList": { + "fields": { + "dataPolicies": { + "rule": "repeated", + "type": "DataPolicyOption", + "id": 1 + } + } + }, + "TableFieldSchema": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "google.protobuf.StringValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "policyTags": { + "type": "PolicyTagList", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataGovernanceTagsInfo": { + "type": "DataGovernanceTagsInfo", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataPolicies": { + "rule": "repeated", + "type": "DataPolicyOption", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataPolicyList": { + "type": "DataPolicyList", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxLength": { + "type": "int64", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "precision": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scale": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timestampPrecision": { + "type": "google.protobuf.Int64Value", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "roundingMode": { + "type": "RoundingMode", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "collation": { + "type": "google.protobuf.StringValue", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultValueExpression": { + "type": "google.protobuf.StringValue", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rangeElementType": { + "type": "FieldElementType", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "foreignTypeDefinition": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generatedColumn": { + "type": "GeneratedColumn", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PolicyTagList": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DataGovernanceTagsInfo": { + "fields": { + "dataGovernanceTags": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RoundingMode": { + "values": { + "ROUNDING_MODE_UNSPECIFIED": 0, + "ROUND_HALF_AWAY_FROM_ZERO": 1, + "ROUND_HALF_EVEN": 2 + } + }, + "FieldElementType": { + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GeneratedExpressionInfo": { + "oneofs": { + "_generationExpression": { + "oneof": [ + "generationExpression" + ] + }, + "_asynchronous": { + "oneof": [ + "asynchronous" + ] + }, + "_stored": { + "oneof": [ + "stored" + ] + } + }, + "fields": { + "generationExpression": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "asynchronous": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "stored": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GeneratedColumn": { + "oneofs": { + "_generatedMode": { + "oneof": [ + "generatedMode" + ] + }, + "definition": { + "oneof": [ + "generatedExpressionInfo" + ] + } + }, + "fields": { + "generatedMode": { + "type": "GeneratedMode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "generatedExpressionInfo": { + "type": "GeneratedExpressionInfo", + "id": 3 + } + }, + "nested": { + "GeneratedMode": { + "values": { + "GENERATED_MODE_UNSPECIFIED": 0, + "GENERATED_ALWAYS": 1, + "GENERATED_BY_DEFAULT": 2 + } + } + } + } + } + }, + "DecimalTargetType": { + "values": { + "DECIMAL_TARGET_TYPE_UNSPECIFIED": 0, + "NUMERIC": 1, + "BIGNUMERIC": 2, + "STRING": 3 + } + }, + "ErrorProto": { + "fields": { + "reason": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "debugInfo": { + "type": "string", + "id": 3 + }, + "message": { + "type": "string", + "id": 4 + } + } + }, + "ExternalCatalogTableOptions": { + "fields": { + "parameters": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageDescriptor": { + "type": "StorageDescriptor", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StorageDescriptor": { + "fields": { + "locationUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputFormat": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFormat": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serdeInfo": { + "type": "SerDeInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SerDeInfo": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serializationLibrary": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AvroOptions": { + "fields": { + "useAvroLogicalTypes": { + "type": "google.protobuf.BoolValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ParquetOptions": { + "fields": { + "enumAsString": { + "type": "google.protobuf.BoolValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableListInference": { + "type": "google.protobuf.BoolValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mapTargetType": { + "type": "MapTargetType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CsvOptions": { + "fields": { + "fieldDelimiter": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipLeadingRows": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quote": { + "type": "google.protobuf.StringValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowQuotedNewlines": { + "type": "google.protobuf.BoolValue", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowJaggedRows": { + "type": "google.protobuf.BoolValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preserveAsciiControlCharacters": { + "type": "google.protobuf.BoolValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullMarker": { + "type": "google.protobuf.StringValue", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullMarkers": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceColumnMatch": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JsonOptions": { + "fields": { + "encoding": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BigtableProtoConfig": { + "fields": { + "schemaBundleId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoMessageName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BigtableColumn": { + "fields": { + "qualifierEncoded": { + "type": "google.protobuf.BytesValue", + "id": 1 + }, + "qualifierString": { + "type": "google.protobuf.StringValue", + "id": 2 + }, + "fieldName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "onlyReadLatest": { + "type": "google.protobuf.BoolValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoConfig": { + "type": "BigtableProtoConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BigtableColumnFamily": { + "fields": { + "familyId": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "columns": { + "rule": "repeated", + "type": "BigtableColumn", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "onlyReadLatest": { + "type": "google.protobuf.BoolValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoConfig": { + "type": "BigtableProtoConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BigtableOptions": { + "fields": { + "columnFamilies": { + "rule": "repeated", + "type": "BigtableColumnFamily", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnspecifiedColumnFamilies": { + "type": "google.protobuf.BoolValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readRowkeyAsString": { + "type": "google.protobuf.BoolValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputColumnFamiliesAsJson": { + "type": "google.protobuf.BoolValue", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GoogleSheetsOptions": { + "fields": { + "skipLeadingRows": { + "type": "google.protobuf.Int64Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "range": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExternalDataConfiguration": { + "oneofs": { + "_objectMetadata": { + "oneof": [ + "objectMetadata" + ] + }, + "_timeZone": { + "oneof": [ + "timeZone" + ] + }, + "_dateFormat": { + "oneof": [ + "dateFormat" + ] + }, + "_datetimeFormat": { + "oneof": [ + "datetimeFormat" + ] + }, + "_timeFormat": { + "oneof": [ + "timeFormat" + ] + }, + "_timestampFormat": { + "oneof": [ + "timestampFormat" + ] + } + }, + "fields": { + "sourceUris": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "fileSetSpecType": { + "type": "FileSetSpecType", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schema": { + "type": "TableSchema", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceFormat": { + "type": "string", + "id": 3 + }, + "maxBadRecords": { + "type": "google.protobuf.Int32Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autodetect": { + "type": "google.protobuf.BoolValue", + "id": 5 + }, + "ignoreUnknownValues": { + "type": "google.protobuf.BoolValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "compression": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "csvOptions": { + "type": "CsvOptions", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jsonOptions": { + "type": "JsonOptions", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigtableOptions": { + "type": "BigtableOptions", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSheetsOptions": { + "type": "GoogleSheetsOptions", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hivePartitioningOptions": { + "type": "HivePartitioningOptions", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionId": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "decimalTargetTypes": { + "rule": "repeated", + "type": "DecimalTargetType", + "id": 16 + }, + "avroOptions": { + "type": "AvroOptions", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jsonExtension": { + "type": "JsonExtension", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parquetOptions": { + "type": "ParquetOptions", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "objectMetadata": { + "type": "ObjectMetadata", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "referenceFileSchemaUri": { + "type": "google.protobuf.StringValue", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadataCacheMode": { + "type": "MetadataCacheMode", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "dateFormat": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "datetimeFormat": { + "type": "string", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "timeFormat": { + "type": "string", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "timestampFormat": { + "type": "string", + "id": 31, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "timestampTargetPrecision": { + "rule": "repeated", + "type": "int32", + "id": 32 + } + }, + "nested": { + "ObjectMetadata": { + "values": { + "OBJECT_METADATA_UNSPECIFIED": 0, + "DIRECTORY": 1, + "SIMPLE": 2 + } + }, + "MetadataCacheMode": { + "values": { + "METADATA_CACHE_MODE_UNSPECIFIED": 0, + "AUTOMATIC": 1, + "MANUAL": 2 + } + } + } + }, + "FileSetSpecType": { + "values": { + "FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH": 0, + "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST": 1 + } + }, + "HivePartitioningOptions": { + "fields": { + "mode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceUriPrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requirePartitionFilter": { + "type": "google.protobuf.BoolValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fields": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "JsonExtension": { + "values": { + "JSON_EXTENSION_UNSPECIFIED": 0, + "GEOJSON": 1 + } + }, + "MapTargetType": { + "values": { + "MAP_TARGET_TYPE_UNSPECIFIED": 0, + "ARRAY_OF_STRUCT": 1 + } + }, + "GenAiFunctionErrorStats": { + "fields": { + "errors": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "numFailedRows": { + "type": "int64", + "id": 5 + } + } + }, + "GenAiFunctionCostOptimizationStats": { + "oneofs": { + "_numCostOptimizedRows": { + "oneof": [ + "numCostOptimizedRows" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "numCostOptimizedRows": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "message": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "GenAiFunctionCacheStats": { + "oneofs": { + "_numCacheHitRows": { + "oneof": [ + "numCacheHitRows" + ] + } + }, + "fields": { + "numCacheHitRows": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "GenAiFunctionStats": { + "oneofs": { + "_functionName": { + "oneof": [ + "functionName" + ] + }, + "_prompt": { + "oneof": [ + "prompt" + ] + }, + "_numProcessedRows": { + "oneof": [ + "numProcessedRows" + ] + }, + "_errorStats": { + "oneof": [ + "errorStats" + ] + }, + "_costOptimizationStats": { + "oneof": [ + "costOptimizationStats" + ] + }, + "_cacheStats": { + "oneof": [ + "cacheStats" + ] + } + }, + "fields": { + "functionName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "prompt": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "numProcessedRows": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "errorStats": { + "type": "GenAiFunctionErrorStats", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "costOptimizationStats": { + "type": "GenAiFunctionCostOptimizationStats", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "cacheStats": { + "type": "GenAiFunctionCacheStats", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "GenAiErrorStats": { + "fields": { + "errors": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GenAiStats": { + "oneofs": { + "_errorStats": { + "oneof": [ + "errorStats" + ] + } + }, + "fields": { + "errorStats": { + "type": "GenAiErrorStats", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "functionStats": { + "rule": "repeated", + "type": "GenAiFunctionStats", + "id": 5 + } + } + }, + "JobService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_write" + }, + "methods": { + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "JobCancelResponse", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/cancel" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/cancel" + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}" + } + } + ] + }, + "InsertJob": { + "requestType": "InsertJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/jobs", + "(google.api.http).body": "job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/jobs", + "body": "job" + } + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/delete" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/delete" + } + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "JobList", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/jobs" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/jobs" + } + } + ] + }, + "GetQueryResults": { + "requestType": "GetQueryResultsRequest", + "responseType": "GetQueryResultsResponse", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/queries/{job_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/queries/{job_id=*}" + } + } + ] + }, + "Query": { + "requestType": "PostQueryRequest", + "responseType": "QueryResponse", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/queries", + "(google.api.http).body": "query_request" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/queries", + "body": "query_request" + } + } + ] + } + } + }, + "Job": { + "fields": { + "kind": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selfLink": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "userEmail": { + "type": "string", + "id": 5, + "options": { + "json_name": "user_email", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configuration": { + "type": "JobConfiguration", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobReference": { + "type": "JobReference", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "statistics": { + "type": "JobStatistics", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "JobStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "principalSubject": { + "type": "string", + "id": 13, + "options": { + "json_name": "principal_subject", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobCreationReason": { + "type": "JobCreationReason", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CancelJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "JobCancelResponse": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "job": { + "type": "Job", + "id": 2 + } + } + }, + "GetJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "InsertJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "job": { + "type": "Job", + "id": 3 + } + } + }, + "DeleteJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "ListJobsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "allUsers": { + "type": "bool", + "id": 2 + }, + "maxResults": { + "type": "google.protobuf.Int32Value", + "id": 3 + }, + "minCreationTime": { + "type": "uint64", + "id": 4 + }, + "maxCreationTime": { + "type": "google.protobuf.UInt64Value", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "projection": { + "type": "Projection", + "id": 7 + }, + "stateFilter": { + "rule": "repeated", + "type": "StateFilter", + "id": 8 + }, + "parentJobId": { + "type": "string", + "id": 9 + } + }, + "nested": { + "Projection": { + "options": { + "allow_alias": true + }, + "values": { + "minimal": 0, + "MINIMAL": 0, + "full": 1, + "FULL": 1 + } + }, + "StateFilter": { + "options": { + "allow_alias": true + }, + "values": { + "done": 0, + "DONE": 0, + "pending": 1, + "PENDING": 1, + "running": 2, + "RUNNING": 2 + } + } + } + }, + "ListFormatJob": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + }, + "jobReference": { + "type": "JobReference", + "id": 3 + }, + "state": { + "type": "string", + "id": 4 + }, + "errorResult": { + "type": "ErrorProto", + "id": 5 + }, + "statistics": { + "type": "JobStatistics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configuration": { + "type": "JobConfiguration", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "status": { + "type": "JobStatus", + "id": 8 + }, + "userEmail": { + "type": "string", + "id": 9, + "options": { + "json_name": "user_email" + } + }, + "principalSubject": { + "type": "string", + "id": 10, + "options": { + "json_name": "principal_subject" + } + } + } + }, + "JobList": { + "fields": { + "etag": { + "type": "string", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "jobs": { + "rule": "repeated", + "type": "ListFormatJob", + "id": 4 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "GetQueryResultsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startIndex": { + "type": "google.protobuf.UInt64Value", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 5 + }, + "timeoutMs": { + "type": "google.protobuf.UInt32Value", + "id": 6 + }, + "location": { + "type": "string", + "id": 7 + }, + "formatOptions": { + "type": "DataFormatOptions", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetQueryResultsResponse": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "etag": { + "type": "string", + "id": 2 + }, + "schema": { + "type": "TableSchema", + "id": 3 + }, + "jobReference": { + "type": "JobReference", + "id": 4 + }, + "totalRows": { + "type": "google.protobuf.UInt64Value", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "rows": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 7 + }, + "totalBytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 8 + }, + "jobComplete": { + "type": "google.protobuf.BoolValue", + "id": 9 + }, + "errors": { + "rule": "repeated", + "type": "ErrorProto", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cacheHit": { + "type": "google.protobuf.BoolValue", + "id": 11 + }, + "numDmlAffectedRows": { + "type": "google.protobuf.Int64Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PostQueryRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "queryRequest": { + "type": "QueryRequest", + "id": 2 + } + } + }, + "QueryRequest": { + "oneofs": { + "_jobTimeoutMs": { + "oneof": [ + "jobTimeoutMs" + ] + }, + "_maxSlots": { + "oneof": [ + "maxSlots" + ] + }, + "_reservation": { + "oneof": [ + "reservation" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 2 + }, + "query": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultDataset": { + "type": "DatasetReference", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeoutMs": { + "type": "google.protobuf.UInt32Value", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobTimeoutMs": { + "type": "int64", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxSlots": { + "type": "int32", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "destinationEncryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dryRun": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useQueryCache": { + "type": "google.protobuf.BoolValue", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useLegacySql": { + "type": "google.protobuf.BoolValue", + "id": 10 + }, + "parameterMode": { + "type": "string", + "id": 11 + }, + "queryParameters": { + "rule": "repeated", + "type": "QueryParameter", + "id": 12 + }, + "location": { + "type": "string", + "id": 13 + }, + "formatOptions": { + "type": "DataFormatOptions", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionProperties": { + "rule": "repeated", + "type": "ConnectionProperty", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumBytesBilled": { + "type": "google.protobuf.Int64Value", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createSession": { + "type": "google.protobuf.BoolValue", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobCreationMode": { + "type": "JobCreationMode", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reservation": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation", + "proto3_optional": true + } + }, + "writeIncrementalResults": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "JobCreationMode": { + "values": { + "JOB_CREATION_MODE_UNSPECIFIED": 0, + "JOB_CREATION_REQUIRED": 1, + "JOB_CREATION_OPTIONAL": 2 + } + } + } + }, + "QueryResponse": { + "oneofs": { + "_totalBytesBilled": { + "oneof": [ + "totalBytesBilled" + ] + }, + "_totalSlotMs": { + "oneof": [ + "totalSlotMs" + ] + }, + "_creationTime": { + "oneof": [ + "creationTime" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + }, + "_endTime": { + "oneof": [ + "endTime" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "schema": { + "type": "TableSchema", + "id": 2 + }, + "jobReference": { + "type": "JobReference", + "id": 3 + }, + "jobCreationReason": { + "type": "JobCreationReason", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "queryId": { + "type": "string", + "id": 14 + }, + "location": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRows": { + "type": "google.protobuf.UInt64Value", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "rows": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 6 + }, + "totalBytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 7 + }, + "totalBytesBilled": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "totalSlotMs": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "jobComplete": { + "type": "google.protobuf.BoolValue", + "id": 8 + }, + "errors": { + "rule": "repeated", + "type": "ErrorProto", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cacheHit": { + "type": "google.protobuf.BoolValue", + "id": 10 + }, + "numDmlAffectedRows": { + "type": "google.protobuf.Int64Value", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dmlStats": { + "type": "DmlStats", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creationTime": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "startTime": { + "type": "int64", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "endTime": { + "type": "int64", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "DestinationTableProperties": { + "fields": { + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "google.protobuf.StringValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ConnectionProperty": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "JobConfigurationQuery": { + "oneofs": { + "_systemVariables": { + "oneof": [ + "systemVariables" + ] + } + }, + "fields": { + "query": { + "type": "string", + "id": 1 + }, + "destinationTable": { + "type": "TableReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "externalTableDefinitions": { + "keyType": "string", + "type": "ExternalDataConfiguration", + "id": 23, + "options": { + "json_name": "tableDefinitions", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userDefinedFunctionResources": { + "rule": "repeated", + "type": "UserDefinedFunctionResource", + "id": 4 + }, + "createDisposition": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeDisposition": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultDataset": { + "type": "DatasetReference", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "priority": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowLargeResults": { + "type": "google.protobuf.BoolValue", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useQueryCache": { + "type": "google.protobuf.BoolValue", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flattenResults": { + "type": "google.protobuf.BoolValue", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maximumBytesBilled": { + "type": "google.protobuf.Int64Value", + "id": 14 + }, + "useLegacySql": { + "type": "google.protobuf.BoolValue", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterMode": { + "type": "string", + "id": 16 + }, + "queryParameters": { + "rule": "repeated", + "type": "QueryParameter", + "id": 17 + }, + "systemVariables": { + "type": "SystemVariables", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "schemaUpdateOptions": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "timePartitioning": { + "type": "TimePartitioning", + "id": 19 + }, + "rangePartitioning": { + "type": "RangePartitioning", + "id": 22 + }, + "clustering": { + "type": "Clustering", + "id": 20 + }, + "destinationEncryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 21 + }, + "scriptOptions": { + "type": "ScriptOptions", + "id": 24 + }, + "connectionProperties": { + "rule": "repeated", + "type": "ConnectionProperty", + "id": 33 + }, + "createSession": { + "type": "google.protobuf.BoolValue", + "id": 34 + }, + "continuous": { + "type": "google.protobuf.BoolValue", + "id": 36, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeIncrementalResults": { + "type": "bool", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScriptOptions": { + "fields": { + "statementTimeoutMs": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "statementByteBudget": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "keyResultStatement": { + "type": "KeyResultStatementKind", + "id": 4 + } + }, + "nested": { + "KeyResultStatementKind": { + "values": { + "KEY_RESULT_STATEMENT_KIND_UNSPECIFIED": 0, + "LAST": 1, + "FIRST_SELECT": 2 + } + } + } + }, + "JobConfigurationLoad": { + "oneofs": { + "_dateFormat": { + "oneof": [ + "dateFormat" + ] + }, + "_datetimeFormat": { + "oneof": [ + "datetimeFormat" + ] + }, + "_timeFormat": { + "oneof": [ + "timeFormat" + ] + }, + "_timestampFormat": { + "oneof": [ + "timestampFormat" + ] + } + }, + "fields": { + "sourceUris": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "fileSetSpecType": { + "type": "FileSetSpecType", + "id": 49, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schema": { + "type": "TableSchema", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationTable": { + "type": "TableReference", + "id": 3 + }, + "destinationTableProperties": { + "type": "DestinationTableProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createDisposition": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeDisposition": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullMarker": { + "type": "google.protobuf.StringValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipLeadingRows": { + "type": "google.protobuf.Int32Value", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encoding": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quote": { + "type": "google.protobuf.StringValue", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxBadRecords": { + "type": "google.protobuf.Int32Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowQuotedNewlines": { + "type": "google.protobuf.BoolValue", + "id": 15 + }, + "sourceFormat": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowJaggedRows": { + "type": "google.protobuf.BoolValue", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreUnknownValues": { + "type": "google.protobuf.BoolValue", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectionFields": { + "rule": "repeated", + "type": "string", + "id": 19 + }, + "autodetect": { + "type": "google.protobuf.BoolValue", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaUpdateOptions": { + "rule": "repeated", + "type": "string", + "id": 21 + }, + "timePartitioning": { + "type": "TimePartitioning", + "id": 22 + }, + "rangePartitioning": { + "type": "RangePartitioning", + "id": 26 + }, + "clustering": { + "type": "Clustering", + "id": 23 + }, + "destinationEncryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 24 + }, + "useAvroLogicalTypes": { + "type": "google.protobuf.BoolValue", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "referenceFileSchemaUri": { + "type": "google.protobuf.StringValue", + "id": 45, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hivePartitioningOptions": { + "type": "HivePartitioningOptions", + "id": 37, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "decimalTargetTypes": { + "rule": "repeated", + "type": "DecimalTargetType", + "id": 39 + }, + "jsonExtension": { + "type": "JsonExtension", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parquetOptions": { + "type": "ParquetOptions", + "id": 42, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preserveAsciiControlCharacters": { + "type": "google.protobuf.BoolValue", + "id": 44, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectionProperties": { + "rule": "repeated", + "type": "ConnectionProperty", + "id": 46, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createSession": { + "type": "google.protobuf.BoolValue", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "columnNameCharacterMap": { + "type": "ColumnNameCharacterMap", + "id": 50, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "copyFilesOnly": { + "type": "google.protobuf.BoolValue", + "id": 51, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "google.protobuf.StringValue", + "id": 52, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullMarkers": { + "rule": "repeated", + "type": "string", + "id": 53, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dateFormat": { + "type": "string", + "id": 54, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "datetimeFormat": { + "type": "string", + "id": 55, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "timeFormat": { + "type": "string", + "id": 56, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "timestampFormat": { + "type": "string", + "id": 57, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "sourceColumnMatch": { + "type": "SourceColumnMatch", + "id": 58, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timestampTargetPrecision": { + "rule": "repeated", + "type": "int32", + "id": 59 + } + }, + "nested": { + "ColumnNameCharacterMap": { + "values": { + "COLUMN_NAME_CHARACTER_MAP_UNSPECIFIED": 0, + "STRICT": 1, + "V1": 2, + "V2": 3 + } + }, + "SourceColumnMatch": { + "values": { + "SOURCE_COLUMN_MATCH_UNSPECIFIED": 0, + "POSITION": 1, + "NAME": 2 + } + } + } + }, + "JobConfigurationTableCopy": { + "fields": { + "sourceTable": { + "type": "TableReference", + "id": 1 + }, + "sourceTables": { + "rule": "repeated", + "type": "TableReference", + "id": 2 + }, + "destinationTable": { + "type": "TableReference", + "id": 3 + }, + "createDisposition": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "writeDisposition": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationEncryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 6 + }, + "operationType": { + "type": "OperationType", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationExpirationTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "COPY": 1, + "SNAPSHOT": 2, + "RESTORE": 3, + "CLONE": 4 + } + } + } + }, + "JobConfigurationExtract": { + "oneofs": { + "source": { + "oneof": [ + "sourceTable", + "sourceModel" + ] + } + }, + "fields": { + "sourceTable": { + "type": "TableReference", + "id": 1 + }, + "sourceModel": { + "type": "ModelReference", + "id": 9 + }, + "destinationUris": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "printHeader": { + "type": "google.protobuf.BoolValue", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fieldDelimiter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationFormat": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "compression": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "useAvroLogicalTypes": { + "type": "google.protobuf.BoolValue", + "id": 13 + }, + "modelExtractOptions": { + "type": "ModelExtractOptions", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ModelExtractOptions": { + "fields": { + "trialId": { + "type": "google.protobuf.Int64Value", + "id": 1 + } + } + } + } + }, + "JobConfiguration": { + "oneofs": { + "_maxSlots": { + "oneof": [ + "maxSlots" + ] + }, + "_reservation": { + "oneof": [ + "reservation" + ] + } + }, + "fields": { + "jobType": { + "type": "string", + "id": 8 + }, + "query": { + "type": "JobConfigurationQuery", + "id": 1 + }, + "load": { + "type": "JobConfigurationLoad", + "id": 2 + }, + "copy": { + "type": "JobConfigurationTableCopy", + "id": 3 + }, + "extract": { + "type": "JobConfigurationExtract", + "id": 4 + }, + "dryRun": { + "type": "google.protobuf.BoolValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobTimeoutMs": { + "type": "google.protobuf.Int64Value", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxSlots": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "reservation": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation", + "proto3_optional": true + } + } + } + }, + "ModelReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "QueryParameterStructType": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "QueryParameterType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryParameterType": { + "oneofs": { + "_timestampPrecision": { + "oneof": [ + "timestampPrecision" + ] + } + }, + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timestampPrecision": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "arrayType": { + "type": "QueryParameterType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "structTypes": { + "rule": "repeated", + "type": "QueryParameterStructType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rangeElementType": { + "type": "QueryParameterType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RangeValue": { + "fields": { + "start": { + "type": "QueryParameterValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "end": { + "type": "QueryParameterValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryParameterValue": { + "fields": { + "value": { + "type": "google.protobuf.StringValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "arrayValues": { + "rule": "repeated", + "type": "QueryParameterValue", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "structValues": { + "keyType": "string", + "type": "QueryParameterValue", + "id": 3 + }, + "rangeValue": { + "type": "RangeValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "altStructValues": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 5 + } + } + }, + "QueryParameter": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameterType": { + "type": "QueryParameterType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameterValue": { + "type": "QueryParameterValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RangePartitioning": { + "fields": { + "field": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "range": { + "type": "Range", + "id": 2 + } + }, + "nested": { + "Range": { + "fields": { + "start": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "end": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interval": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "SystemVariables": { + "fields": { + "types": { + "keyType": "string", + "type": "StandardSqlDataType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "values": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StandardSqlDataType": { + "oneofs": { + "subType": { + "oneof": [ + "arrayElementType", + "structType", + "rangeElementType" + ] + } + }, + "fields": { + "typeKind": { + "type": "TypeKind", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "arrayElementType": { + "type": "StandardSqlDataType", + "id": 2 + }, + "structType": { + "type": "StandardSqlStructType", + "id": 3 + }, + "rangeElementType": { + "type": "StandardSqlDataType", + "id": 4 + } + }, + "nested": { + "TypeKind": { + "values": { + "TYPE_KIND_UNSPECIFIED": 0, + "INT64": 2, + "BOOL": 5, + "FLOAT64": 7, + "STRING": 8, + "BYTES": 9, + "TIMESTAMP": 19, + "DATE": 10, + "TIME": 20, + "DATETIME": 21, + "INTERVAL": 26, + "GEOGRAPHY": 22, + "NUMERIC": 23, + "BIGNUMERIC": 24, + "JSON": 25, + "ARRAY": 16, + "STRUCT": 17, + "RANGE": 29 + } + } + } + }, + "StandardSqlField": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "StandardSqlDataType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StandardSqlStructType": { + "fields": { + "fields": { + "rule": "repeated", + "type": "StandardSqlField", + "id": 1 + } + } + }, + "StandardSqlTableType": { + "fields": { + "columns": { + "rule": "repeated", + "type": "StandardSqlField", + "id": 1 + } + } + }, + "TimePartitioning": { + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "expirationMs": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "field": { + "type": "google.protobuf.StringValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UserDefinedFunctionResource": { + "fields": { + "resourceUri": { + "type": "google.protobuf.StringValue", + "id": 1 + }, + "inlineCode": { + "type": "google.protobuf.StringValue", + "id": 2 + } + } + }, + "JobCreationReason": { + "fields": { + "code": { + "type": "Code", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "REQUESTED": 1, + "LONG_RUNNING": 2, + "LARGE_RESULTS": 3, + "OTHER": 4 + } + } + } + }, + "JobReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "location": { + "type": "google.protobuf.StringValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExplainQueryStep": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "substeps": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ExplainQueryStage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "startMs": { + "type": "int64", + "id": 3 + }, + "endMs": { + "type": "int64", + "id": 4 + }, + "inputStages": { + "rule": "repeated", + "type": "int64", + "id": 5 + }, + "waitRatioAvg": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "waitMsAvg": { + "type": "google.protobuf.Int64Value", + "id": 7 + }, + "waitRatioMax": { + "type": "google.protobuf.DoubleValue", + "id": 8 + }, + "waitMsMax": { + "type": "google.protobuf.Int64Value", + "id": 9 + }, + "readRatioAvg": { + "type": "google.protobuf.DoubleValue", + "id": 10 + }, + "readMsAvg": { + "type": "google.protobuf.Int64Value", + "id": 11 + }, + "readRatioMax": { + "type": "google.protobuf.DoubleValue", + "id": 12 + }, + "readMsMax": { + "type": "google.protobuf.Int64Value", + "id": 13 + }, + "computeRatioAvg": { + "type": "google.protobuf.DoubleValue", + "id": 14 + }, + "computeMsAvg": { + "type": "google.protobuf.Int64Value", + "id": 15 + }, + "computeRatioMax": { + "type": "google.protobuf.DoubleValue", + "id": 16 + }, + "computeMsMax": { + "type": "google.protobuf.Int64Value", + "id": 17 + }, + "writeRatioAvg": { + "type": "google.protobuf.DoubleValue", + "id": 18 + }, + "writeMsAvg": { + "type": "google.protobuf.Int64Value", + "id": 19 + }, + "writeRatioMax": { + "type": "google.protobuf.DoubleValue", + "id": 20 + }, + "writeMsMax": { + "type": "google.protobuf.Int64Value", + "id": 21 + }, + "shuffleOutputBytes": { + "type": "google.protobuf.Int64Value", + "id": 22 + }, + "shuffleOutputBytesSpilled": { + "type": "google.protobuf.Int64Value", + "id": 23 + }, + "recordsRead": { + "type": "google.protobuf.Int64Value", + "id": 24 + }, + "recordsWritten": { + "type": "google.protobuf.Int64Value", + "id": 25 + }, + "parallelInputs": { + "type": "google.protobuf.Int64Value", + "id": 26 + }, + "completedParallelInputs": { + "type": "google.protobuf.Int64Value", + "id": 27 + }, + "status": { + "type": "string", + "id": 28 + }, + "steps": { + "rule": "repeated", + "type": "ExplainQueryStep", + "id": 29 + }, + "slotMs": { + "type": "google.protobuf.Int64Value", + "id": 30 + }, + "computeMode": { + "type": "ComputeMode", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ComputeMode": { + "values": { + "COMPUTE_MODE_UNSPECIFIED": 0, + "BIGQUERY": 1, + "BI_ENGINE": 2 + } + } + } + }, + "QueryTimelineSample": { + "fields": { + "elapsedMs": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "totalSlotMs": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "pendingUnits": { + "type": "google.protobuf.Int64Value", + "id": 3 + }, + "completedUnits": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "activeUnits": { + "type": "google.protobuf.Int64Value", + "id": 5 + }, + "shuffleRamUsageRatio": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "estimatedRunnableUnits": { + "type": "google.protobuf.Int64Value", + "id": 7 + } + } + }, + "ExternalServiceCost": { + "fields": { + "externalService": { + "type": "string", + "id": 1 + }, + "bytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "bytesBilled": { + "type": "google.protobuf.Int64Value", + "id": 3 + }, + "slotMs": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "reservedSlotCount": { + "type": "int64", + "id": 5 + }, + "billingMethod": { + "type": "string", + "id": 6 + } + } + }, + "ExportDataStatistics": { + "fields": { + "fileCount": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "rowCount": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "BiEngineReason": { + "fields": { + "code": { + "type": "Code", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "message": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "NO_RESERVATION": 1, + "INSUFFICIENT_RESERVATION": 2, + "UNSUPPORTED_SQL_TEXT": 4, + "INPUT_TOO_LARGE": 5, + "OTHER_REASON": 6, + "TABLE_EXCLUDED": 7 + } + } + } + }, + "BiEngineStatistics": { + "fields": { + "biEngineMode": { + "type": "BiEngineMode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accelerationMode": { + "type": "BiEngineAccelerationMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "biEngineReasons": { + "rule": "repeated", + "type": "BiEngineReason", + "id": 2 + } + }, + "nested": { + "BiEngineMode": { + "values": { + "ACCELERATION_MODE_UNSPECIFIED": 0, + "DISABLED": 1, + "PARTIAL": 2, + "FULL": 3 + } + }, + "BiEngineAccelerationMode": { + "values": { + "BI_ENGINE_ACCELERATION_MODE_UNSPECIFIED": 0, + "BI_ENGINE_DISABLED": 1, + "PARTIAL_INPUT": 2, + "FULL_INPUT": 3, + "FULL_QUERY": 4 + } + } + } + }, + "IndexUnusedReason": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_message": { + "oneof": [ + "message" + ] + }, + "_baseTable": { + "oneof": [ + "baseTable" + ] + }, + "_indexName": { + "oneof": [ + "indexName" + ] + } + }, + "fields": { + "code": { + "type": "Code", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "message": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "baseTable": { + "type": "TableReference", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "indexName": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "INDEX_CONFIG_NOT_AVAILABLE": 1, + "PENDING_INDEX_CREATION": 2, + "BASE_TABLE_TRUNCATED": 3, + "INDEX_CONFIG_MODIFIED": 4, + "TIME_TRAVEL_QUERY": 5, + "NO_PRUNING_POWER": 6, + "UNINDEXED_SEARCH_FIELDS": 7, + "UNSUPPORTED_SEARCH_PATTERN": 8, + "OPTIMIZED_WITH_MATERIALIZED_VIEW": 9, + "SECURED_BY_DATA_MASKING": 11, + "MISMATCHED_TEXT_ANALYZER": 12, + "BASE_TABLE_TOO_SMALL": 13, + "BASE_TABLE_TOO_LARGE": 14, + "ESTIMATED_PERFORMANCE_GAIN_TOO_LOW": 15, + "COLUMN_METADATA_INDEX_NOT_USED": 21, + "NOT_SUPPORTED_IN_STANDARD_EDITION": 17, + "INDEX_SUPPRESSED_BY_FUNCTION_OPTION": 18, + "QUERY_CACHE_HIT": 19, + "STALE_INDEX": 20, + "INTERNAL_ERROR": 10, + "OTHER_REASON": 16 + } + } + } + }, + "IndexPruningStats": { + "oneofs": { + "_baseTable": { + "oneof": [ + "baseTable" + ] + }, + "_indexId": { + "oneof": [ + "indexId" + ] + }, + "_preIndexPruningParallelInputCount": { + "oneof": [ + "preIndexPruningParallelInputCount" + ] + }, + "_postIndexPruningParallelInputCount": { + "oneof": [ + "postIndexPruningParallelInputCount" + ] + } + }, + "fields": { + "baseTable": { + "type": "TableReference", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "indexId": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "preIndexPruningParallelInputCount": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "postIndexPruningParallelInputCount": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "StoredColumnsUsage": { + "oneofs": { + "_isQueryAccelerated": { + "oneof": [ + "isQueryAccelerated" + ] + }, + "_baseTable": { + "oneof": [ + "baseTable" + ] + } + }, + "fields": { + "isQueryAccelerated": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "baseTable": { + "type": "TableReference", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "storedColumnsUnusedReasons": { + "rule": "repeated", + "type": "StoredColumnsUnusedReason", + "id": 3 + } + }, + "nested": { + "StoredColumnsUnusedReason": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "code": { + "type": "Code", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "message": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "uncoveredColumns": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "STORED_COLUMNS_COVER_INSUFFICIENT": 1, + "BASE_TABLE_HAS_RLS": 2, + "BASE_TABLE_HAS_CLS": 3, + "UNSUPPORTED_PREFILTER": 4, + "INTERNAL_ERROR": 5, + "OTHER_REASON": 6 + } + } + } + } + } + }, + "SearchStatistics": { + "fields": { + "indexUsageMode": { + "type": "IndexUsageMode", + "id": 1 + }, + "indexUnusedReasons": { + "rule": "repeated", + "type": "IndexUnusedReason", + "id": 2 + }, + "indexPruningStats": { + "rule": "repeated", + "type": "IndexPruningStats", + "id": 3 + } + }, + "nested": { + "IndexUsageMode": { + "values": { + "INDEX_USAGE_MODE_UNSPECIFIED": 0, + "UNUSED": 1, + "PARTIALLY_USED": 2, + "FULLY_USED": 4 + } + } + } + }, + "VectorSearchStatistics": { + "fields": { + "indexUsageMode": { + "type": "IndexUsageMode", + "id": 1 + }, + "indexUnusedReasons": { + "rule": "repeated", + "type": "IndexUnusedReason", + "id": 2 + }, + "storedColumnsUsages": { + "rule": "repeated", + "type": "StoredColumnsUsage", + "id": 3 + } + }, + "nested": { + "IndexUsageMode": { + "values": { + "INDEX_USAGE_MODE_UNSPECIFIED": 0, + "UNUSED": 1, + "PARTIALLY_USED": 2, + "FULLY_USED": 4 + } + } + } + }, + "QueryInfo": { + "fields": { + "optimizationDetails": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LoadQueryStatistics": { + "fields": { + "inputFiles": { + "type": "google.protobuf.Int64Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputFileBytes": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputRows": { + "type": "google.protobuf.Int64Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputBytes": { + "type": "google.protobuf.Int64Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "badRecords": { + "type": "google.protobuf.Int64Value", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "IncrementalResultStats": { + "oneofs": { + "_incrementalRowCount": { + "oneof": [ + "incrementalRowCount" + ] + } + }, + "fields": { + "disabledReason": { + "type": "DisabledReason", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "disabledReasonDetails": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resultSetLastReplaceTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resultSetLastModifyTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "firstIncrementalRowTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastIncrementalRowTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "incrementalRowCount": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + }, + "nested": { + "DisabledReason": { + "values": { + "DISABLED_REASON_UNSPECIFIED": 0, + "OTHER": 1, + "UNSUPPORTED_OPERATOR": 2 + } + } + } + }, + "JobStatistics2": { + "oneofs": { + "_totalServicesSkuSlotMs": { + "oneof": [ + "totalServicesSkuSlotMs" + ] + } + }, + "fields": { + "queryPlan": { + "rule": "repeated", + "type": "ExplainQueryStage", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "estimatedBytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeline": { + "rule": "repeated", + "type": "QueryTimelineSample", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalPartitionsProcessed": { + "type": "google.protobuf.Int64Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalBytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalBytesProcessedAccuracy": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalBytesBilled": { + "type": "google.protobuf.Int64Value", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "billingTier": { + "type": "google.protobuf.Int32Value", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalSlotMs": { + "type": "google.protobuf.Int64Value", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalServicesSkuSlotMs": { + "type": "int64", + "id": 52, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "cacheHit": { + "type": "google.protobuf.BoolValue", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencedTables": { + "rule": "repeated", + "type": "TableReference", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencedRoutines": { + "rule": "repeated", + "type": "RoutineReference", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "referencedPropertyGraphs": { + "rule": "repeated", + "type": "PropertyGraphReference", + "id": 49, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schema": { + "type": "TableSchema", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numDmlAffectedRows": { + "type": "google.protobuf.Int64Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dmlStats": { + "type": "DmlStats", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "undeclaredQueryParameters": { + "rule": "repeated", + "type": "QueryParameter", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statementType": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlOperationPerformed": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlTargetTable": { + "type": "TableReference", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlDestinationTable": { + "type": "TableReference", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlTargetRowAccessPolicy": { + "type": "RowAccessPolicyReference", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlAffectedRowAccessPolicyCount": { + "type": "google.protobuf.Int64Value", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlTargetRoutine": { + "type": "RoutineReference", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ddlTargetDataset": { + "type": "DatasetReference", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mlStatistics": { + "type": "MlStatistics", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "exportDataStatistics": { + "type": "ExportDataStatistics", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalServiceCosts": { + "rule": "repeated", + "type": "ExternalServiceCost", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "biEngineStatistics": { + "type": "BiEngineStatistics", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "loadQueryStatistics": { + "type": "LoadQueryStatistics", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dclTargetTable": { + "type": "TableReference", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dclTargetView": { + "type": "TableReference", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dclTargetDataset": { + "type": "DatasetReference", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "searchStatistics": { + "type": "SearchStatistics", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vectorSearchStatistics": { + "type": "VectorSearchStatistics", + "id": 44, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "performanceInsights": { + "type": "PerformanceInsights", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "queryInfo": { + "type": "QueryInfo", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sparkStatistics": { + "type": "SparkStatistics", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transferredBytes": { + "type": "google.protobuf.Int64Value", + "id": 41, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "materializedViewStatistics": { + "type": "MaterializedViewStatistics", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadataCacheStatistics": { + "type": "MetadataCacheStatistics", + "id": 43, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "incrementalResultStats": { + "type": "IncrementalResultStats", + "id": 53, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "genAiStats": { + "type": "GenAiStats", + "id": 54, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "JobStatistics3": { + "fields": { + "inputFiles": { + "type": "google.protobuf.Int64Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputFileBytes": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputRows": { + "type": "google.protobuf.Int64Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputBytes": { + "type": "google.protobuf.Int64Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "badRecords": { + "type": "google.protobuf.Int64Value", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeline": { + "rule": "repeated", + "type": "QueryTimelineSample", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "JobStatistics4": { + "fields": { + "destinationUriFileCounts": { + "rule": "repeated", + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputBytes": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeline": { + "rule": "repeated", + "type": "QueryTimelineSample", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CopyJobStatistics": { + "fields": { + "copiedRows": { + "type": "google.protobuf.Int64Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "copiedLogicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MlStatistics": { + "fields": { + "maxIterations": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "iterationResults": { + "rule": "repeated", + "type": "Model.TrainingRun.IterationResult", + "id": 2 + }, + "modelType": { + "type": "Model.ModelType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainingType": { + "type": "TrainingType", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hparamTrials": { + "rule": "repeated", + "type": "Model.HparamTuningTrial", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TrainingType": { + "values": { + "TRAINING_TYPE_UNSPECIFIED": 0, + "SINGLE_TRAINING": 1, + "HPARAM_TUNING": 2 + } + } + } + }, + "ScriptStatistics": { + "fields": { + "evaluationKind": { + "type": "EvaluationKind", + "id": 1 + }, + "stackFrames": { + "rule": "repeated", + "type": "ScriptStackFrame", + "id": 2 + } + }, + "nested": { + "EvaluationKind": { + "values": { + "EVALUATION_KIND_UNSPECIFIED": 0, + "STATEMENT": 1, + "EXPRESSION": 2 + } + }, + "ScriptStackFrame": { + "fields": { + "startLine": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startColumn": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endLine": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endColumn": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "procedureId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "text": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "RowLevelSecurityStatistics": { + "fields": { + "rowLevelSecurityApplied": { + "type": "bool", + "id": 1 + } + } + }, + "DataMaskingStatistics": { + "fields": { + "dataMaskingApplied": { + "type": "bool", + "id": 1 + } + } + }, + "JobStatistics": { + "fields": { + "creationTime": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalBytesProcessed": { + "type": "google.protobuf.Int64Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completionRatio": { + "type": "google.protobuf.DoubleValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "quotaDeferments": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "query": { + "type": "JobStatistics2", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "load": { + "type": "JobStatistics3", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "extract": { + "type": "JobStatistics4", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "copy": { + "type": "CopyJobStatistics", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalSlotMs": { + "type": "google.protobuf.Int64Value", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reservationId": { + "type": "string", + "id": 15, + "options": { + "json_name": "reservation_id", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numChildJobs": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parentJobId": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scriptStatistics": { + "type": "ScriptStatistics", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rowLevelSecurityStatistics": { + "type": "RowLevelSecurityStatistics", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataMaskingStatistics": { + "type": "DataMaskingStatistics", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transactionInfo": { + "type": "TransactionInfo", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionInfo": { + "type": "SessionInfo", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "finalExecutionDurationMs": { + "type": "int64", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "edition": { + "type": "ReservationEdition", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reservationGroupPath": { + "rule": "repeated", + "type": "string", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TransactionInfo": { + "fields": { + "transactionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "DmlStats": { + "fields": { + "insertedRowCount": { + "type": "google.protobuf.Int64Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deletedRowCount": { + "type": "google.protobuf.Int64Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updatedRowCount": { + "type": "google.protobuf.Int64Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dmlMode": { + "type": "DmlMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fineGrainedDmlUnusedReason": { + "type": "FineGrainedDmlUnusedReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DmlMode": { + "values": { + "DML_MODE_UNSPECIFIED": 0, + "COARSE_GRAINED_DML": 1, + "FINE_GRAINED_DML": 2 + } + }, + "FineGrainedDmlUnusedReason": { + "values": { + "FINE_GRAINED_DML_UNUSED_REASON_UNSPECIFIED": 0, + "MAX_PARTITION_SIZE_EXCEEDED": 1, + "TABLE_NOT_ENROLLED": 2, + "DML_IN_MULTI_STATEMENT_TRANSACTION": 3 + } + } + } + }, + "PerformanceInsights": { + "fields": { + "avgPreviousExecutionMs": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stagePerformanceStandaloneInsights": { + "rule": "repeated", + "type": "StagePerformanceStandaloneInsight", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stagePerformanceChangeInsights": { + "rule": "repeated", + "type": "StagePerformanceChangeInsight", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tableChangeInsights": { + "rule": "repeated", + "type": "TableChangeInsight", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StagePerformanceChangeInsight": { + "oneofs": { + "_inputDataChange": { + "oneof": [ + "inputDataChange" + ] + } + }, + "fields": { + "stageId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputDataChange": { + "type": "InputDataChange", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "InputDataChange": { + "fields": { + "recordsReadDiffPercentage": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StagePerformanceStandaloneInsight": { + "oneofs": { + "_slotContention": { + "oneof": [ + "slotContention" + ] + }, + "_insufficientShuffleQuota": { + "oneof": [ + "insufficientShuffleQuota" + ] + }, + "_partitionSkew": { + "oneof": [ + "partitionSkew" + ] + } + }, + "fields": { + "stageId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slotContention": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "insufficientShuffleQuota": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "biEngineReasons": { + "rule": "repeated", + "type": "BiEngineReason", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "highCardinalityJoins": { + "rule": "repeated", + "type": "HighCardinalityJoin", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "partitionSkew": { + "type": "PartitionSkew", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "HighCardinalityJoin": { + "fields": { + "leftRows": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rightRows": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputRows": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stepIndex": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PartitionSkew": { + "fields": { + "skewSources": { + "rule": "repeated", + "type": "SkewSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SkewSource": { + "fields": { + "stageId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "TableChangeInsight": { + "oneofs": { + "_metadataCacheStalenessInsight": { + "oneof": [ + "metadataCacheStalenessInsight" + ] + }, + "_metadataCacheNotUsedButUsedPreviously": { + "oneof": [ + "metadataCacheNotUsedButUsedPreviously" + ] + } + }, + "fields": { + "tableReference": { + "type": "TableReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadataCacheStalenessInsight": { + "type": "MetadataCacheStalenessInsight", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "metadataCacheNotUsedButUsedPreviously": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "MetadataCacheStalenessInsight": { + "fields": { + "avgPreviousStalenessMs": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stalenessPercentageIncrease": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SparkStatistics": { + "oneofs": { + "_sparkJobId": { + "oneof": [ + "sparkJobId" + ] + }, + "_sparkJobLocation": { + "oneof": [ + "sparkJobLocation" + ] + }, + "_loggingInfo": { + "oneof": [ + "loggingInfo" + ] + }, + "_kmsKeyName": { + "oneof": [ + "kmsKeyName" + ] + }, + "_gcsStagingBucket": { + "oneof": [ + "gcsStagingBucket" + ] + } + }, + "fields": { + "sparkJobId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "sparkJobLocation": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "endpoints": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "loggingInfo": { + "type": "LoggingInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "kmsKeyName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey", + "proto3_optional": true + } + }, + "gcsStagingBucket": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "storage.googleapis.com/Bucket", + "proto3_optional": true + } + } + }, + "nested": { + "LoggingInfo": { + "fields": { + "resourceType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "projectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "MaterializedViewStatistics": { + "fields": { + "materializedView": { + "rule": "repeated", + "type": "MaterializedView", + "id": 1 + } + } + }, + "MaterializedView": { + "oneofs": { + "_tableReference": { + "oneof": [ + "tableReference" + ] + }, + "_chosen": { + "oneof": [ + "chosen" + ] + }, + "_estimatedBytesSaved": { + "oneof": [ + "estimatedBytesSaved" + ] + }, + "_rejectedReason": { + "oneof": [ + "rejectedReason" + ] + } + }, + "fields": { + "tableReference": { + "type": "TableReference", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "chosen": { + "type": "bool", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "estimatedBytesSaved": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "rejectedReason": { + "type": "RejectedReason", + "id": 4, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "RejectedReason": { + "values": { + "REJECTED_REASON_UNSPECIFIED": 0, + "NO_DATA": 1, + "COST": 2, + "BASE_TABLE_TRUNCATED": 3, + "BASE_TABLE_DATA_CHANGE": 4, + "BASE_TABLE_PARTITION_EXPIRATION_CHANGE": 5, + "BASE_TABLE_EXPIRED_PARTITION": 6, + "BASE_TABLE_INCOMPATIBLE_METADATA_CHANGE": 7, + "TIME_ZONE": 8, + "OUT_OF_TIME_TRAVEL_WINDOW": 9, + "BASE_TABLE_FINE_GRAINED_SECURITY_POLICY": 10, + "BASE_TABLE_TOO_STALE": 11 + } + } + } + }, + "PruningStats": { + "oneofs": { + "_postCmetaPruningPartitionCount": { + "oneof": [ + "postCmetaPruningPartitionCount" + ] + }, + "_preCmetaPruningParallelInputCount": { + "oneof": [ + "preCmetaPruningParallelInputCount" + ] + }, + "_postCmetaPruningParallelInputCount": { + "oneof": [ + "postCmetaPruningParallelInputCount" + ] + } + }, + "fields": { + "postCmetaPruningPartitionCount": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "preCmetaPruningParallelInputCount": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "postCmetaPruningParallelInputCount": { + "type": "int64", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "TableMetadataCacheUsage": { + "oneofs": { + "_tableReference": { + "oneof": [ + "tableReference" + ] + }, + "_unusedReason": { + "oneof": [ + "unusedReason" + ] + }, + "_explanation": { + "oneof": [ + "explanation" + ] + }, + "_pruningStats": { + "oneof": [ + "pruningStats" + ] + } + }, + "fields": { + "tableReference": { + "type": "TableReference", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "unusedReason": { + "type": "UnusedReason", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "explanation": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "staleness": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "tableType": { + "type": "string", + "id": 6 + }, + "pruningStats": { + "type": "PruningStats", + "id": 7, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "UnusedReason": { + "values": { + "UNUSED_REASON_UNSPECIFIED": 0, + "EXCEEDED_MAX_STALENESS": 1, + "METADATA_CACHING_NOT_ENABLED": 3, + "OTHER_REASON": 2 + } + } + } + }, + "MetadataCacheStatistics": { + "fields": { + "tableMetadataCacheUsage": { + "rule": "repeated", + "type": "TableMetadataCacheUsage", + "id": 1 + } + } + }, + "ReservationEdition": { + "values": { + "RESERVATION_EDITION_UNSPECIFIED": 0, + "STANDARD": 1, + "ENTERPRISE": 2, + "ENTERPRISE_PLUS": 3 + } + }, + "ModelService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}", + "(google.api.method_signature)": "project_id,dataset_id,model_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}" + } + }, + { + "(google.api.method_signature)": "project_id,dataset_id,model_id" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models", + "(google.api.method_signature)": "project_id,dataset_id,max_results" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models" + } + }, + { + "(google.api.method_signature)": "project_id,dataset_id,max_results" + } + ] + }, + "PatchModel": { + "requestType": "PatchModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}", + "(google.api.http).body": "model", + "(google.api.method_signature)": "project_id,dataset_id,model_id,model" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}", + "body": "model" + } + }, + { + "(google.api.method_signature)": "project_id,dataset_id,model_id,model" + } + ] + }, + "DeleteModel": { + "requestType": "DeleteModelRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}", + "(google.api.method_signature)": "project_id,dataset_id,model_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}" + } + }, + { + "(google.api.method_signature)": "project_id,dataset_id,model_id" + } + ] + } + } + }, + "RemoteModelInfo": { + "oneofs": { + "remoteService": { + "oneof": [ + "endpoint", + "remoteServiceType" + ] + } + }, + "fields": { + "endpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "remoteServiceType": { + "type": "RemoteServiceType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "connection": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maxBatchingRows": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "remoteModelVersion": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "speechRecognizer": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RemoteServiceType": { + "values": { + "REMOTE_SERVICE_TYPE_UNSPECIFIED": 0, + "CLOUD_AI_TRANSLATE_V3": 1, + "CLOUD_AI_VISION_V1": 2, + "CLOUD_AI_NATURAL_LANGUAGE_V1": 3, + "CLOUD_AI_SPEECH_TO_TEXT_V2": 7 + } + } + } + }, + "TransformColumn": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "StandardSqlDataType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transformSql": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Model": { + "fields": { + "etag": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelReference": { + "type": "ModelReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "creationTime": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifiedTime": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "friendlyName": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 15 + }, + "expirationTime": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 17 + }, + "modelType": { + "type": "ModelType", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainingRuns": { + "rule": "repeated", + "type": "TrainingRun", + "id": 9 + }, + "featureColumns": { + "rule": "repeated", + "type": "StandardSqlField", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labelColumns": { + "rule": "repeated", + "type": "StandardSqlField", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transformColumns": { + "rule": "repeated", + "type": "TransformColumn", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hparamSearchSpaces": { + "type": "HparamSearchSpaces", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultTrialId": { + "type": "int64", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hparamTrials": { + "rule": "repeated", + "type": "HparamTuningTrial", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "optimalTrialIds": { + "rule": "repeated", + "type": "int64", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "remoteModelInfo": { + "type": "RemoteModelInfo", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "LINEAR_REGRESSION": 1, + "LOGISTIC_REGRESSION": 2, + "KMEANS": 3, + "MATRIX_FACTORIZATION": 4, + "DNN_CLASSIFIER": 5, + "TENSORFLOW": 6, + "DNN_REGRESSOR": 7, + "XGBOOST": 8, + "BOOSTED_TREE_REGRESSOR": 9, + "BOOSTED_TREE_CLASSIFIER": 10, + "ARIMA": 11, + "AUTOML_REGRESSOR": 12, + "AUTOML_CLASSIFIER": 13, + "PCA": 14, + "DNN_LINEAR_COMBINED_CLASSIFIER": 16, + "DNN_LINEAR_COMBINED_REGRESSOR": 17, + "AUTOENCODER": 18, + "ARIMA_PLUS": 19, + "ARIMA_PLUS_XREG": 23, + "RANDOM_FOREST_REGRESSOR": 24, + "RANDOM_FOREST_CLASSIFIER": 25, + "TENSORFLOW_LITE": 26, + "ONNX": 28, + "TRANSFORM_ONLY": 29, + "CONTRIBUTION_ANALYSIS": 37 + } + }, + "LossType": { + "values": { + "LOSS_TYPE_UNSPECIFIED": 0, + "MEAN_SQUARED_LOSS": 1, + "MEAN_LOG_LOSS": 2 + } + }, + "DistanceType": { + "values": { + "DISTANCE_TYPE_UNSPECIFIED": 0, + "EUCLIDEAN": 1, + "COSINE": 2 + } + }, + "DataSplitMethod": { + "values": { + "DATA_SPLIT_METHOD_UNSPECIFIED": 0, + "RANDOM": 1, + "CUSTOM": 2, + "SEQUENTIAL": 3, + "NO_SPLIT": 4, + "AUTO_SPLIT": 5 + } + }, + "DataFrequency": { + "values": { + "DATA_FREQUENCY_UNSPECIFIED": 0, + "AUTO_FREQUENCY": 1, + "YEARLY": 2, + "QUARTERLY": 3, + "MONTHLY": 4, + "WEEKLY": 5, + "DAILY": 6, + "HOURLY": 7, + "PER_MINUTE": 8 + } + }, + "HolidayRegion": { + "values": { + "HOLIDAY_REGION_UNSPECIFIED": 0, + "GLOBAL": 1, + "NA": 2, + "JAPAC": 3, + "EMEA": 4, + "LAC": 5, + "AE": 6, + "AR": 7, + "AT": 8, + "AU": 9, + "BE": 10, + "BR": 11, + "CA": 12, + "CH": 13, + "CL": 14, + "CN": 15, + "CO": 16, + "CS": 17, + "CZ": 18, + "DE": 19, + "DK": 20, + "DZ": 21, + "EC": 22, + "EE": 23, + "EG": 24, + "ES": 25, + "FI": 26, + "FR": 27, + "GB": 28, + "GR": 29, + "HK": 30, + "HU": 31, + "ID": 32, + "IE": 33, + "IL": 34, + "IN": 35, + "IR": 36, + "IT": 37, + "JP": 38, + "KR": 39, + "LV": 40, + "MA": 41, + "MX": 42, + "MY": 43, + "NG": 44, + "NL": 45, + "NO": 46, + "NZ": 47, + "PE": 48, + "PH": 49, + "PK": 50, + "PL": 51, + "PT": 52, + "RO": 53, + "RS": 54, + "RU": 55, + "SA": 56, + "SE": 57, + "SG": 58, + "SI": 59, + "SK": 60, + "TH": 61, + "TR": 62, + "TW": 63, + "UA": 64, + "US": 65, + "VE": 66, + "VN": 67, + "ZA": 68 + } + }, + "SeasonalPeriod": { + "fields": {}, + "nested": { + "SeasonalPeriodType": { + "values": { + "SEASONAL_PERIOD_TYPE_UNSPECIFIED": 0, + "NO_SEASONALITY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "QUARTERLY": 5, + "YEARLY": 6, + "HOURLY": 7 + } + } + } + }, + "ColorSpace": { + "values": { + "COLOR_SPACE_UNSPECIFIED": 0, + "RGB": 1, + "HSV": 2, + "YIQ": 3, + "YUV": 4, + "GRAYSCALE": 5 + } + }, + "KmeansEnums": { + "fields": {}, + "nested": { + "KmeansInitializationMethod": { + "values": { + "KMEANS_INITIALIZATION_METHOD_UNSPECIFIED": 0, + "RANDOM": 1, + "CUSTOM": 2, + "KMEANS_PLUS_PLUS": 3 + } + } + } + }, + "BoostedTreeOptionEnums": { + "fields": {}, + "nested": { + "BoosterType": { + "values": { + "BOOSTER_TYPE_UNSPECIFIED": 0, + "GBTREE": 1, + "DART": 2 + } + }, + "DartNormalizeType": { + "values": { + "DART_NORMALIZE_TYPE_UNSPECIFIED": 0, + "TREE": 1, + "FOREST": 2 + } + }, + "TreeMethod": { + "values": { + "TREE_METHOD_UNSPECIFIED": 0, + "AUTO": 1, + "EXACT": 2, + "APPROX": 3, + "HIST": 4 + } + } + } + }, + "HparamTuningEnums": { + "fields": {}, + "nested": { + "HparamTuningObjective": { + "values": { + "HPARAM_TUNING_OBJECTIVE_UNSPECIFIED": 0, + "MEAN_ABSOLUTE_ERROR": 1, + "MEAN_SQUARED_ERROR": 2, + "MEAN_SQUARED_LOG_ERROR": 3, + "MEDIAN_ABSOLUTE_ERROR": 4, + "R_SQUARED": 5, + "EXPLAINED_VARIANCE": 6, + "PRECISION": 7, + "RECALL": 8, + "ACCURACY": 9, + "F1_SCORE": 10, + "LOG_LOSS": 11, + "ROC_AUC": 12, + "DAVIES_BOULDIN_INDEX": 13, + "MEAN_AVERAGE_PRECISION": 14, + "NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN": 15, + "AVERAGE_RANK": 16 + } + } + } + }, + "LearnRateStrategy": { + "values": { + "LEARN_RATE_STRATEGY_UNSPECIFIED": 0, + "LINE_SEARCH": 1, + "CONSTANT": 2 + } + }, + "OptimizationStrategy": { + "values": { + "OPTIMIZATION_STRATEGY_UNSPECIFIED": 0, + "BATCH_GRADIENT_DESCENT": 1, + "NORMAL_EQUATION": 2 + } + }, + "FeedbackType": { + "values": { + "FEEDBACK_TYPE_UNSPECIFIED": 0, + "IMPLICIT": 1, + "EXPLICIT": 2 + } + }, + "RegressionMetrics": { + "fields": { + "meanAbsoluteError": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "meanSquaredError": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "meanSquaredLogError": { + "type": "google.protobuf.DoubleValue", + "id": 3 + }, + "medianAbsoluteError": { + "type": "google.protobuf.DoubleValue", + "id": 4 + }, + "rSquared": { + "type": "google.protobuf.DoubleValue", + "id": 5 + } + } + }, + "AggregateClassificationMetrics": { + "fields": { + "precision": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "recall": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "accuracy": { + "type": "google.protobuf.DoubleValue", + "id": 3 + }, + "threshold": { + "type": "google.protobuf.DoubleValue", + "id": 4 + }, + "f1Score": { + "type": "google.protobuf.DoubleValue", + "id": 5 + }, + "logLoss": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "rocAuc": { + "type": "google.protobuf.DoubleValue", + "id": 7 + } + } + }, + "BinaryClassificationMetrics": { + "fields": { + "aggregateClassificationMetrics": { + "type": "AggregateClassificationMetrics", + "id": 1 + }, + "binaryConfusionMatrixList": { + "rule": "repeated", + "type": "BinaryConfusionMatrix", + "id": 2 + }, + "positiveLabel": { + "type": "string", + "id": 3 + }, + "negativeLabel": { + "type": "string", + "id": 4 + } + }, + "nested": { + "BinaryConfusionMatrix": { + "fields": { + "positiveClassThreshold": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "truePositives": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "falsePositives": { + "type": "google.protobuf.Int64Value", + "id": 3 + }, + "trueNegatives": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "falseNegatives": { + "type": "google.protobuf.Int64Value", + "id": 5 + }, + "precision": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "recall": { + "type": "google.protobuf.DoubleValue", + "id": 7 + }, + "f1Score": { + "type": "google.protobuf.DoubleValue", + "id": 8 + }, + "accuracy": { + "type": "google.protobuf.DoubleValue", + "id": 9 + } + } + } + } + }, + "MultiClassClassificationMetrics": { + "fields": { + "aggregateClassificationMetrics": { + "type": "AggregateClassificationMetrics", + "id": 1 + }, + "confusionMatrixList": { + "rule": "repeated", + "type": "ConfusionMatrix", + "id": 2 + } + }, + "nested": { + "ConfusionMatrix": { + "fields": { + "confidenceThreshold": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Entry": { + "fields": { + "predictedLabel": { + "type": "string", + "id": 1 + }, + "itemCount": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "Row": { + "fields": { + "actualLabel": { + "type": "string", + "id": 1 + }, + "entries": { + "rule": "repeated", + "type": "Entry", + "id": 2 + } + } + } + } + } + } + }, + "ClusteringMetrics": { + "fields": { + "daviesBouldinIndex": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "meanSquaredDistance": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 3 + } + }, + "nested": { + "Cluster": { + "fields": { + "centroidId": { + "type": "int64", + "id": 1 + }, + "featureValues": { + "rule": "repeated", + "type": "FeatureValue", + "id": 2 + }, + "count": { + "type": "google.protobuf.Int64Value", + "id": 3 + } + }, + "nested": { + "FeatureValue": { + "oneofs": { + "value": { + "oneof": [ + "numericalValue", + "categoricalValue" + ] + } + }, + "fields": { + "featureColumn": { + "type": "string", + "id": 1 + }, + "numericalValue": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "categoricalValue": { + "type": "CategoricalValue", + "id": 3 + } + }, + "nested": { + "CategoricalValue": { + "fields": { + "categoryCounts": { + "rule": "repeated", + "type": "CategoryCount", + "id": 1 + } + }, + "nested": { + "CategoryCount": { + "fields": { + "category": { + "type": "string", + "id": 1 + }, + "count": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + } + } + } + } + } + } + } + } + }, + "RankingMetrics": { + "fields": { + "meanAveragePrecision": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "meanSquaredError": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "normalizedDiscountedCumulativeGain": { + "type": "google.protobuf.DoubleValue", + "id": 3 + }, + "averageRank": { + "type": "google.protobuf.DoubleValue", + "id": 4 + } + } + }, + "ArimaForecastingMetrics": { + "fields": { + "arimaSingleModelForecastingMetrics": { + "rule": "repeated", + "type": "ArimaSingleModelForecastingMetrics", + "id": 6 + } + }, + "nested": { + "ArimaSingleModelForecastingMetrics": { + "fields": { + "nonSeasonalOrder": { + "type": "ArimaOrder", + "id": 1 + }, + "arimaFittingMetrics": { + "type": "ArimaFittingMetrics", + "id": 2 + }, + "hasDrift": { + "type": "google.protobuf.BoolValue", + "id": 3 + }, + "timeSeriesId": { + "type": "string", + "id": 4 + }, + "timeSeriesIds": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "seasonalPeriods": { + "rule": "repeated", + "type": "SeasonalPeriod.SeasonalPeriodType", + "id": 5 + }, + "hasHolidayEffect": { + "type": "google.protobuf.BoolValue", + "id": 6 + }, + "hasSpikesAndDips": { + "type": "google.protobuf.BoolValue", + "id": 7 + }, + "hasStepChanges": { + "type": "google.protobuf.BoolValue", + "id": 8 + } + } + } + } + }, + "DimensionalityReductionMetrics": { + "fields": { + "totalExplainedVarianceRatio": { + "type": "google.protobuf.DoubleValue", + "id": 1 + } + } + }, + "EvaluationMetrics": { + "oneofs": { + "metrics": { + "oneof": [ + "regressionMetrics", + "binaryClassificationMetrics", + "multiClassClassificationMetrics", + "clusteringMetrics", + "rankingMetrics", + "arimaForecastingMetrics", + "dimensionalityReductionMetrics" + ] + } + }, + "fields": { + "regressionMetrics": { + "type": "RegressionMetrics", + "id": 1 + }, + "binaryClassificationMetrics": { + "type": "BinaryClassificationMetrics", + "id": 2 + }, + "multiClassClassificationMetrics": { + "type": "MultiClassClassificationMetrics", + "id": 3 + }, + "clusteringMetrics": { + "type": "ClusteringMetrics", + "id": 4 + }, + "rankingMetrics": { + "type": "RankingMetrics", + "id": 5 + }, + "arimaForecastingMetrics": { + "type": "ArimaForecastingMetrics", + "id": 6 + }, + "dimensionalityReductionMetrics": { + "type": "DimensionalityReductionMetrics", + "id": 7 + } + } + }, + "DataSplitResult": { + "fields": { + "trainingTable": { + "type": "TableReference", + "id": 1 + }, + "evaluationTable": { + "type": "TableReference", + "id": 2 + }, + "testTable": { + "type": "TableReference", + "id": 3 + } + } + }, + "ArimaOrder": { + "fields": { + "p": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "d": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "q": { + "type": "google.protobuf.Int64Value", + "id": 3 + } + } + }, + "ArimaFittingMetrics": { + "fields": { + "logLikelihood": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "aic": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "variance": { + "type": "google.protobuf.DoubleValue", + "id": 3 + } + } + }, + "GlobalExplanation": { + "fields": { + "explanations": { + "rule": "repeated", + "type": "Explanation", + "id": 1 + }, + "classLabel": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Explanation": { + "fields": { + "featureName": { + "type": "string", + "id": 1 + }, + "attribution": { + "type": "google.protobuf.DoubleValue", + "id": 2 + } + } + } + } + }, + "CategoryEncodingMethod": { + "fields": {}, + "nested": { + "EncodingMethod": { + "values": { + "ENCODING_METHOD_UNSPECIFIED": 0, + "ONE_HOT_ENCODING": 1, + "LABEL_ENCODING": 2, + "DUMMY_ENCODING": 3 + } + } + } + }, + "PcaSolverOptionEnums": { + "fields": {}, + "nested": { + "PcaSolver": { + "values": { + "UNSPECIFIED": 0, + "FULL": 1, + "RANDOMIZED": 2, + "AUTO": 3 + } + } + } + }, + "ModelRegistryOptionEnums": { + "fields": {}, + "nested": { + "ModelRegistry": { + "values": { + "MODEL_REGISTRY_UNSPECIFIED": 0, + "VERTEX_AI": 1 + } + } + } + }, + "TrainingRun": { + "fields": { + "trainingOptions": { + "type": "TrainingOptions", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "results": { + "rule": "repeated", + "type": "IterationResult", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "evaluationMetrics": { + "type": "EvaluationMetrics", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSplitResult": { + "type": "DataSplitResult", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelLevelGlobalExplanation": { + "type": "GlobalExplanation", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "classLevelGlobalExplanations": { + "rule": "repeated", + "type": "GlobalExplanation", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vertexAiModelId": { + "type": "string", + "id": 14 + }, + "vertexAiModelVersion": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TrainingOptions": { + "oneofs": { + "_contributionMetric": { + "oneof": [ + "contributionMetric" + ] + }, + "_isTestColumn": { + "oneof": [ + "isTestColumn" + ] + }, + "_minAprioriSupport": { + "oneof": [ + "minAprioriSupport" + ] + }, + "externalModelId": { + "oneof": [ + "huggingFaceModelId", + "modelGardenModelName" + ] + }, + "_endpointIdleTtl": { + "oneof": [ + "endpointIdleTtl" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_minReplicaCount": { + "oneof": [ + "minReplicaCount" + ] + }, + "_maxReplicaCount": { + "oneof": [ + "maxReplicaCount" + ] + }, + "_reservationAffinityType": { + "oneof": [ + "reservationAffinityType" + ] + }, + "_reservationAffinityKey": { + "oneof": [ + "reservationAffinityKey" + ] + } + }, + "fields": { + "maxIterations": { + "type": "int64", + "id": 1 + }, + "lossType": { + "type": "LossType", + "id": 2 + }, + "learnRate": { + "type": "double", + "id": 3 + }, + "l1Regularization": { + "type": "google.protobuf.DoubleValue", + "id": 4 + }, + "l2Regularization": { + "type": "google.protobuf.DoubleValue", + "id": 5 + }, + "minRelativeProgress": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "warmStart": { + "type": "google.protobuf.BoolValue", + "id": 7 + }, + "earlyStop": { + "type": "google.protobuf.BoolValue", + "id": 8 + }, + "inputLabelColumns": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "dataSplitMethod": { + "type": "DataSplitMethod", + "id": 10 + }, + "dataSplitEvalFraction": { + "type": "double", + "id": 11 + }, + "dataSplitColumn": { + "type": "string", + "id": 12 + }, + "learnRateStrategy": { + "type": "LearnRateStrategy", + "id": 13 + }, + "initialLearnRate": { + "type": "double", + "id": 16 + }, + "labelClassWeights": { + "keyType": "string", + "type": "double", + "id": 17 + }, + "userColumn": { + "type": "string", + "id": 18 + }, + "itemColumn": { + "type": "string", + "id": 19 + }, + "distanceType": { + "type": "DistanceType", + "id": 20 + }, + "numClusters": { + "type": "int64", + "id": 21 + }, + "modelUri": { + "type": "string", + "id": 22 + }, + "optimizationStrategy": { + "type": "OptimizationStrategy", + "id": 23 + }, + "hiddenUnits": { + "rule": "repeated", + "type": "int64", + "id": 24 + }, + "batchSize": { + "type": "int64", + "id": 25 + }, + "dropout": { + "type": "google.protobuf.DoubleValue", + "id": 26 + }, + "maxTreeDepth": { + "type": "int64", + "id": 27 + }, + "subsample": { + "type": "double", + "id": 28 + }, + "minSplitLoss": { + "type": "google.protobuf.DoubleValue", + "id": 29 + }, + "boosterType": { + "type": "BoostedTreeOptionEnums.BoosterType", + "id": 60 + }, + "numParallelTree": { + "type": "google.protobuf.Int64Value", + "id": 61 + }, + "dartNormalizeType": { + "type": "BoostedTreeOptionEnums.DartNormalizeType", + "id": 62 + }, + "treeMethod": { + "type": "BoostedTreeOptionEnums.TreeMethod", + "id": 63 + }, + "minTreeChildWeight": { + "type": "google.protobuf.Int64Value", + "id": 64 + }, + "colsampleBytree": { + "type": "google.protobuf.DoubleValue", + "id": 65 + }, + "colsampleBylevel": { + "type": "google.protobuf.DoubleValue", + "id": 66 + }, + "colsampleBynode": { + "type": "google.protobuf.DoubleValue", + "id": 67 + }, + "numFactors": { + "type": "int64", + "id": 30 + }, + "feedbackType": { + "type": "FeedbackType", + "id": 31 + }, + "walsAlpha": { + "type": "google.protobuf.DoubleValue", + "id": 32 + }, + "kmeansInitializationMethod": { + "type": "KmeansEnums.KmeansInitializationMethod", + "id": 33 + }, + "kmeansInitializationColumn": { + "type": "string", + "id": 34 + }, + "timeSeriesTimestampColumn": { + "type": "string", + "id": 35 + }, + "timeSeriesDataColumn": { + "type": "string", + "id": 36 + }, + "autoArima": { + "type": "google.protobuf.BoolValue", + "id": 37 + }, + "nonSeasonalOrder": { + "type": "ArimaOrder", + "id": 38 + }, + "dataFrequency": { + "type": "DataFrequency", + "id": 39 + }, + "calculatePValues": { + "type": "google.protobuf.BoolValue", + "id": 40 + }, + "includeDrift": { + "type": "google.protobuf.BoolValue", + "id": 41 + }, + "holidayRegion": { + "type": "HolidayRegion", + "id": 42 + }, + "holidayRegions": { + "rule": "repeated", + "type": "HolidayRegion", + "id": 71 + }, + "timeSeriesIdColumn": { + "type": "string", + "id": 43 + }, + "timeSeriesIdColumns": { + "rule": "repeated", + "type": "string", + "id": 51 + }, + "forecastLimitLowerBound": { + "type": "double", + "id": 99 + }, + "forecastLimitUpperBound": { + "type": "double", + "id": 100 + }, + "horizon": { + "type": "int64", + "id": 44 + }, + "autoArimaMaxOrder": { + "type": "int64", + "id": 46 + }, + "autoArimaMinOrder": { + "type": "int64", + "id": 83 + }, + "numTrials": { + "type": "int64", + "id": 47 + }, + "maxParallelTrials": { + "type": "int64", + "id": 48 + }, + "hparamTuningObjectives": { + "rule": "repeated", + "type": "HparamTuningEnums.HparamTuningObjective", + "id": 54 + }, + "decomposeTimeSeries": { + "type": "google.protobuf.BoolValue", + "id": 50 + }, + "cleanSpikesAndDips": { + "type": "google.protobuf.BoolValue", + "id": 52 + }, + "adjustStepChanges": { + "type": "google.protobuf.BoolValue", + "id": 53 + }, + "enableGlobalExplain": { + "type": "google.protobuf.BoolValue", + "id": 55 + }, + "sampledShapleyNumPaths": { + "type": "int64", + "id": 56 + }, + "integratedGradientsNumSteps": { + "type": "int64", + "id": 57 + }, + "categoryEncodingMethod": { + "type": "CategoryEncodingMethod.EncodingMethod", + "id": 58 + }, + "tfVersion": { + "type": "string", + "id": 70 + }, + "colorSpace": { + "type": "ColorSpace", + "id": 72 + }, + "instanceWeightColumn": { + "type": "string", + "id": 73 + }, + "trendSmoothingWindowSize": { + "type": "int64", + "id": 74 + }, + "timeSeriesLengthFraction": { + "type": "double", + "id": 75 + }, + "minTimeSeriesLength": { + "type": "int64", + "id": 76 + }, + "maxTimeSeriesLength": { + "type": "int64", + "id": 77 + }, + "xgboostVersion": { + "type": "string", + "id": 78 + }, + "approxGlobalFeatureContrib": { + "type": "google.protobuf.BoolValue", + "id": 84 + }, + "fitIntercept": { + "type": "google.protobuf.BoolValue", + "id": 85 + }, + "numPrincipalComponents": { + "type": "int64", + "id": 86 + }, + "pcaExplainedVarianceRatio": { + "type": "double", + "id": 87 + }, + "scaleFeatures": { + "type": "google.protobuf.BoolValue", + "id": 88 + }, + "pcaSolver": { + "type": "PcaSolverOptionEnums.PcaSolver", + "id": 89 + }, + "autoClassWeights": { + "type": "google.protobuf.BoolValue", + "id": 90 + }, + "activationFn": { + "type": "string", + "id": 91 + }, + "optimizer": { + "type": "string", + "id": 92 + }, + "budgetHours": { + "type": "double", + "id": 93 + }, + "standardizeFeatures": { + "type": "google.protobuf.BoolValue", + "id": 94 + }, + "l1RegActivation": { + "type": "double", + "id": 95 + }, + "modelRegistry": { + "type": "ModelRegistryOptionEnums.ModelRegistry", + "id": 96 + }, + "vertexAiModelVersionAliases": { + "rule": "repeated", + "type": "string", + "id": 97 + }, + "dimensionIdColumns": { + "rule": "repeated", + "type": "string", + "id": 104, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contributionMetric": { + "type": "string", + "id": 105, + "options": { + "proto3_optional": true + } + }, + "isTestColumn": { + "type": "string", + "id": 106, + "options": { + "proto3_optional": true + } + }, + "minAprioriSupport": { + "type": "double", + "id": 107, + "options": { + "proto3_optional": true + } + }, + "huggingFaceModelId": { + "type": "string", + "id": 113 + }, + "modelGardenModelName": { + "type": "string", + "id": 114 + }, + "endpointIdleTtl": { + "type": "google.protobuf.Duration", + "id": 115, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 117, + "options": { + "proto3_optional": true + } + }, + "minReplicaCount": { + "type": "int64", + "id": 118, + "options": { + "proto3_optional": true + } + }, + "maxReplicaCount": { + "type": "int64", + "id": 119, + "options": { + "proto3_optional": true + } + }, + "reservationAffinityType": { + "type": "ReservationAffinityType", + "id": 120, + "options": { + "proto3_optional": true + } + }, + "reservationAffinityKey": { + "type": "string", + "id": 121, + "options": { + "proto3_optional": true + } + }, + "reservationAffinityValues": { + "rule": "repeated", + "type": "string", + "id": 122 + } + }, + "nested": { + "ReservationAffinityType": { + "values": { + "RESERVATION_AFFINITY_TYPE_UNSPECIFIED": 0, + "NO_RESERVATION": 1, + "ANY_RESERVATION": 2, + "SPECIFIC_RESERVATION": 3 + } + } + } + }, + "IterationResult": { + "fields": { + "index": { + "type": "google.protobuf.Int32Value", + "id": 1 + }, + "durationMs": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "trainingLoss": { + "type": "google.protobuf.DoubleValue", + "id": 5 + }, + "evalLoss": { + "type": "google.protobuf.DoubleValue", + "id": 6 + }, + "learnRate": { + "type": "double", + "id": 7 + }, + "clusterInfos": { + "rule": "repeated", + "type": "ClusterInfo", + "id": 8 + }, + "arimaResult": { + "type": "ArimaResult", + "id": 9 + }, + "principalComponentInfos": { + "rule": "repeated", + "type": "PrincipalComponentInfo", + "id": 10 + } + }, + "nested": { + "ClusterInfo": { + "fields": { + "centroidId": { + "type": "int64", + "id": 1 + }, + "clusterRadius": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "clusterSize": { + "type": "google.protobuf.Int64Value", + "id": 3 + } + } + }, + "ArimaResult": { + "fields": { + "arimaModelInfo": { + "rule": "repeated", + "type": "ArimaModelInfo", + "id": 1 + }, + "seasonalPeriods": { + "rule": "repeated", + "type": "SeasonalPeriod.SeasonalPeriodType", + "id": 2 + } + }, + "nested": { + "ArimaCoefficients": { + "fields": { + "autoRegressiveCoefficients": { + "rule": "repeated", + "type": "double", + "id": 1 + }, + "movingAverageCoefficients": { + "rule": "repeated", + "type": "double", + "id": 2 + }, + "interceptCoefficient": { + "type": "google.protobuf.DoubleValue", + "id": 3 + } + } + }, + "ArimaModelInfo": { + "fields": { + "nonSeasonalOrder": { + "type": "ArimaOrder", + "id": 1 + }, + "arimaCoefficients": { + "type": "ArimaCoefficients", + "id": 2 + }, + "arimaFittingMetrics": { + "type": "ArimaFittingMetrics", + "id": 3 + }, + "hasDrift": { + "type": "google.protobuf.BoolValue", + "id": 4 + }, + "timeSeriesId": { + "type": "string", + "id": 5 + }, + "timeSeriesIds": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "seasonalPeriods": { + "rule": "repeated", + "type": "SeasonalPeriod.SeasonalPeriodType", + "id": 6 + }, + "hasHolidayEffect": { + "type": "google.protobuf.BoolValue", + "id": 7 + }, + "hasSpikesAndDips": { + "type": "google.protobuf.BoolValue", + "id": 8 + }, + "hasStepChanges": { + "type": "google.protobuf.BoolValue", + "id": 9 + } + } + } + } + }, + "PrincipalComponentInfo": { + "fields": { + "principalComponentId": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "explainedVariance": { + "type": "google.protobuf.DoubleValue", + "id": 2 + }, + "explainedVarianceRatio": { + "type": "google.protobuf.DoubleValue", + "id": 3 + }, + "cumulativeExplainedVarianceRatio": { + "type": "google.protobuf.DoubleValue", + "id": 4 + } + } + } + } + } + } + }, + "DoubleHparamSearchSpace": { + "oneofs": { + "searchSpace": { + "oneof": [ + "range", + "candidates" + ] + } + }, + "fields": { + "range": { + "type": "DoubleRange", + "id": 1 + }, + "candidates": { + "type": "DoubleCandidates", + "id": 2 + } + }, + "nested": { + "DoubleRange": { + "fields": { + "min": { + "type": "google.protobuf.DoubleValue", + "id": 1 + }, + "max": { + "type": "google.protobuf.DoubleValue", + "id": 2 + } + } + }, + "DoubleCandidates": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "google.protobuf.DoubleValue", + "id": 1 + } + } + } + } + }, + "IntHparamSearchSpace": { + "oneofs": { + "searchSpace": { + "oneof": [ + "range", + "candidates" + ] + } + }, + "fields": { + "range": { + "type": "IntRange", + "id": 1 + }, + "candidates": { + "type": "IntCandidates", + "id": 2 + } + }, + "nested": { + "IntRange": { + "fields": { + "min": { + "type": "google.protobuf.Int64Value", + "id": 1 + }, + "max": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "IntCandidates": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "google.protobuf.Int64Value", + "id": 1 + } + } + } + } + }, + "StringHparamSearchSpace": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "IntArrayHparamSearchSpace": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "IntArray", + "id": 1 + } + }, + "nested": { + "IntArray": { + "fields": { + "elements": { + "rule": "repeated", + "type": "int64", + "id": 1 + } + } + } + } + }, + "HparamSearchSpaces": { + "fields": { + "learnRate": { + "type": "DoubleHparamSearchSpace", + "id": 2 + }, + "l1Reg": { + "type": "DoubleHparamSearchSpace", + "id": 3 + }, + "l2Reg": { + "type": "DoubleHparamSearchSpace", + "id": 4 + }, + "numClusters": { + "type": "IntHparamSearchSpace", + "id": 26 + }, + "numFactors": { + "type": "IntHparamSearchSpace", + "id": 31 + }, + "hiddenUnits": { + "type": "IntArrayHparamSearchSpace", + "id": 34 + }, + "batchSize": { + "type": "IntHparamSearchSpace", + "id": 37 + }, + "dropout": { + "type": "DoubleHparamSearchSpace", + "id": 38 + }, + "maxTreeDepth": { + "type": "IntHparamSearchSpace", + "id": 41 + }, + "subsample": { + "type": "DoubleHparamSearchSpace", + "id": 42 + }, + "minSplitLoss": { + "type": "DoubleHparamSearchSpace", + "id": 43 + }, + "walsAlpha": { + "type": "DoubleHparamSearchSpace", + "id": 49 + }, + "boosterType": { + "type": "StringHparamSearchSpace", + "id": 56 + }, + "numParallelTree": { + "type": "IntHparamSearchSpace", + "id": 57 + }, + "dartNormalizeType": { + "type": "StringHparamSearchSpace", + "id": 58 + }, + "treeMethod": { + "type": "StringHparamSearchSpace", + "id": 59 + }, + "minTreeChildWeight": { + "type": "IntHparamSearchSpace", + "id": 60 + }, + "colsampleBytree": { + "type": "DoubleHparamSearchSpace", + "id": 61 + }, + "colsampleBylevel": { + "type": "DoubleHparamSearchSpace", + "id": 62 + }, + "colsampleBynode": { + "type": "DoubleHparamSearchSpace", + "id": 63 + }, + "activationFn": { + "type": "StringHparamSearchSpace", + "id": 67 + }, + "optimizer": { + "type": "StringHparamSearchSpace", + "id": 68 + } + } + }, + "HparamTuningTrial": { + "fields": { + "trialId": { + "type": "int64", + "id": 1 + }, + "startTimeMs": { + "type": "int64", + "id": 2 + }, + "endTimeMs": { + "type": "int64", + "id": 3 + }, + "hparams": { + "type": "TrainingRun.TrainingOptions", + "id": 4 + }, + "evaluationMetrics": { + "type": "EvaluationMetrics", + "id": 5 + }, + "status": { + "type": "TrialStatus", + "id": 6 + }, + "errorMessage": { + "type": "string", + "id": 7 + }, + "trainingLoss": { + "type": "google.protobuf.DoubleValue", + "id": 8 + }, + "evalLoss": { + "type": "google.protobuf.DoubleValue", + "id": 9 + }, + "hparamTuningEvaluationMetrics": { + "type": "EvaluationMetrics", + "id": 10 + } + }, + "nested": { + "TrialStatus": { + "values": { + "TRIAL_STATUS_UNSPECIFIED": 0, + "NOT_STARTED": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "INFEASIBLE": 5, + "STOPPED_EARLY": 6 + } + } + } + } + } + }, + "GetModelRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchModelRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "model": { + "type": "Model", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteModelRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListModelsResponse": { + "fields": { + "models": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PropertyGraphReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "propertyGraphId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RowAccessPolicyReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SessionInfo": { + "fields": { + "sessionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "JobStatus": { + "fields": { + "errorResult": { + "type": "ErrorProto", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errors": { + "rule": "repeated", + "type": "ErrorProto", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LocationMetadata": { + "fields": { + "legacyLocationId": { + "type": "string", + "id": 1 + } + } + }, + "ManagedTableType": { + "values": { + "MANAGED_TABLE_TYPE_UNSPECIFIED": 0, + "NATIVE": 1, + "BIGLAKE": 2 + } + }, + "PartitioningDefinition": { + "fields": { + "partitionedColumn": { + "rule": "repeated", + "type": "PartitionedColumn", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PartitionedColumn": { + "oneofs": { + "_field": { + "oneof": [ + "field" + ] + } + }, + "fields": { + "field": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "AggregationThresholdPolicy": { + "oneofs": { + "_threshold": { + "oneof": [ + "threshold" + ] + } + }, + "fields": { + "threshold": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "privacyUnitColumns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DifferentialPrivacyPolicy": { + "oneofs": { + "_maxEpsilonPerQuery": { + "oneof": [ + "maxEpsilonPerQuery" + ] + }, + "_deltaPerQuery": { + "oneof": [ + "deltaPerQuery" + ] + }, + "_maxGroupsContributed": { + "oneof": [ + "maxGroupsContributed" + ] + }, + "_privacyUnitColumn": { + "oneof": [ + "privacyUnitColumn" + ] + }, + "_epsilonBudget": { + "oneof": [ + "epsilonBudget" + ] + }, + "_deltaBudget": { + "oneof": [ + "deltaBudget" + ] + }, + "_epsilonBudgetRemaining": { + "oneof": [ + "epsilonBudgetRemaining" + ] + }, + "_deltaBudgetRemaining": { + "oneof": [ + "deltaBudgetRemaining" + ] + } + }, + "fields": { + "maxEpsilonPerQuery": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deltaPerQuery": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxGroupsContributed": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "privacyUnitColumn": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "epsilonBudget": { + "type": "double", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deltaBudget": { + "type": "double", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "epsilonBudgetRemaining": { + "type": "double", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "deltaBudgetRemaining": { + "type": "double", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "JoinRestrictionPolicy": { + "oneofs": { + "_joinCondition": { + "oneof": [ + "joinCondition" + ] + } + }, + "fields": { + "joinCondition": { + "type": "JoinCondition", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "joinAllowedColumns": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "JoinCondition": { + "values": { + "JOIN_CONDITION_UNSPECIFIED": 0, + "JOIN_ANY": 1, + "JOIN_ALL": 2, + "JOIN_NOT_REQUIRED": 3, + "JOIN_BLOCKED": 4 + } + } + } + }, + "PrivacyPolicy": { + "oneofs": { + "privacyPolicy": { + "oneof": [ + "aggregationThresholdPolicy", + "differentialPrivacyPolicy" + ] + }, + "_joinRestrictionPolicy": { + "oneof": [ + "joinRestrictionPolicy" + ] + } + }, + "fields": { + "aggregationThresholdPolicy": { + "type": "AggregationThresholdPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "differentialPrivacyPolicy": { + "type": "DifferentialPrivacyPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "joinRestrictionPolicy": { + "type": "JoinRestrictionPolicy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ProjectService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetServiceAccount": { + "requestType": "GetServiceAccountRequest", + "responseType": "GetServiceAccountResponse", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/serviceAccount" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/serviceAccount" + } + } + ] + } + } + }, + "GetServiceAccountRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetServiceAccountResponse": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "email": { + "type": "string", + "id": 2 + } + } + }, + "RoutineService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetRoutine": { + "requestType": "GetRoutineRequest", + "responseType": "Routine", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + } + } + ] + }, + "InsertRoutine": { + "requestType": "InsertRoutineRequest", + "responseType": "Routine", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines", + "(google.api.http).body": "routine" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines", + "body": "routine" + } + } + ] + }, + "UpdateRoutine": { + "requestType": "UpdateRoutineRequest", + "responseType": "Routine", + "options": { + "(google.api.http).put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}", + "(google.api.http).body": "routine" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}", + "body": "routine" + } + } + ] + }, + "DeleteRoutine": { + "requestType": "DeleteRoutineRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines/{routine_id=*}" + } + } + ] + }, + "ListRoutines": { + "requestType": "ListRoutinesRequest", + "responseType": "ListRoutinesResponse", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/routines" + } + } + ] + } + } + }, + "Routine": { + "fields": { + "etag": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "routineReference": { + "type": "RoutineReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routineType": { + "type": "RoutineType", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "creationTime": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifiedTime": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "language": { + "type": "Language", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "arguments": { + "rule": "repeated", + "type": "Argument", + "id": 7 + }, + "returnType": { + "type": "StandardSqlDataType", + "id": 10 + }, + "returnTableType": { + "type": "StandardSqlTableType", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "importedLibraries": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "definitionBody": { + "type": "string", + "id": 9 + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "determinismLevel": { + "type": "DeterminismLevel", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "securityMode": { + "type": "SecurityMode", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "strictMode": { + "type": "google.protobuf.BoolValue", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "remoteFunctionOptions": { + "type": "RemoteFunctionOptions", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkOptions": { + "type": "SparkOptions", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataGovernanceType": { + "type": "DataGovernanceType", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonOptions": { + "type": "PythonOptions", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "externalRuntimeOptions": { + "type": "ExternalRuntimeOptions", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "buildStatus": { + "type": "RoutineBuildStatus", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RoutineType": { + "values": { + "ROUTINE_TYPE_UNSPECIFIED": 0, + "SCALAR_FUNCTION": 1, + "PROCEDURE": 2, + "TABLE_VALUED_FUNCTION": 3, + "AGGREGATE_FUNCTION": 4 + } + }, + "Language": { + "values": { + "LANGUAGE_UNSPECIFIED": 0, + "SQL": 1, + "JAVASCRIPT": 2, + "PYTHON": 3, + "JAVA": 4, + "SCALA": 5 + } + }, + "Argument": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "argumentKind": { + "type": "ArgumentKind", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mode": { + "type": "Mode", + "id": 3 + }, + "dataType": { + "type": "StandardSqlDataType", + "id": 4 + }, + "isAggregate": { + "type": "google.protobuf.BoolValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ArgumentKind": { + "values": { + "ARGUMENT_KIND_UNSPECIFIED": 0, + "FIXED_TYPE": 1, + "ANY_TYPE": 2 + } + }, + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "IN": 1, + "OUT": 2, + "INOUT": 3 + } + } + } + }, + "DeterminismLevel": { + "values": { + "DETERMINISM_LEVEL_UNSPECIFIED": 0, + "DETERMINISTIC": 1, + "NOT_DETERMINISTIC": 2 + } + }, + "SecurityMode": { + "values": { + "SECURITY_MODE_UNSPECIFIED": 0, + "DEFINER": 1, + "INVOKER": 2 + } + }, + "RemoteFunctionOptions": { + "fields": { + "endpoint": { + "type": "string", + "id": 1 + }, + "connection": { + "type": "string", + "id": 2 + }, + "userDefinedContext": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "maxBatchingRows": { + "type": "int64", + "id": 4 + } + } + }, + "DataGovernanceType": { + "values": { + "DATA_GOVERNANCE_TYPE_UNSPECIFIED": 0, + "DATA_MASKING": 1 + } + } + } + }, + "PythonOptions": { + "fields": { + "entryPoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "packages": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExternalRuntimeOptions": { + "fields": { + "containerMemory": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containerCpu": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeConnection": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxBatchingRows": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeVersion": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containerRequestConcurrency": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkOptions": { + "fields": { + "connection": { + "type": "string", + "id": 1 + }, + "runtimeVersion": { + "type": "string", + "id": 2 + }, + "containerImage": { + "type": "string", + "id": 3 + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "mainFileUri": { + "type": "string", + "id": 5 + }, + "pyFileUris": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "jarUris": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "mainClass": { + "type": "string", + "id": 10 + } + } + }, + "RoutineBuildStatus": { + "fields": { + "buildState": { + "type": "BuildState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorResult": { + "type": "ErrorProto", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buildStateUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buildDuration": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "imageSizeBytes": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "BuildState": { + "values": { + "BUILD_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + } + } + }, + "GetRoutineRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routineId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRoutineRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routine": { + "type": "Routine", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRoutineRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routineId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routine": { + "type": "Routine", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRoutineRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routineId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRoutinesRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 6 + } + } + }, + "ListRoutinesResponse": { + "fields": { + "routines": { + "rule": "repeated", + "type": "Routine", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RowAccessPolicyService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "ListRowAccessPolicies": { + "requestType": "ListRowAccessPoliciesRequest", + "responseType": "ListRowAccessPoliciesResponse", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies" + } + } + ] + }, + "GetRowAccessPolicy": { + "requestType": "GetRowAccessPolicyRequest", + "responseType": "RowAccessPolicy", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + } + } + ] + }, + "CreateRowAccessPolicy": { + "requestType": "CreateRowAccessPolicyRequest", + "responseType": "RowAccessPolicy", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies", + "(google.api.http).body": "row_access_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies", + "body": "row_access_policy" + } + } + ] + }, + "UpdateRowAccessPolicy": { + "requestType": "UpdateRowAccessPolicyRequest", + "responseType": "RowAccessPolicy", + "options": { + "(google.api.http).put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}", + "(google.api.http).body": "row_access_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}", + "body": "row_access_policy" + } + } + ] + }, + "DeleteRowAccessPolicy": { + "requestType": "DeleteRowAccessPolicyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies/{policy_id=*}" + } + } + ] + }, + "BatchDeleteRowAccessPolicies": { + "requestType": "BatchDeleteRowAccessPoliciesRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies:batchDelete", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}/rowAccessPolicies:batchDelete", + "body": "*" + } + } + ] + } + } + }, + "ListRowAccessPoliciesRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + } + } + }, + "ListRowAccessPoliciesResponse": { + "fields": { + "rowAccessPolicies": { + "rule": "repeated", + "type": "RowAccessPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetRowAccessPolicyRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateRowAccessPolicyRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rowAccessPolicy": { + "type": "RowAccessPolicy", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRowAccessPolicyRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rowAccessPolicy": { + "type": "RowAccessPolicy", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRowAccessPolicyRequest": { + "oneofs": { + "_force": { + "oneof": [ + "force" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "BatchDeleteRowAccessPoliciesRequest": { + "oneofs": { + "_force": { + "oneof": [ + "force" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyIds": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "RowAccessPolicy": { + "fields": { + "etag": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rowAccessPolicyReference": { + "type": "RowAccessPolicyReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filterPredicate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifiedTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "grantees": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TableService": { + "options": { + "(google.api.default_host)": "bigquery.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + }, + "methods": { + "GetTable": { + "requestType": "GetTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + } + } + ] + }, + "InsertTable": { + "requestType": "InsertTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables", + "(google.api.http).body": "table" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables", + "body": "table" + } + } + ] + }, + "PatchTable": { + "requestType": "UpdateOrPatchTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}", + "(google.api.http).body": "table" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}", + "body": "table" + } + } + ] + }, + "UpdateTable": { + "requestType": "UpdateOrPatchTableRequest", + "responseType": "Table", + "options": { + "(google.api.http).put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}", + "(google.api.http).body": "table" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}", + "body": "table" + } + } + ] + }, + "DeleteTable": { + "requestType": "DeleteTableRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables/{table_id=*}" + } + } + ] + }, + "ListTables": { + "requestType": "ListTablesRequest", + "responseType": "TableList", + "options": { + "(google.api.http).get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/tables" + } + } + ] + } + } + }, + "TableReplicationInfo": { + "fields": { + "sourceTable": { + "type": "TableReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "replicationIntervalMs": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "replicatedSourceLastRefreshTime": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "replicationStatus": { + "type": "ReplicationStatus", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "replicationError": { + "type": "ErrorProto", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ReplicationStatus": { + "values": { + "REPLICATION_STATUS_UNSPECIFIED": 0, + "ACTIVE": 1, + "SOURCE_DELETED": 2, + "PERMISSION_DENIED": 3, + "UNSUPPORTED_CONFIGURATION": 4 + } + } + } + }, + "ViewDefinition": { + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userDefinedFunctionResources": { + "rule": "repeated", + "type": "UserDefinedFunctionResource", + "id": 2 + }, + "useLegacySql": { + "type": "google.protobuf.BoolValue", + "id": 3 + }, + "useExplicitColumnNames": { + "type": "bool", + "id": 4 + }, + "privacyPolicy": { + "type": "PrivacyPolicy", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "foreignDefinitions": { + "rule": "repeated", + "type": "ForeignViewDefinition", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ForeignViewDefinition": { + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dialect": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MaterializedViewDefinition": { + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lastRefreshTime": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableRefresh": { + "type": "google.protobuf.BoolValue", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "refreshIntervalMs": { + "type": "google.protobuf.UInt64Value", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowNonIncrementalDefinition": { + "type": "google.protobuf.BoolValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MaterializedViewStatus": { + "fields": { + "refreshWatermark": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastRefreshStatus": { + "type": "ErrorProto", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SnapshotDefinition": { + "fields": { + "baseTableReference": { + "type": "TableReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "snapshotTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CloneDefinition": { + "fields": { + "baseTableReference": { + "type": "TableReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cloneTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Streamingbuffer": { + "fields": { + "estimatedBytes": { + "type": "uint64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "estimatedRows": { + "type": "uint64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "oldestEntryTime": { + "type": "fixed64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Table": { + "oneofs": { + "_partitionDefinition": { + "oneof": [ + "partitionDefinition" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selfLink": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tableReference": { + "type": "TableReference", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "google.protobuf.StringValue", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "schema": { + "type": "TableSchema", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timePartitioning": { + "type": "TimePartitioning", + "id": 10 + }, + "rangePartitioning": { + "type": "RangePartitioning", + "id": 27 + }, + "clustering": { + "type": "Clustering", + "id": 23 + }, + "requirePartitionFilter": { + "type": "google.protobuf.BoolValue", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "partitionDefinition": { + "type": "PartitioningDefinition", + "id": 51, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "numBytes": { + "type": "google.protobuf.Int64Value", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numPhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numLongTermBytes": { + "type": "google.protobuf.Int64Value", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numRows": { + "type": "google.protobuf.UInt64Value", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creationTime": { + "type": "int64", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expirationTime": { + "type": "google.protobuf.Int64Value", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lastModifiedTime": { + "type": "fixed64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "view": { + "type": "ViewDefinition", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "materializedView": { + "type": "MaterializedViewDefinition", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "materializedViewStatus": { + "type": "MaterializedViewStatus", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalDataConfiguration": { + "type": "ExternalDataConfiguration", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "biglakeConfiguration": { + "type": "BigLakeConfiguration", + "id": 45, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "managedTableType": { + "type": "ManagedTableType", + "id": 55, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "location": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "streamingBuffer": { + "type": "Streamingbuffer", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionConfiguration": { + "type": "EncryptionConfiguration", + "id": 22 + }, + "snapshotDefinition": { + "type": "SnapshotDefinition", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultCollation": { + "type": "google.protobuf.StringValue", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultRoundingMode": { + "type": "TableFieldSchema.RoundingMode", + "id": 44, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloneDefinition": { + "type": "CloneDefinition", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numTimeTravelPhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numTotalLogicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numActiveLogicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numLongTermLogicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numCurrentPhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 53, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numTotalPhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numActivePhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numLongTermPhysicalBytes": { + "type": "google.protobuf.Int64Value", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "numPartitions": { + "type": "google.protobuf.Int64Value", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maxStaleness": { + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "restrictions": { + "type": "RestrictionConfig", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tableConstraints": { + "type": "TableConstraints", + "id": 47, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resourceTags": { + "keyType": "string", + "type": "string", + "id": 48, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tableReplicationInfo": { + "type": "TableReplicationInfo", + "id": 49, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "replicas": { + "rule": "repeated", + "type": "TableReference", + "id": 50, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalCatalogTableOptions": { + "type": "ExternalCatalogTableOptions", + "id": 54, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetTableRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selectedFields": { + "type": "string", + "id": 4 + }, + "view": { + "type": "TableMetadataView", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TableMetadataView": { + "values": { + "TABLE_METADATA_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "STORAGE_STATS": 2, + "FULL": 3 + } + } + } + }, + "InsertTableRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "Table", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateOrPatchTableRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "Table", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autodetectSchema": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTableRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTablesRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "google.protobuf.UInt32Value", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListFormatView": { + "fields": { + "useLegacySql": { + "type": "google.protobuf.BoolValue", + "id": 1 + }, + "privacyPolicy": { + "type": "PrivacyPolicy", + "id": 2 + } + } + }, + "ListFormatTable": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "tableReference": { + "type": "TableReference", + "id": 3 + }, + "friendlyName": { + "type": "google.protobuf.StringValue", + "id": 4 + }, + "type": { + "type": "string", + "id": 5 + }, + "timePartitioning": { + "type": "TimePartitioning", + "id": 6 + }, + "rangePartitioning": { + "type": "RangePartitioning", + "id": 12 + }, + "clustering": { + "type": "Clustering", + "id": 11 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "view": { + "type": "ListFormatView", + "id": 8 + }, + "creationTime": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expirationTime": { + "type": "int64", + "id": 10 + }, + "requirePartitionFilter": { + "type": "google.protobuf.BoolValue", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TableList": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "etag": { + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "tables": { + "rule": "repeated", + "type": "ListFormatTable", + "id": 4 + }, + "totalItems": { + "type": "google.protobuf.Int32Value", + "id": 5 + } + } + }, + "PrimaryKey": { + "fields": { + "columns": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ColumnReference": { + "fields": { + "referencingColumn": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "referencedColumn": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ForeignKey": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "referencedTable": { + "type": "TableReference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "columnReferences": { + "rule": "repeated", + "type": "ColumnReference", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TableConstraints": { + "fields": { + "primaryKey": { + "type": "PrimaryKey", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "foreignKeys": { + "rule": "repeated", + "type": "ForeignKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.delete_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.delete_dataset.js new file mode 100644 index 000000000000..205cd47cfa2d --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.delete_dataset.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_DatasetService_DeleteDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the dataset being deleted + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of dataset being deleted + */ + // const datasetId = 'abc123' + /** + * If True, delete all the tables in the dataset. + * If False and the dataset contains tables, the request will fail. + * Default is False + */ + // const deleteContents = true + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const response = await bigqueryClient.deleteDataset(request); + console.log(response); + } + + callDeleteDataset(); + // [END bigquery_v2_generated_DatasetService_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.get_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.get_dataset.js new file mode 100644 index 000000000000..fd8ecddd7736 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.get_dataset.js @@ -0,0 +1,97 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_DatasetService_GetDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the requested dataset + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the requested dataset + */ + // const datasetId = 'abc123' + /** + * Optional. Specifies the view that determines which dataset information is + * returned. By default, metadata and ACL information are returned. + */ + // const datasetView = {} + /** + * 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. + */ + // const accessPolicyVersion = 1234 + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callGetDataset() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const response = await bigqueryClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END bigquery_v2_generated_DatasetService_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.insert_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.insert_dataset.js new file mode 100644 index 000000000000..212246c59be1 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.insert_dataset.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, dataset) { + // [START bigquery_v2_generated_DatasetService_InsertDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the new dataset + */ + // const projectId = 'abc123' + /** + * Required. Datasets resource to use for the new dataset + */ + // const dataset = {} + /** + * 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. + */ + // const accessPolicyVersion = 1234 + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callInsertDataset() { + // Construct request + const request = { + projectId, + dataset, + }; + + // Run request + const response = await bigqueryClient.insertDataset(request); + console.log(response); + } + + callInsertDataset(); + // [END bigquery_v2_generated_DatasetService_InsertDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.list_datasets.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.list_datasets.js new file mode 100644 index 000000000000..ce248bef94d1 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.list_datasets.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START bigquery_v2_generated_DatasetService_ListDatasets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the datasets to be listed + */ + // const projectId = 'abc123' + /** + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + */ + // const maxResults = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results + */ + // const pageToken = 'abc123' + /** + * Whether to list all datasets, including hidden ones + */ + // const all = true + /** + * 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. + */ + // const filter = 'abc123' + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callListDatasets() { + // Construct request + const request = { + projectId, + }; + + // Run request + const iterable = bigqueryClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END bigquery_v2_generated_DatasetService_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.patch_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.patch_dataset.js new file mode 100644 index 000000000000..ce2558ada459 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.patch_dataset.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, dataset) { + // [START bigquery_v2_generated_DatasetService_PatchDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the dataset being updated + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the dataset being updated + */ + // const datasetId = 'abc123' + /** + * Required. Datasets resource which will replace or patch the specified + * dataset. + */ + // const dataset = {} + /** + * Optional. Specifies the fields of dataset that update/patch operation is + * targeting By default, both metadata and ACL fields are updated. + */ + // const updateMode = {} + /** + * 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. + */ + // const accessPolicyVersion = 1234 + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callPatchDataset() { + // Construct request + const request = { + projectId, + datasetId, + dataset, + }; + + // Run request + const response = await bigqueryClient.patchDataset(request); + console.log(response); + } + + callPatchDataset(); + // [END bigquery_v2_generated_DatasetService_PatchDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.undelete_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.undelete_dataset.js new file mode 100644 index 000000000000..1e4ba0e87005 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.undelete_dataset.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_DatasetService_UndeleteDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the dataset to be undeleted + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of dataset being deleted + */ + // const datasetId = 'abc123' + /** + * Optional. 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. + */ + // const deletionTime = {} + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callUndeleteDataset() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const response = await bigqueryClient.undeleteDataset(request); + console.log(response); + } + + callUndeleteDataset(); + // [END bigquery_v2_generated_DatasetService_UndeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.update_dataset.js b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.update_dataset.js new file mode 100644 index 000000000000..6b83c43aa64f --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/dataset_service.update_dataset.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, dataset) { + // [START bigquery_v2_generated_DatasetService_UpdateDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the dataset being updated + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the dataset being updated + */ + // const datasetId = 'abc123' + /** + * Required. Datasets resource which will replace or patch the specified + * dataset. + */ + // const dataset = {} + /** + * Optional. Specifies the fields of dataset that update/patch operation is + * targeting By default, both metadata and ACL fields are updated. + */ + // const updateMode = {} + /** + * 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. + */ + // const accessPolicyVersion = 1234 + + // Imports the Bigquery library + const {DatasetServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new DatasetServiceClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + projectId, + datasetId, + dataset, + }; + + // Run request + const response = await bigqueryClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END bigquery_v2_generated_DatasetService_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.cancel_job.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.cancel_job.js new file mode 100644 index 000000000000..22a9ec65f1c6 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.cancel_job.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, jobId) { + // [START bigquery_v2_generated_JobService_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the job to cancel + */ + // const projectId = 'abc123' + /** + * Required. Job ID of the job to cancel + */ + // const jobId = 'abc123' + /** + * 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`) + */ + // const location = 'abc123' + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callCancelJob() { + // Construct request + const request = { + projectId, + jobId, + }; + + // Run request + const response = await bigqueryClient.cancelJob(request); + console.log(response); + } + + callCancelJob(); + // [END bigquery_v2_generated_JobService_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.delete_job.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.delete_job.js new file mode 100644 index 000000000000..c48c338d9ad9 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.delete_job.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, jobId) { + // [START bigquery_v2_generated_JobService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the job for which metadata is to be deleted. + */ + // const projectId = 'abc123' + /** + * 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. + */ + // const jobId = 'abc123' + /** + * The geographic location of the job. Required. + * For more information, see how to + * specify + * locations (https://cloud.google.com/bigquery/docs/locations#specify_locations). + */ + // const location = 'abc123' + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + projectId, + jobId, + }; + + // Run request + const response = await bigqueryClient.deleteJob(request); + console.log(response); + } + + callDeleteJob(); + // [END bigquery_v2_generated_JobService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_job.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_job.js new file mode 100644 index 000000000000..5d5d79e73eee --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_job.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, jobId) { + // [START bigquery_v2_generated_JobService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the requested job. + */ + // const projectId = 'abc123' + /** + * Required. Job ID of the requested job. + */ + // const jobId = 'abc123' + /** + * 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). + */ + // const location = 'abc123' + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + projectId, + jobId, + }; + + // Run request + const response = await bigqueryClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END bigquery_v2_generated_JobService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_query_results.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_query_results.js new file mode 100644 index 000000000000..7aec89f07038 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.get_query_results.js @@ -0,0 +1,110 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, jobId) { + // [START bigquery_v2_generated_JobService_GetQueryResults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the query job. + */ + // const projectId = 'abc123' + /** + * Required. Job ID of the query job. + */ + // const jobId = 'abc123' + /** + * Zero-based index of the starting row. + */ + // const startIndex = {} + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + /** + * Maximum number of results to read. + */ + // const maxResults = {} + /** + * 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. + */ + // const timeoutMs = {} + /** + * 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). + */ + // const location = 'abc123' + /** + * Optional. Output format adjustments. + */ + // const formatOptions = {} + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callGetQueryResults() { + // Construct request + const request = { + projectId, + jobId, + }; + + // Run request + const response = await bigqueryClient.getQueryResults(request); + console.log(response); + } + + callGetQueryResults(); + // [END bigquery_v2_generated_JobService_GetQueryResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.insert_job.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.insert_job.js new file mode 100644 index 000000000000..9bc6779c6e07 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.insert_job.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START bigquery_v2_generated_JobService_InsertJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Project ID of project that will be billed for the job. + */ + // const projectId = 'abc123' + /** + * Jobs resource to insert. + */ + // const job = {} + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callInsertJob() { + // Construct request + const request = { + }; + + // Run request + const response = await bigqueryClient.insertJob(request); + console.log(response); + } + + callInsertJob(); + // [END bigquery_v2_generated_JobService_InsertJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.list_jobs.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.list_jobs.js new file mode 100644 index 000000000000..6391256860c4 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.list_jobs.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START bigquery_v2_generated_JobService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Project ID of the jobs to list. + */ + // const projectId = 'abc123' + /** + * Whether to display jobs owned by all users in the project. Default False. + */ + // const allUsers = true + /** + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + */ + // const maxResults = 1234 + /** + * Min value for job creation time, in milliseconds since the POSIX epoch. + * If set, only jobs created after or at this timestamp are returned. + */ + // const minCreationTime = 1234 + /** + * Max value for job creation time, in milliseconds since the POSIX epoch. + * If set, only jobs created before or at this timestamp are returned. + */ + // const maxCreationTime = {} + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + /** + * Restrict information returned to a set of selected fields + */ + // const projection = {} + /** + * Filter for job state + */ + // const stateFilter = [1,2,3,4] + /** + * If set, show only child jobs of the specified parent. Otherwise, show all + * top-level jobs. + */ + // const parentJobId = 'abc123' + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = bigqueryClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END bigquery_v2_generated_JobService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.query.js b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.query.js new file mode 100644 index 000000000000..84f21b38a99b --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/job_service.query.js @@ -0,0 +1,65 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START bigquery_v2_generated_JobService_Query_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the query request. + */ + // const projectId = 'abc123' + /** + * The query request body. + */ + // const queryRequest = {} + + // Imports the Bigquery library + const {JobServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new JobServiceClient(); + + async function callQuery() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await bigqueryClient.query(request); + console.log(response); + } + + callQuery(); + // [END bigquery_v2_generated_JobService_Query_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.delete_model.js b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.delete_model.js new file mode 100644 index 000000000000..7d9b0de82617 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.delete_model.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, modelId) { + // [START bigquery_v2_generated_ModelService_DeleteModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the model to delete. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the model to delete. + */ + // const datasetId = 'abc123' + /** + * Required. Model ID of the model to delete. + */ + // const modelId = 'abc123' + + // Imports the Bigquery library + const {ModelServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new ModelServiceClient(); + + async function callDeleteModel() { + // Construct request + const request = { + projectId, + datasetId, + modelId, + }; + + // Run request + const response = await bigqueryClient.deleteModel(request); + console.log(response); + } + + callDeleteModel(); + // [END bigquery_v2_generated_ModelService_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.get_model.js b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.get_model.js new file mode 100644 index 000000000000..06ca5c12bfe9 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.get_model.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, modelId) { + // [START bigquery_v2_generated_ModelService_GetModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the requested model. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the requested model. + */ + // const datasetId = 'abc123' + /** + * Required. Model ID of the requested model. + */ + // const modelId = 'abc123' + + // Imports the Bigquery library + const {ModelServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new ModelServiceClient(); + + async function callGetModel() { + // Construct request + const request = { + projectId, + datasetId, + modelId, + }; + + // Run request + const response = await bigqueryClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END bigquery_v2_generated_ModelService_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.list_models.js b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.list_models.js new file mode 100644 index 000000000000..53233ea4f216 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.list_models.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_ModelService_ListModels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the models to list. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the models to list. + */ + // const datasetId = 'abc123' + /** + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + */ + // const maxResults = 1234 + /** + * Page token, returned by a previous call to request the next page of + * results + */ + // const pageToken = 'abc123' + + // Imports the Bigquery library + const {ModelServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new ModelServiceClient(); + + async function callListModels() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const iterable = bigqueryClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END bigquery_v2_generated_ModelService_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.patch_model.js b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.patch_model.js new file mode 100644 index 000000000000..913b7acc378e --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/model_service.patch_model.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, modelId, model) { + // [START bigquery_v2_generated_ModelService_PatchModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the model to patch. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the model to patch. + */ + // const datasetId = 'abc123' + /** + * Required. Model ID of the model to patch. + */ + // const modelId = 'abc123' + /** + * Required. Patched model. + * Follows RFC5789 patch semantics. Missing fields are not updated. + * To clear a field, explicitly set to default value. + */ + // const model = {} + + // Imports the Bigquery library + const {ModelServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new ModelServiceClient(); + + async function callPatchModel() { + // Construct request + const request = { + projectId, + datasetId, + modelId, + model, + }; + + // Run request + const response = await bigqueryClient.patchModel(request); + console.log(response); + } + + callPatchModel(); + // [END bigquery_v2_generated_ModelService_PatchModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/project_service.get_service_account.js b/packages/google-cloud-bigquery-api/samples/generated/v2/project_service.get_service_account.js new file mode 100644 index 000000000000..f5d7ec9b3670 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/project_service.get_service_account.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START bigquery_v2_generated_ProjectService_GetServiceAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + + // Imports the Bigquery library + const {ProjectServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new ProjectServiceClient(); + + async function callGetServiceAccount() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await bigqueryClient.getServiceAccount(request); + console.log(response); + } + + callGetServiceAccount(); + // [END bigquery_v2_generated_ProjectService_GetServiceAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.delete_routine.js b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.delete_routine.js new file mode 100644 index 000000000000..f3128f7360ef --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.delete_routine.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, routineId) { + // [START bigquery_v2_generated_RoutineService_DeleteRoutine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the routine to delete + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the routine to delete + */ + // const datasetId = 'abc123' + /** + * Required. Routine ID of the routine to delete + */ + // const routineId = 'abc123' + + // Imports the Bigquery library + const {RoutineServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RoutineServiceClient(); + + async function callDeleteRoutine() { + // Construct request + const request = { + projectId, + datasetId, + routineId, + }; + + // Run request + const response = await bigqueryClient.deleteRoutine(request); + console.log(response); + } + + callDeleteRoutine(); + // [END bigquery_v2_generated_RoutineService_DeleteRoutine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.get_routine.js b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.get_routine.js new file mode 100644 index 000000000000..8d6dac88c597 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.get_routine.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, routineId) { + // [START bigquery_v2_generated_RoutineService_GetRoutine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the requested routine + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the requested routine + */ + // const datasetId = 'abc123' + /** + * Required. Routine ID of the requested routine + */ + // const routineId = 'abc123' + + // Imports the Bigquery library + const {RoutineServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RoutineServiceClient(); + + async function callGetRoutine() { + // Construct request + const request = { + projectId, + datasetId, + routineId, + }; + + // Run request + const response = await bigqueryClient.getRoutine(request); + console.log(response); + } + + callGetRoutine(); + // [END bigquery_v2_generated_RoutineService_GetRoutine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.insert_routine.js b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.insert_routine.js new file mode 100644 index 000000000000..e7782ef1bfa6 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.insert_routine.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, routine) { + // [START bigquery_v2_generated_RoutineService_InsertRoutine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the new routine + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the new routine + */ + // const datasetId = 'abc123' + /** + * Required. A routine resource to insert + */ + // const routine = {} + + // Imports the Bigquery library + const {RoutineServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RoutineServiceClient(); + + async function callInsertRoutine() { + // Construct request + const request = { + projectId, + datasetId, + routine, + }; + + // Run request + const response = await bigqueryClient.insertRoutine(request); + console.log(response); + } + + callInsertRoutine(); + // [END bigquery_v2_generated_RoutineService_InsertRoutine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.list_routines.js b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.list_routines.js new file mode 100644 index 000000000000..8cdcce5c7186 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.list_routines.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_RoutineService_ListRoutines_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the routines to list + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the routines to list + */ + // const datasetId = 'abc123' + /** + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + */ + // const maxResults = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results + */ + // const pageToken = 'abc123' + /** + * 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`. + */ + // const filter = 'abc123' + + // Imports the Bigquery library + const {RoutineServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RoutineServiceClient(); + + async function callListRoutines() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const iterable = bigqueryClient.listRoutinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRoutines(); + // [END bigquery_v2_generated_RoutineService_ListRoutines_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.update_routine.js b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.update_routine.js new file mode 100644 index 000000000000..a1fe4243e8da --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/routine_service.update_routine.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, routineId, routine) { + // [START bigquery_v2_generated_RoutineService_UpdateRoutine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the routine to update + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the routine to update + */ + // const datasetId = 'abc123' + /** + * Required. Routine ID of the routine to update + */ + // const routineId = 'abc123' + /** + * Required. A routine resource which will replace the specified routine + */ + // const routine = {} + + // Imports the Bigquery library + const {RoutineServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RoutineServiceClient(); + + async function callUpdateRoutine() { + // Construct request + const request = { + projectId, + datasetId, + routineId, + routine, + }; + + // Run request + const response = await bigqueryClient.updateRoutine(request); + console.log(response); + } + + callUpdateRoutine(); + // [END bigquery_v2_generated_RoutineService_UpdateRoutine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.batch_delete_row_access_policies.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.batch_delete_row_access_policies.js new file mode 100644 index 000000000000..ad6da5451f45 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.batch_delete_row_access_policies.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, policyIds) { + // [START bigquery_v2_generated_RowAccessPolicyService_BatchDeleteRowAccessPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to delete the row access policies. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to delete the row access policies. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to delete the row access policies. + */ + // const tableId = 'abc123' + /** + * Required. Policy IDs of the row access policies. + */ + // const policyIds = ['abc','def'] + /** + * 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. + */ + // const force = true + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callBatchDeleteRowAccessPolicies() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + policyIds, + }; + + // Run request + const response = await bigqueryClient.batchDeleteRowAccessPolicies(request); + console.log(response); + } + + callBatchDeleteRowAccessPolicies(); + // [END bigquery_v2_generated_RowAccessPolicyService_BatchDeleteRowAccessPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.create_row_access_policy.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.create_row_access_policy.js new file mode 100644 index 000000000000..e142cfa756f6 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.create_row_access_policy.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, rowAccessPolicy) { + // [START bigquery_v2_generated_RowAccessPolicyService_CreateRowAccessPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to get the row access policy. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to get the row access policy. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to get the row access policy. + */ + // const tableId = 'abc123' + /** + * Required. The row access policy to create. + */ + // const rowAccessPolicy = {} + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callCreateRowAccessPolicy() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + rowAccessPolicy, + }; + + // Run request + const response = await bigqueryClient.createRowAccessPolicy(request); + console.log(response); + } + + callCreateRowAccessPolicy(); + // [END bigquery_v2_generated_RowAccessPolicyService_CreateRowAccessPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.delete_row_access_policy.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.delete_row_access_policy.js new file mode 100644 index 000000000000..ffc2a3e603ac --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.delete_row_access_policy.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, policyId) { + // [START bigquery_v2_generated_RowAccessPolicyService_DeleteRowAccessPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to delete the row access policy. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to delete the row access policy. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to delete the row access policy. + */ + // const tableId = 'abc123' + /** + * Required. Policy ID of the row access policy. + */ + // const policyId = 'abc123' + /** + * 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. + */ + // const force = true + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callDeleteRowAccessPolicy() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + policyId, + }; + + // Run request + const response = await bigqueryClient.deleteRowAccessPolicy(request); + console.log(response); + } + + callDeleteRowAccessPolicy(); + // [END bigquery_v2_generated_RowAccessPolicyService_DeleteRowAccessPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.get_row_access_policy.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.get_row_access_policy.js new file mode 100644 index 000000000000..4bb47f0f278d --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.get_row_access_policy.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, policyId) { + // [START bigquery_v2_generated_RowAccessPolicyService_GetRowAccessPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to get the row access policy. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to get the row access policy. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to get the row access policy. + */ + // const tableId = 'abc123' + /** + * Required. Policy ID of the row access policy. + */ + // const policyId = 'abc123' + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callGetRowAccessPolicy() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + policyId, + }; + + // Run request + const response = await bigqueryClient.getRowAccessPolicy(request); + console.log(response); + } + + callGetRowAccessPolicy(); + // [END bigquery_v2_generated_RowAccessPolicyService_GetRowAccessPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.list_row_access_policies.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.list_row_access_policies.js new file mode 100644 index 000000000000..aa7d4e4b2be9 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.list_row_access_policies.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId) { + // [START bigquery_v2_generated_RowAccessPolicyService_ListRowAccessPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the row access policies to list. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of row access policies to list. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to list row access policies. + */ + // const tableId = 'abc123' + /** + * Page token, returned by a previous call, to request the next page of + * results. + */ + // const pageToken = 'abc123' + /** + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + */ + // const pageSize = 1234 + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callListRowAccessPolicies() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + }; + + // Run request + const iterable = bigqueryClient.listRowAccessPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRowAccessPolicies(); + // [END bigquery_v2_generated_RowAccessPolicyService_ListRowAccessPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.update_row_access_policy.js b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.update_row_access_policy.js new file mode 100644 index 000000000000..df4dfba6b805 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/row_access_policy_service.update_row_access_policy.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, policyId, rowAccessPolicy) { + // [START bigquery_v2_generated_RowAccessPolicyService_UpdateRowAccessPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to get the row access policy. + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to get the row access policy. + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to get the row access policy. + */ + // const tableId = 'abc123' + /** + * Required. Policy ID of the row access policy. + */ + // const policyId = 'abc123' + /** + * Required. The row access policy to update. + */ + // const rowAccessPolicy = {} + + // Imports the Bigquery library + const {RowAccessPolicyServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new RowAccessPolicyServiceClient(); + + async function callUpdateRowAccessPolicy() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + policyId, + rowAccessPolicy, + }; + + // Run request + const response = await bigqueryClient.updateRowAccessPolicy(request); + console.log(response); + } + + callUpdateRowAccessPolicy(); + // [END bigquery_v2_generated_RowAccessPolicyService_UpdateRowAccessPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.delete_table.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.delete_table.js new file mode 100644 index 000000000000..95a3e9a6a24a --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.delete_table.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId) { + // [START bigquery_v2_generated_TableService_DeleteTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to delete + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to delete + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to delete + */ + // const tableId = 'abc123' + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callDeleteTable() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + }; + + // Run request + const response = await bigqueryClient.deleteTable(request); + console.log(response); + } + + callDeleteTable(); + // [END bigquery_v2_generated_TableService_DeleteTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.get_table.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.get_table.js new file mode 100644 index 000000000000..016b3fd59b0d --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.get_table.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId) { + // [START bigquery_v2_generated_TableService_GetTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the requested table + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the requested table + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the requested table + */ + // const tableId = 'abc123' + /** + * 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. + */ + // const selectedFields = 'abc123' + /** + * Optional. Specifies the view that determines which table information is + * returned. By default, basic table information and storage statistics + * (STORAGE_STATS) are returned. + */ + // const view = {} + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callGetTable() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + }; + + // Run request + const response = await bigqueryClient.getTable(request); + console.log(response); + } + + callGetTable(); + // [END bigquery_v2_generated_TableService_GetTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.insert_table.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.insert_table.js new file mode 100644 index 000000000000..7678e5196e1c --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.insert_table.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, table) { + // [START bigquery_v2_generated_TableService_InsertTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the new table + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the new table + */ + // const datasetId = 'abc123' + /** + * Required. A tables resource to insert + */ + // const table = {} + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callInsertTable() { + // Construct request + const request = { + projectId, + datasetId, + table, + }; + + // Run request + const response = await bigqueryClient.insertTable(request); + console.log(response); + } + + callInsertTable(); + // [END bigquery_v2_generated_TableService_InsertTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.list_tables.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.list_tables.js new file mode 100644 index 000000000000..81dafbac6915 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.list_tables.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId) { + // [START bigquery_v2_generated_TableService_ListTables_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the tables to list + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the tables to list + */ + // const datasetId = 'abc123' + /** + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + */ + // const maxResults = 1234 + /** + * Page token, returned by a previous call, to request the next page of + * results + */ + // const pageToken = 'abc123' + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callListTables() { + // Construct request + const request = { + projectId, + datasetId, + }; + + // Run request + const iterable = bigqueryClient.listTablesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTables(); + // [END bigquery_v2_generated_TableService_ListTables_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.patch_table.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.patch_table.js new file mode 100644 index 000000000000..e388f2290ce6 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.patch_table.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, table) { + // [START bigquery_v2_generated_TableService_PatchTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to update + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to update + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to update + */ + // const tableId = 'abc123' + /** + * Required. A tables resource which will replace or patch the specified table + */ + // const table = {} + /** + * Optional. When true will autodetect schema, else will keep original schema. + */ + // const autodetectSchema = true + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callPatchTable() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + table, + }; + + // Run request + const response = await bigqueryClient.patchTable(request); + console.log(response); + } + + callPatchTable(); + // [END bigquery_v2_generated_TableService_PatchTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.update_table.js b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.update_table.js new file mode 100644 index 000000000000..506854517db4 --- /dev/null +++ b/packages/google-cloud-bigquery-api/samples/generated/v2/table_service.update_table.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, datasetId, tableId, table) { + // [START bigquery_v2_generated_TableService_UpdateTable_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project ID of the table to update + */ + // const projectId = 'abc123' + /** + * Required. Dataset ID of the table to update + */ + // const datasetId = 'abc123' + /** + * Required. Table ID of the table to update + */ + // const tableId = 'abc123' + /** + * Required. A tables resource which will replace or patch the specified table + */ + // const table = {} + /** + * Optional. When true will autodetect schema, else will keep original schema. + */ + // const autodetectSchema = true + + // Imports the Bigquery library + const {TableServiceClient} = require('@google-cloud/bigquery-api').v2; + + // Instantiates a client + const bigqueryClient = new TableServiceClient(); + + async function callUpdateTable() { + // Construct request + const request = { + projectId, + datasetId, + tableId, + table, + }; + + // Run request + const response = await bigqueryClient.updateTable(request); + console.log(response); + } + + callUpdateTable(); + // [END bigquery_v2_generated_TableService_UpdateTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-api/src/index.ts b/packages/google-cloud-bigquery-api/src/index.ts new file mode 100644 index 000000000000..6732d0d9eef7 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/index.ts @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const DatasetServiceClient = v2.DatasetServiceClient; +type DatasetServiceClient = v2.DatasetServiceClient; +const JobServiceClient = v2.JobServiceClient; +type JobServiceClient = v2.JobServiceClient; +const ModelServiceClient = v2.ModelServiceClient; +type ModelServiceClient = v2.ModelServiceClient; +const ProjectServiceClient = v2.ProjectServiceClient; +type ProjectServiceClient = v2.ProjectServiceClient; +const RoutineServiceClient = v2.RoutineServiceClient; +type RoutineServiceClient = v2.RoutineServiceClient; +const RowAccessPolicyServiceClient = v2.RowAccessPolicyServiceClient; +type RowAccessPolicyServiceClient = v2.RowAccessPolicyServiceClient; +const TableServiceClient = v2.TableServiceClient; +type TableServiceClient = v2.TableServiceClient; + +export {v2, DatasetServiceClient, JobServiceClient, ModelServiceClient, ProjectServiceClient, RoutineServiceClient, RowAccessPolicyServiceClient, TableServiceClient}; +export default {v2, DatasetServiceClient, JobServiceClient, ModelServiceClient, ProjectServiceClient, RoutineServiceClient, RowAccessPolicyServiceClient, TableServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-api/src/v2/dataset_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/dataset_service_client.ts new file mode 100644 index 000000000000..ff6f392e42b2 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/dataset_service_client.ts @@ -0,0 +1,1587 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/dataset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dataset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * DatasetService provides methods for managing BigQuery datasets. + * @class + * @memberof v2 + */ +export class DatasetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + datasetServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of DatasetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DatasetServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DatasetServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datasets', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.DatasetService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.datasetServiceStub) { + return this.datasetServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.DatasetService. + this.datasetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.DatasetService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.DatasetService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const datasetServiceStubMethods = [ + 'getDataset', + 'insertDataset', + 'patchDataset', + 'updateDataset', + 'deleteDataset', + 'listDatasets', + 'undeleteDataset', + ]; + for (const methodName of datasetServiceStubMethods) { + const callPromise = this.datasetServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.datasetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns the dataset specified by datasetID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the requested dataset + * @param {string} request.datasetId + * Required. Dataset ID of the requested dataset + * @param {google.cloud.bigquery.v2.GetDatasetRequest.DatasetView} [request.datasetView] + * Optional. Specifies the view that determines which dataset information is + * returned. By default, metadata and ACL information are returned. + * @param {number} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.get_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.bigquery.v2.IGetDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | undefined, + {} | undefined, + ] + >; + getDataset( + request: protos.google.cloud.bigquery.v2.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + getDataset( + request: protos.google.cloud.bigquery.v2.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + getDataset( + request?: protos.google.cloud.bigquery.v2.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IGetDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a new empty dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the new dataset + * @param {google.cloud.bigquery.v2.Dataset} request.dataset + * Required. Datasets resource to use for the new dataset + * @param {number} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.insert_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_InsertDataset_async + */ + insertDataset( + request?: protos.google.cloud.bigquery.v2.IInsertDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | undefined, + {} | undefined, + ] + >; + insertDataset( + request: protos.google.cloud.bigquery.v2.IInsertDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertDataset( + request: protos.google.cloud.bigquery.v2.IInsertDatasetRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertDataset( + request?: protos.google.cloud.bigquery.v2.IInsertDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IInsertDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('insertDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IInsertDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('insertDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .insertDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IInsertDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('insertDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the dataset being updated + * @param {string} request.datasetId + * Required. Dataset ID of the dataset being updated + * @param {google.cloud.bigquery.v2.Dataset} request.dataset + * Required. Datasets resource which will replace or patch the specified + * dataset. + * @param {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode} [request.updateMode] + * Optional. Specifies the fields of dataset that update/patch operation is + * targeting By default, both metadata and ACL fields are updated. + * @param {number} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.patch_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_PatchDataset_async + */ + patchDataset( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest | undefined, + {} | undefined, + ] + >; + patchDataset( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + patchDataset( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + patchDataset( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('patchDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('patchDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .patchDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IDataset, + ( + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('patchDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the dataset being updated + * @param {string} request.datasetId + * Required. Dataset ID of the dataset being updated + * @param {google.cloud.bigquery.v2.Dataset} request.dataset + * Required. Datasets resource which will replace or patch the specified + * dataset. + * @param {google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest.UpdateMode} [request.updateMode] + * Optional. Specifies the fields of dataset that update/patch operation is + * targeting By default, both metadata and ACL fields are updated. + * @param {number} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.update_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest | undefined, + {} | undefined, + ] + >; + updateDataset( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateDataset( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateDataset( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IDataset, + ( + | protos.google.cloud.bigquery.v2.IUpdateOrPatchDatasetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the dataset being deleted + * @param {string} request.datasetId + * Required. Dataset ID of dataset being deleted + * @param {boolean} request.deleteContents + * If True, delete all the tables in the dataset. + * If False and the dataset contains tables, the request will fail. + * Default is False + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.delete_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.bigquery.v2.IDeleteDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | undefined, + {} | undefined, + ] + >; + deleteDataset( + request: protos.google.cloud.bigquery.v2.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteDataset( + request: protos.google.cloud.bigquery.v2.IDeleteDatasetRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteDataset( + request?: protos.google.cloud.bigquery.v2.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the dataset to be undeleted + * @param {string} request.datasetId + * Required. Dataset ID of dataset being deleted + * @param {google.protobuf.Timestamp} [request.deletionTime] + * Optional. 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Dataset|Dataset}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.undelete_dataset.js + * region_tag:bigquery_v2_generated_DatasetService_UndeleteDataset_async + */ + undeleteDataset( + request?: protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest | undefined, + {} | undefined, + ] + >; + undeleteDataset( + request: protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + undeleteDataset( + request: protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + undeleteDataset( + request?: protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('undeleteDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IDataset, + | protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('undeleteDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .undeleteDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IDataset, + protos.google.cloud.bigquery.v2.IUndeleteDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('undeleteDataset response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Lists all datasets in the specified project to which the user has been + * granted the READER dataset role. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the datasets to be listed + * @param {google.protobuf.UInt32Value| number } request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {boolean} request.all + * Whether to list all datasets, including hidden ones + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.ListFormatDataset|ListFormatDataset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasets( + request?: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatDataset[], + protos.google.cloud.bigquery.v2.IListDatasetsRequest | null, + protos.google.cloud.bigquery.v2.IDatasetList, + ] + >; + listDatasets( + request: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListDatasetsRequest, + protos.google.cloud.bigquery.v2.IDatasetList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatDataset + >, + ): void; + listDatasets( + request: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListDatasetsRequest, + protos.google.cloud.bigquery.v2.IDatasetList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatDataset + >, + ): void; + listDatasets( + request?: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListDatasetsRequest, + protos.google.cloud.bigquery.v2.IDatasetList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatDataset + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListDatasetsRequest, + protos.google.cloud.bigquery.v2.IDatasetList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatDataset + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatDataset[], + protos.google.cloud.bigquery.v2.IListDatasetsRequest | null, + protos.google.cloud.bigquery.v2.IDatasetList, + ] + > | void { + request = request || {}; + // Converts number to Unit32 or Int32 value for non-compliant APIs. + if (request.maxResults && typeof request.maxResults === 'number') { + const maxResultsObject = { value: request.maxResults }; + request.maxResults = maxResultsObject; + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListDatasetsRequest, + protos.google.cloud.bigquery.v2.IDatasetList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatDataset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatasets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatasets request %j', request); + return this.innerApiCalls + .listDatasets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IListFormatDataset[], + protos.google.cloud.bigquery.v2.IListDatasetsRequest | null, + protos.google.cloud.bigquery.v2.IDatasetList, + ]) => { + this._log.info('listDatasets values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listDatasets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the datasets to be listed + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {boolean} request.all + * Whether to list all datasets, including hidden ones + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.ListFormatDataset|ListFormatDataset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDatasetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDatasetsStream( + request?: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDatasets stream %j', request); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listDatasets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the datasets to be listed + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {boolean} request.all + * Whether to list all datasets, including hidden ones + * @param {string} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.ListFormatDataset|ListFormatDataset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/dataset_service.list_datasets.js + * region_tag:bigquery_v2_generated_DatasetService_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.bigquery.v2.IListDatasetsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listDatasets iterate %j', request); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.datasetServiceStub && !this._terminated) { + return this.datasetServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/dataset_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/dataset_service_client_config.json new file mode 100644 index 000000000000..134b14cf3ba3 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/dataset_service_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.DatasetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617": { + "initial_retry_delay_millis": 400, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetDataset": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "InsertDataset": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "PatchDataset": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "ListDatasets": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "UndeleteDataset": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/dataset_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/dataset_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/dataset_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/gapic_metadata.json b/packages/google-cloud-bigquery-api/src/v2/gapic_metadata.json new file mode 100644 index 000000000000..3eed76d10b8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/gapic_metadata.json @@ -0,0 +1,491 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.v2", + "libraryPackage": "@google-cloud/bigquery-api", + "services": { + "DatasetService": { + "clients": { + "grpc": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "InsertDataset": { + "methods": [ + "insertDataset" + ] + }, + "PatchDataset": { + "methods": [ + "patchDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "UndeleteDataset": { + "methods": [ + "undeleteDataset" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DatasetServiceClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "InsertDataset": { + "methods": [ + "insertDataset" + ] + }, + "PatchDataset": { + "methods": [ + "patchDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "UndeleteDataset": { + "methods": [ + "undeleteDataset" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "InsertJob": { + "methods": [ + "insertJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetQueryResults": { + "methods": [ + "getQueryResults" + ] + }, + "Query": { + "methods": [ + "query" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobServiceClient", + "rpcs": { + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "InsertJob": { + "methods": [ + "insertJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "GetQueryResults": { + "methods": [ + "getQueryResults" + ] + }, + "Query": { + "methods": [ + "query" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "PatchModel": { + "methods": [ + "patchModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "PatchModel": { + "methods": [ + "patchModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + } + } + } + } + }, + "ProjectService": { + "clients": { + "grpc": { + "libraryClient": "ProjectServiceClient", + "rpcs": { + "GetServiceAccount": { + "methods": [ + "getServiceAccount" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProjectServiceClient", + "rpcs": { + "GetServiceAccount": { + "methods": [ + "getServiceAccount" + ] + } + } + } + } + }, + "RoutineService": { + "clients": { + "grpc": { + "libraryClient": "RoutineServiceClient", + "rpcs": { + "GetRoutine": { + "methods": [ + "getRoutine" + ] + }, + "InsertRoutine": { + "methods": [ + "insertRoutine" + ] + }, + "UpdateRoutine": { + "methods": [ + "updateRoutine" + ] + }, + "DeleteRoutine": { + "methods": [ + "deleteRoutine" + ] + }, + "ListRoutines": { + "methods": [ + "listRoutines", + "listRoutinesStream", + "listRoutinesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RoutineServiceClient", + "rpcs": { + "GetRoutine": { + "methods": [ + "getRoutine" + ] + }, + "InsertRoutine": { + "methods": [ + "insertRoutine" + ] + }, + "UpdateRoutine": { + "methods": [ + "updateRoutine" + ] + }, + "DeleteRoutine": { + "methods": [ + "deleteRoutine" + ] + }, + "ListRoutines": { + "methods": [ + "listRoutines", + "listRoutinesStream", + "listRoutinesAsync" + ] + } + } + } + } + }, + "RowAccessPolicyService": { + "clients": { + "grpc": { + "libraryClient": "RowAccessPolicyServiceClient", + "rpcs": { + "GetRowAccessPolicy": { + "methods": [ + "getRowAccessPolicy" + ] + }, + "CreateRowAccessPolicy": { + "methods": [ + "createRowAccessPolicy" + ] + }, + "UpdateRowAccessPolicy": { + "methods": [ + "updateRowAccessPolicy" + ] + }, + "DeleteRowAccessPolicy": { + "methods": [ + "deleteRowAccessPolicy" + ] + }, + "BatchDeleteRowAccessPolicies": { + "methods": [ + "batchDeleteRowAccessPolicies" + ] + }, + "ListRowAccessPolicies": { + "methods": [ + "listRowAccessPolicies", + "listRowAccessPoliciesStream", + "listRowAccessPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RowAccessPolicyServiceClient", + "rpcs": { + "GetRowAccessPolicy": { + "methods": [ + "getRowAccessPolicy" + ] + }, + "CreateRowAccessPolicy": { + "methods": [ + "createRowAccessPolicy" + ] + }, + "UpdateRowAccessPolicy": { + "methods": [ + "updateRowAccessPolicy" + ] + }, + "DeleteRowAccessPolicy": { + "methods": [ + "deleteRowAccessPolicy" + ] + }, + "BatchDeleteRowAccessPolicies": { + "methods": [ + "batchDeleteRowAccessPolicies" + ] + }, + "ListRowAccessPolicies": { + "methods": [ + "listRowAccessPolicies", + "listRowAccessPoliciesStream", + "listRowAccessPoliciesAsync" + ] + } + } + } + } + }, + "TableService": { + "clients": { + "grpc": { + "libraryClient": "TableServiceClient", + "rpcs": { + "GetTable": { + "methods": [ + "getTable" + ] + }, + "InsertTable": { + "methods": [ + "insertTable" + ] + }, + "PatchTable": { + "methods": [ + "patchTable" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "ListTables": { + "methods": [ + "listTables", + "listTablesStream", + "listTablesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TableServiceClient", + "rpcs": { + "GetTable": { + "methods": [ + "getTable" + ] + }, + "InsertTable": { + "methods": [ + "insertTable" + ] + }, + "PatchTable": { + "methods": [ + "patchTable" + ] + }, + "UpdateTable": { + "methods": [ + "updateTable" + ] + }, + "DeleteTable": { + "methods": [ + "deleteTable" + ] + }, + "ListTables": { + "methods": [ + "listTables", + "listTablesStream", + "listTablesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/index.ts b/packages/google-cloud-bigquery-api/src/v2/index.ts new file mode 100644 index 000000000000..9049574b14cc --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/index.ts @@ -0,0 +1,25 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export { DatasetServiceClient } from './dataset_service_client'; +export { JobServiceClient } from './job_service_client'; +export { ModelServiceClient } from './model_service_client'; +export { ProjectServiceClient } from './project_service_client'; +export { RoutineServiceClient } from './routine_service_client'; +export { RowAccessPolicyServiceClient } from './row_access_policy_service_client'; +export { TableServiceClient } from './table_service_client'; diff --git a/packages/google-cloud-bigquery-api/src/v2/job_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/job_service_client.ts new file mode 100644 index 000000000000..e376648f6374 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/job_service_client.ts @@ -0,0 +1,1529 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/job_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * @class + * @memberof v2 + */ +export class JobServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + jobServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of JobServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof JobServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.JobService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.jobServiceStub) { + return this.jobServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.JobService. + this.jobServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.JobService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.JobService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const jobServiceStubMethods = [ + 'cancelJob', + 'getJob', + 'insertJob', + 'deleteJob', + 'listJobs', + 'getQueryResults', + 'query', + ]; + for (const methodName of jobServiceStubMethods) { + const callPromise = this.jobServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.jobServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/devstorage.full_control', + 'https://www.googleapis.com/auth/devstorage.read_only', + 'https://www.googleapis.com/auth/devstorage.read_write', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the job to cancel + * @param {string} request.jobId + * Required. Job ID of the job to cancel + * @param {string} request.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`) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.JobCancelResponse|JobCancelResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.cancel_job.js + * region_tag:bigquery_v2_generated_JobService_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.bigquery.v2.ICancelJobRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | undefined, + {} | undefined, + ] + >; + cancelJob( + request: protos.google.cloud.bigquery.v2.ICancelJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + cancelJob( + request: protos.google.cloud.bigquery.v2.ICancelJobRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + cancelJob( + request?: protos.google.cloud.bigquery.v2.ICancelJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + job_id: request.jobId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('cancelJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('cancelJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .cancelJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IJobCancelResponse, + protos.google.cloud.bigquery.v2.ICancelJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('cancelJob response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the requested job. + * @param {string} request.jobId + * Required. Job ID of the requested job. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.get_job.js + * region_tag:bigquery_v2_generated_JobService_GetJob_async + */ + getJob( + request?: protos.google.cloud.bigquery.v2.IGetJobRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | undefined, + {} | undefined, + ] + >; + getJob( + request: protos.google.cloud.bigquery.v2.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + getJob( + request: protos.google.cloud.bigquery.v2.IGetJobRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + getJob( + request?: protos.google.cloud.bigquery.v2.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + job_id: request.jobId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IGetJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getJob response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Project ID of project that will be billed for the job. + * @param {google.cloud.bigquery.v2.Job} request.job + * Jobs resource to insert. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.insert_job.js + * region_tag:bigquery_v2_generated_JobService_InsertJob_async + */ + insertJob( + request?: protos.google.cloud.bigquery.v2.IInsertJobRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | undefined, + {} | undefined, + ] + >; + insertJob( + request: protos.google.cloud.bigquery.v2.IInsertJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertJob( + request: protos.google.cloud.bigquery.v2.IInsertJobRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertJob( + request?: protos.google.cloud.bigquery.v2.IInsertJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('insertJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('insertJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .insertJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IJob, + protos.google.cloud.bigquery.v2.IInsertJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('insertJob response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Requests the deletion of the metadata of a job. This call returns when the + * job's metadata is deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the job for which metadata is to be deleted. + * @param {string} request.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. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.delete_job.js + * region_tag:bigquery_v2_generated_JobService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.bigquery.v2.IDeleteJobRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | undefined, + {} | undefined, + ] + >; + deleteJob( + request: protos.google.cloud.bigquery.v2.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteJob( + request: protos.google.cloud.bigquery.v2.IDeleteJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteJob( + request?: protos.google.cloud.bigquery.v2.IDeleteJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + job_id: request.jobId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteJob response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * RPC to get the results of a query job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the query job. + * @param {string} request.jobId + * Required. Job ID of the query job. + * @param {google.protobuf.UInt64Value} request.startIndex + * Zero-based index of the starting row. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {google.protobuf.UInt32Value} request.maxResults + * Maximum number of results to read. + * @param {google.protobuf.UInt32Value} request.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. + * @param {string} request.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). + * @param {google.cloud.bigquery.v2.DataFormatOptions} [request.formatOptions] + * Optional. Output format adjustments. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.GetQueryResultsResponse|GetQueryResultsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.get_query_results.js + * region_tag:bigquery_v2_generated_JobService_GetQueryResults_async + */ + getQueryResults( + request?: protos.google.cloud.bigquery.v2.IGetQueryResultsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + protos.google.cloud.bigquery.v2.IGetQueryResultsRequest | undefined, + {} | undefined, + ] + >; + getQueryResults( + request: protos.google.cloud.bigquery.v2.IGetQueryResultsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + | protos.google.cloud.bigquery.v2.IGetQueryResultsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getQueryResults( + request: protos.google.cloud.bigquery.v2.IGetQueryResultsRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + | protos.google.cloud.bigquery.v2.IGetQueryResultsRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getQueryResults( + request?: protos.google.cloud.bigquery.v2.IGetQueryResultsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + | protos.google.cloud.bigquery.v2.IGetQueryResultsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + | protos.google.cloud.bigquery.v2.IGetQueryResultsRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + protos.google.cloud.bigquery.v2.IGetQueryResultsRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + job_id: request.jobId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getQueryResults request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + | protos.google.cloud.bigquery.v2.IGetQueryResultsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQueryResults response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQueryResults(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IGetQueryResultsResponse, + protos.google.cloud.bigquery.v2.IGetQueryResultsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getQueryResults response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Runs a BigQuery SQL query synchronously and returns query results if the + * query completes within a specified timeout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the query request. + * @param {google.cloud.bigquery.v2.QueryRequest} request.queryRequest + * The query request body. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.QueryResponse|QueryResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.query.js + * region_tag:bigquery_v2_generated_JobService_Query_async + */ + query( + request?: protos.google.cloud.bigquery.v2.IPostQueryRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | undefined, + {} | undefined, + ] + >; + query( + request: protos.google.cloud.bigquery.v2.IPostQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | null | undefined, + {} | null | undefined + >, + ): void; + query( + request: protos.google.cloud.bigquery.v2.IPostQueryRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | null | undefined, + {} | null | undefined + >, + ): void; + query( + request?: protos.google.cloud.bigquery.v2.IPostQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('query request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('query response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .query(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IQueryResponse, + protos.google.cloud.bigquery.v2.IPostQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('query response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Project ID of the jobs to list. + * @param {boolean} request.allUsers + * Whether to display jobs owned by all users in the project. Default False. + * @param {google.protobuf.Int32Value| number } request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {number} request.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. + * @param {google.protobuf.UInt64Value} request.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. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {google.cloud.bigquery.v2.ListJobsRequest.Projection} request.projection + * Restrict information returned to a set of selected fields + * @param {number[]} request.stateFilter + * Filter for job state + * @param {string} request.parentJobId + * If set, show only child jobs of the specified parent. Otherwise, show all + * top-level jobs. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.ListFormatJob|ListFormatJob}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listJobs( + request?: protos.google.cloud.bigquery.v2.IListJobsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatJob[], + protos.google.cloud.bigquery.v2.IListJobsRequest | null, + protos.google.cloud.bigquery.v2.IJobList, + ] + >; + listJobs( + request: protos.google.cloud.bigquery.v2.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListJobsRequest, + protos.google.cloud.bigquery.v2.IJobList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatJob + >, + ): void; + listJobs( + request: protos.google.cloud.bigquery.v2.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListJobsRequest, + protos.google.cloud.bigquery.v2.IJobList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatJob + >, + ): void; + listJobs( + request?: protos.google.cloud.bigquery.v2.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListJobsRequest, + protos.google.cloud.bigquery.v2.IJobList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatJob + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListJobsRequest, + protos.google.cloud.bigquery.v2.IJobList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatJob + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatJob[], + protos.google.cloud.bigquery.v2.IListJobsRequest | null, + protos.google.cloud.bigquery.v2.IJobList, + ] + > | void { + request = request || {}; + // Converts number to Unit32 or Int32 value for non-compliant APIs. + if (request.maxResults && typeof request.maxResults === 'number') { + const maxResultsObject = { value: request.maxResults }; + request.maxResults = maxResultsObject; + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListJobsRequest, + protos.google.cloud.bigquery.v2.IJobList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatJob + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listJobs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listJobs request %j', request); + return this.innerApiCalls + .listJobs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IListFormatJob[], + protos.google.cloud.bigquery.v2.IListJobsRequest | null, + protos.google.cloud.bigquery.v2.IJobList, + ]) => { + this._log.info('listJobs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listJobs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Project ID of the jobs to list. + * @param {boolean} request.allUsers + * Whether to display jobs owned by all users in the project. Default False. + * @param {google.protobuf.Int32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {number} request.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. + * @param {google.protobuf.UInt64Value} request.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. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {google.cloud.bigquery.v2.ListJobsRequest.Projection} request.projection + * Restrict information returned to a set of selected fields + * @param {number[]} request.stateFilter + * Filter for job state + * @param {string} request.parentJobId + * If set, show only child jobs of the specified parent. Otherwise, show all + * top-level jobs. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.ListFormatJob|ListFormatJob} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listJobsStream( + request?: protos.google.cloud.bigquery.v2.IListJobsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listJobs stream %j', request); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Project ID of the jobs to list. + * @param {boolean} request.allUsers + * Whether to display jobs owned by all users in the project. Default False. + * @param {google.protobuf.Int32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {number} request.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. + * @param {google.protobuf.UInt64Value} request.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. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {google.cloud.bigquery.v2.ListJobsRequest.Projection} request.projection + * Restrict information returned to a set of selected fields + * @param {number[]} request.stateFilter + * Filter for job state + * @param {string} request.parentJobId + * If set, show only child jobs of the specified parent. Otherwise, show all + * top-level jobs. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.ListFormatJob|ListFormatJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/job_service.list_jobs.js + * region_tag:bigquery_v2_generated_JobService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.bigquery.v2.IListJobsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listJobs iterate %j', request); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.jobServiceStub && !this._terminated) { + return this.jobServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/job_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/job_service_client_config.json new file mode 100644 index 000000000000..3c1435242600 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/job_service_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.JobService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617": { + "initial_retry_delay_millis": 400, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CancelJob": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "InsertJob": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "DeleteJob": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "GetQueryResults": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "Query": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/job_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/job_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/job_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/model_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/model_service_client.ts new file mode 100644 index 000000000000..93e1fe057276 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/model_service_client.ts @@ -0,0 +1,1035 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/model_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Model Service for BigQuery ML + * @class + * @memberof v2 + */ +export class ModelServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + modelServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ModelServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ModelServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ModelServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'models', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.ModelService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.modelServiceStub) { + return this.modelServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.ModelService. + this.modelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.ModelService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.ModelService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const modelServiceStubMethods = [ + 'getModel', + 'listModels', + 'patchModel', + 'deleteModel', + ]; + for (const methodName of modelServiceStubMethods) { + const callPromise = this.modelServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified model resource by model ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the requested model. + * @param {string} request.datasetId + * Required. Dataset ID of the requested model. + * @param {string} request.modelId + * Required. Model ID of the requested model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/model_service.get_model.js + * region_tag:bigquery_v2_generated_ModelService_GetModel_async + */ + getModel( + request?: protos.google.cloud.bigquery.v2.IGetModelRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.cloud.bigquery.v2.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + getModel( + request: protos.google.cloud.bigquery.v2.IGetModelRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + getModel( + request?: protos.google.cloud.bigquery.v2.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + model_id: request.modelId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IGetModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Patch specific fields in the specified model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the model to patch. + * @param {string} request.datasetId + * Required. Dataset ID of the model to patch. + * @param {string} request.modelId + * Required. Model ID of the model to patch. + * @param {google.cloud.bigquery.v2.Model} request.model + * Required. Patched model. + * Follows RFC5789 patch semantics. Missing fields are not updated. + * To clear a field, explicitly set to default value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/model_service.patch_model.js + * region_tag:bigquery_v2_generated_ModelService_PatchModel_async + */ + patchModel( + request?: protos.google.cloud.bigquery.v2.IPatchModelRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | undefined, + {} | undefined, + ] + >; + patchModel( + request: protos.google.cloud.bigquery.v2.IPatchModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + patchModel( + request: protos.google.cloud.bigquery.v2.IPatchModelRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + patchModel( + request?: protos.google.cloud.bigquery.v2.IPatchModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + model_id: request.modelId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('patchModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('patchModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .patchModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IModel, + protos.google.cloud.bigquery.v2.IPatchModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('patchModel response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the model specified by modelId from the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the model to delete. + * @param {string} request.datasetId + * Required. Dataset ID of the model to delete. + * @param {string} request.modelId + * Required. Model ID of the model to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/model_service.delete_model.js + * region_tag:bigquery_v2_generated_ModelService_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.bigquery.v2.IDeleteModelRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | undefined, + {} | undefined, + ] + >; + deleteModel( + request: protos.google.cloud.bigquery.v2.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteModel( + request: protos.google.cloud.bigquery.v2.IDeleteModelRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteModel( + request?: protos.google.cloud.bigquery.v2.IDeleteModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + model_id: request.modelId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteModel response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the models to list. + * @param {string} request.datasetId + * Required. Dataset ID of the models to list. + * @param {google.protobuf.UInt32Value| number } request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.Model|Model}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModels( + request?: protos.google.cloud.bigquery.v2.IListModelsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel[], + protos.google.cloud.bigquery.v2.IListModelsRequest | null, + protos.google.cloud.bigquery.v2.IListModelsResponse, + ] + >; + listModels( + request: protos.google.cloud.bigquery.v2.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListModelsRequest, + protos.google.cloud.bigquery.v2.IListModelsResponse | null | undefined, + protos.google.cloud.bigquery.v2.IModel + >, + ): void; + listModels( + request: protos.google.cloud.bigquery.v2.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListModelsRequest, + protos.google.cloud.bigquery.v2.IListModelsResponse | null | undefined, + protos.google.cloud.bigquery.v2.IModel + >, + ): void; + listModels( + request?: protos.google.cloud.bigquery.v2.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListModelsRequest, + | protos.google.cloud.bigquery.v2.IListModelsResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IModel + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListModelsRequest, + protos.google.cloud.bigquery.v2.IListModelsResponse | null | undefined, + protos.google.cloud.bigquery.v2.IModel + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IModel[], + protos.google.cloud.bigquery.v2.IListModelsRequest | null, + protos.google.cloud.bigquery.v2.IListModelsResponse, + ] + > | void { + request = request || {}; + // Converts number to Unit32 or Int32 value for non-compliant APIs. + if (request.maxResults && typeof request.maxResults === 'number') { + const maxResultsObject = { value: request.maxResults }; + request.maxResults = maxResultsObject; + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListModelsRequest, + | protos.google.cloud.bigquery.v2.IListModelsResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IModel[], + protos.google.cloud.bigquery.v2.IListModelsRequest | null, + protos.google.cloud.bigquery.v2.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listModels`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the models to list. + * @param {string} request.datasetId + * Required. Dataset ID of the models to list. + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.Model|Model} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelsStream( + request?: protos.google.cloud.bigquery.v2.IListModelsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listModels stream %j', request); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listModels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the models to list. + * @param {string} request.datasetId + * Required. Dataset ID of the models to list. + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.Model|Model}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/model_service.list_models.js + * region_tag:bigquery_v2_generated_ModelService_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.bigquery.v2.IListModelsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listModels iterate %j', request); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.modelServiceStub && !this._terminated) { + return this.modelServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/model_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/model_service_client_config.json new file mode 100644 index 000000000000..d31436e1e162 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/model_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.ModelService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "PatchModel": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/model_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/model_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/model_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/project_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/project_service_client.ts new file mode 100644 index 000000000000..126facec2c46 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/project_service_client.ts @@ -0,0 +1,517 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/project_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './project_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * This service provides access to BigQuery functionality related to projects. + * @class + * @memberof v2 + */ +export class ProjectServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + projectServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of ProjectServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ProjectServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ProjectServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.ProjectService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.projectServiceStub) { + return this.projectServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.ProjectService. + this.projectServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.ProjectService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.ProjectService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const projectServiceStubMethods = ['getServiceAccount']; + for (const methodName of projectServiceStubMethods) { + const callPromise = this.projectServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.projectServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * RPC to get the service account for a project used for interactions with + * Google Cloud KMS + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. ID of the project. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.GetServiceAccountResponse|GetServiceAccountResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/project_service.get_service_account.js + * region_tag:bigquery_v2_generated_ProjectService_GetServiceAccount_async + */ + getServiceAccount( + request?: protos.google.cloud.bigquery.v2.IGetServiceAccountRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + protos.google.cloud.bigquery.v2.IGetServiceAccountRequest | undefined, + {} | undefined, + ] + >; + getServiceAccount( + request: protos.google.cloud.bigquery.v2.IGetServiceAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + | protos.google.cloud.bigquery.v2.IGetServiceAccountRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getServiceAccount( + request: protos.google.cloud.bigquery.v2.IGetServiceAccountRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + | protos.google.cloud.bigquery.v2.IGetServiceAccountRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getServiceAccount( + request?: protos.google.cloud.bigquery.v2.IGetServiceAccountRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + | protos.google.cloud.bigquery.v2.IGetServiceAccountRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + | protos.google.cloud.bigquery.v2.IGetServiceAccountRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + protos.google.cloud.bigquery.v2.IGetServiceAccountRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getServiceAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + | protos.google.cloud.bigquery.v2.IGetServiceAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getServiceAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getServiceAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IGetServiceAccountResponse, + protos.google.cloud.bigquery.v2.IGetServiceAccountRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getServiceAccount response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.projectServiceStub && !this._terminated) { + return this.projectServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/project_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/project_service_client_config.json new file mode 100644 index 000000000000..5110da2221a6 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/project_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.ProjectService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetServiceAccount": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/project_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/project_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/project_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/routine_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/routine_service_client.ts new file mode 100644 index 000000000000..4d00a168283a --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/routine_service_client.ts @@ -0,0 +1,1183 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/routine_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './routine_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * RoutineService provides management access to BigQuery routines. + * @class + * @memberof v2 + */ +export class RoutineServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + routineServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of RoutineServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RoutineServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof RoutineServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRoutines: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'routines', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.RoutineService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.routineServiceStub) { + return this.routineServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.RoutineService. + this.routineServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.RoutineService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.RoutineService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const routineServiceStubMethods = [ + 'getRoutine', + 'insertRoutine', + 'updateRoutine', + 'deleteRoutine', + 'listRoutines', + ]; + for (const methodName of routineServiceStubMethods) { + const callPromise = this.routineServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.routineServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified routine resource by routine ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the requested routine + * @param {string} request.datasetId + * Required. Dataset ID of the requested routine + * @param {string} request.routineId + * Required. Routine ID of the requested routine + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Routine|Routine}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routine_service.get_routine.js + * region_tag:bigquery_v2_generated_RoutineService_GetRoutine_async + */ + getRoutine( + request?: protos.google.cloud.bigquery.v2.IGetRoutineRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | undefined, + {} | undefined, + ] + >; + getRoutine( + request: protos.google.cloud.bigquery.v2.IGetRoutineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + getRoutine( + request: protos.google.cloud.bigquery.v2.IGetRoutineRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + getRoutine( + request?: protos.google.cloud.bigquery.v2.IGetRoutineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + routine_id: request.routineId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getRoutine request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRoutine response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRoutine(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IGetRoutineRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getRoutine response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a new routine in the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the new routine + * @param {string} request.datasetId + * Required. Dataset ID of the new routine + * @param {google.cloud.bigquery.v2.Routine} request.routine + * Required. A routine resource to insert + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Routine|Routine}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routine_service.insert_routine.js + * region_tag:bigquery_v2_generated_RoutineService_InsertRoutine_async + */ + insertRoutine( + request?: protos.google.cloud.bigquery.v2.IInsertRoutineRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | undefined, + {} | undefined, + ] + >; + insertRoutine( + request: protos.google.cloud.bigquery.v2.IInsertRoutineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertRoutine( + request: protos.google.cloud.bigquery.v2.IInsertRoutineRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertRoutine( + request?: protos.google.cloud.bigquery.v2.IInsertRoutineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + | protos.google.cloud.bigquery.v2.IInsertRoutineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('insertRoutine request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + | protos.google.cloud.bigquery.v2.IInsertRoutineRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('insertRoutine response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .insertRoutine(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IInsertRoutineRequest | undefined, + {} | undefined, + ]) => { + this._log.info('insertRoutine response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates information in an existing routine. The update method replaces the + * entire Routine resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the routine to update + * @param {string} request.datasetId + * Required. Dataset ID of the routine to update + * @param {string} request.routineId + * Required. Routine ID of the routine to update + * @param {google.cloud.bigquery.v2.Routine} request.routine + * Required. A routine resource which will replace the specified routine + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Routine|Routine}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routine_service.update_routine.js + * region_tag:bigquery_v2_generated_RoutineService_UpdateRoutine_async + */ + updateRoutine( + request?: protos.google.cloud.bigquery.v2.IUpdateRoutineRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | undefined, + {} | undefined, + ] + >; + updateRoutine( + request: protos.google.cloud.bigquery.v2.IUpdateRoutineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateRoutine( + request: protos.google.cloud.bigquery.v2.IUpdateRoutineRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateRoutine( + request?: protos.google.cloud.bigquery.v2.IUpdateRoutineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + | protos.google.cloud.bigquery.v2.IUpdateRoutineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + routine_id: request.routineId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateRoutine request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRoutine, + | protos.google.cloud.bigquery.v2.IUpdateRoutineRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateRoutine response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateRoutine(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRoutine, + protos.google.cloud.bigquery.v2.IUpdateRoutineRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateRoutine response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the routine specified by routineId from the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the routine to delete + * @param {string} request.datasetId + * Required. Dataset ID of the routine to delete + * @param {string} request.routineId + * Required. Routine ID of the routine to delete + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routine_service.delete_routine.js + * region_tag:bigquery_v2_generated_RoutineService_DeleteRoutine_async + */ + deleteRoutine( + request?: protos.google.cloud.bigquery.v2.IDeleteRoutineRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | undefined, + {} | undefined, + ] + >; + deleteRoutine( + request: protos.google.cloud.bigquery.v2.IDeleteRoutineRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteRoutine( + request: protos.google.cloud.bigquery.v2.IDeleteRoutineRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteRoutine( + request?: protos.google.cloud.bigquery.v2.IDeleteRoutineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRoutineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + routine_id: request.routineId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteRoutine request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRoutineRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteRoutine response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteRoutine(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRoutineRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteRoutine response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Lists all routines in the specified dataset. Requires the READER dataset + * role. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the routines to list + * @param {string} request.datasetId + * Required. Dataset ID of the routines to list + * @param {google.protobuf.UInt32Value| number } request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {string} request.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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.Routine|Routine}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRoutinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRoutines( + request?: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine[], + protos.google.cloud.bigquery.v2.IListRoutinesRequest | null, + protos.google.cloud.bigquery.v2.IListRoutinesResponse, + ] + >; + listRoutines( + request: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRoutinesRequest, + protos.google.cloud.bigquery.v2.IListRoutinesResponse | null | undefined, + protos.google.cloud.bigquery.v2.IRoutine + >, + ): void; + listRoutines( + request: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRoutinesRequest, + protos.google.cloud.bigquery.v2.IListRoutinesResponse | null | undefined, + protos.google.cloud.bigquery.v2.IRoutine + >, + ): void; + listRoutines( + request?: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListRoutinesRequest, + | protos.google.cloud.bigquery.v2.IListRoutinesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRoutine + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRoutinesRequest, + protos.google.cloud.bigquery.v2.IListRoutinesResponse | null | undefined, + protos.google.cloud.bigquery.v2.IRoutine + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRoutine[], + protos.google.cloud.bigquery.v2.IListRoutinesRequest | null, + protos.google.cloud.bigquery.v2.IListRoutinesResponse, + ] + > | void { + request = request || {}; + // Converts number to Unit32 or Int32 value for non-compliant APIs. + if (request.maxResults && typeof request.maxResults === 'number') { + const maxResultsObject = { value: request.maxResults }; + request.maxResults = maxResultsObject; + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListRoutinesRequest, + | protos.google.cloud.bigquery.v2.IListRoutinesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRoutine + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRoutines values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRoutines request %j', request); + return this.innerApiCalls + .listRoutines(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IRoutine[], + protos.google.cloud.bigquery.v2.IListRoutinesRequest | null, + protos.google.cloud.bigquery.v2.IListRoutinesResponse, + ]) => { + this._log.info('listRoutines values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listRoutines`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the routines to list + * @param {string} request.datasetId + * Required. Dataset ID of the routines to list + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {string} request.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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.Routine|Routine} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRoutinesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRoutinesStream( + request?: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listRoutines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listRoutines stream %j', request); + return this.descriptors.page.listRoutines.createStream( + this.innerApiCalls.listRoutines as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listRoutines`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the routines to list + * @param {string} request.datasetId + * Required. Dataset ID of the routines to list + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {string} request.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`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.Routine|Routine}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/routine_service.list_routines.js + * region_tag:bigquery_v2_generated_RoutineService_ListRoutines_async + */ + listRoutinesAsync( + request?: protos.google.cloud.bigquery.v2.IListRoutinesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listRoutines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listRoutines iterate %j', request); + return this.descriptors.page.listRoutines.asyncIterate( + this.innerApiCalls['listRoutines'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.routineServiceStub && !this._terminated) { + return this.routineServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/routine_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/routine_service_client_config.json new file mode 100644 index 000000000000..a83ee43fa8b3 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/routine_service_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.RoutineService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617": { + "initial_retry_delay_millis": 400, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetRoutine": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "InsertRoutine": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "UpdateRoutine": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "DeleteRoutine": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "ListRoutines": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/routine_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/routine_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/routine_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client.ts new file mode 100644 index 000000000000..6161c4f1b239 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client.ts @@ -0,0 +1,1392 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/row_access_policy_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './row_access_policy_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for interacting with row access policies. + * @class + * @memberof v2 + */ +export class RowAccessPolicyServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + rowAccessPolicyServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of RowAccessPolicyServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RowAccessPolicyServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof RowAccessPolicyServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRowAccessPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rowAccessPolicies', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.RowAccessPolicyService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.rowAccessPolicyServiceStub) { + return this.rowAccessPolicyServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.RowAccessPolicyService. + this.rowAccessPolicyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.RowAccessPolicyService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.RowAccessPolicyService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const rowAccessPolicyServiceStubMethods = [ + 'listRowAccessPolicies', + 'getRowAccessPolicy', + 'createRowAccessPolicy', + 'updateRowAccessPolicy', + 'deleteRowAccessPolicy', + 'batchDeleteRowAccessPolicies', + ]; + for (const methodName of rowAccessPolicyServiceStubMethods) { + const callPromise = this.rowAccessPolicyServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.rowAccessPolicyServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the specified row access policy by policy ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to get the row access policy. + * @param {string} request.datasetId + * Required. Dataset ID of the table to get the row access policy. + * @param {string} request.tableId + * Required. Table ID of the table to get the row access policy. + * @param {string} request.policyId + * Required. Policy ID of the row access policy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.get_row_access_policy.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_GetRowAccessPolicy_async + */ + getRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest | undefined, + {} | undefined, + ] + >; + getRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + getRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + policy_id: request.policyId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getRowAccessPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRowAccessPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRowAccessPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + ( + | protos.google.cloud.bigquery.v2.IGetRowAccessPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getRowAccessPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a row access policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to get the row access policy. + * @param {string} request.datasetId + * Required. Dataset ID of the table to get the row access policy. + * @param {string} request.tableId + * Required. Table ID of the table to get the row access policy. + * @param {google.cloud.bigquery.v2.RowAccessPolicy} request.rowAccessPolicy + * Required. The row access policy to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.create_row_access_policy.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_CreateRowAccessPolicy_async + */ + createRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest | undefined, + {} | undefined, + ] + >; + createRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + createRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createRowAccessPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createRowAccessPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRowAccessPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + ( + | protos.google.cloud.bigquery.v2.ICreateRowAccessPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createRowAccessPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates a row access policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to get the row access policy. + * @param {string} request.datasetId + * Required. Dataset ID of the table to get the row access policy. + * @param {string} request.tableId + * Required. Table ID of the table to get the row access policy. + * @param {string} request.policyId + * Required. Policy ID of the row access policy. + * @param {google.cloud.bigquery.v2.RowAccessPolicy} request.rowAccessPolicy + * Required. The row access policy to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.update_row_access_policy.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_UpdateRowAccessPolicy_async + */ + updateRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest | undefined, + {} | undefined, + ] + >; + updateRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + policy_id: request.policyId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateRowAccessPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateRowAccessPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateRowAccessPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy, + ( + | protos.google.cloud.bigquery.v2.IUpdateRowAccessPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateRowAccessPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a row access policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to delete the row access policy. + * @param {string} request.datasetId + * Required. Dataset ID of the table to delete the row access policy. + * @param {string} request.tableId + * Required. Table ID of the table to delete the row access policy. + * @param {string} request.policyId + * Required. Policy ID of the row access policy. + * @param {boolean} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.delete_row_access_policy.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_DeleteRowAccessPolicy_async + */ + deleteRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest | undefined, + {} | undefined, + ] + >; + deleteRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteRowAccessPolicy( + request: protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + deleteRowAccessPolicy( + request?: protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + policy_id: request.policyId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteRowAccessPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteRowAccessPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteRowAccessPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.v2.IDeleteRowAccessPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteRowAccessPolicy response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes provided row access policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to delete the row access policies. + * @param {string} request.datasetId + * Required. Dataset ID of the table to delete the row access policies. + * @param {string} request.tableId + * Required. Table ID of the table to delete the row access policies. + * @param {string[]} request.policyIds + * Required. Policy IDs of the row access policies. + * @param {boolean} request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.batch_delete_row_access_policies.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_BatchDeleteRowAccessPolicies_async + */ + batchDeleteRowAccessPolicies( + request?: protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | undefined + ), + {} | undefined, + ] + >; + batchDeleteRowAccessPolicies( + request: protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteRowAccessPolicies( + request: protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + batchDeleteRowAccessPolicies( + request?: protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('batchDeleteRowAccessPolicies request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteRowAccessPolicies response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteRowAccessPolicies(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.v2.IBatchDeleteRowAccessPoliciesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteRowAccessPolicies response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Lists all row access policies on the specified table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the row access policies to list. + * @param {string} request.datasetId + * Required. Dataset ID of row access policies to list. + * @param {string} request.tableId + * Required. Table ID of the table to list row access policies. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRowAccessPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRowAccessPolicies( + request?: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy[], + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest | null, + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse, + ] + >; + listRowAccessPolicies( + request: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + | protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRowAccessPolicy + >, + ): void; + listRowAccessPolicies( + request: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + | protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRowAccessPolicy + >, + ): void; + listRowAccessPolicies( + request?: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + | protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRowAccessPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + | protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRowAccessPolicy + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy[], + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest | null, + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + | protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.v2.IRowAccessPolicy + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRowAccessPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRowAccessPolicies request %j', request); + return this.innerApiCalls + .listRowAccessPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IRowAccessPolicy[], + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest | null, + protos.google.cloud.bigquery.v2.IListRowAccessPoliciesResponse, + ]) => { + this._log.info('listRowAccessPolicies values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listRowAccessPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the row access policies to list. + * @param {string} request.datasetId + * Required. Dataset ID of row access policies to list. + * @param {string} request.tableId + * Required. Table ID of the table to list row access policies. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRowAccessPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRowAccessPoliciesStream( + request?: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listRowAccessPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listRowAccessPolicies stream %j', request); + return this.descriptors.page.listRowAccessPolicies.createStream( + this.innerApiCalls.listRowAccessPolicies as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listRowAccessPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the row access policies to list. + * @param {string} request.datasetId + * Required. Dataset ID of row access policies to list. + * @param {string} request.tableId + * Required. Table ID of the table to list row access policies. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results. + * @param {number} request.pageSize + * The maximum number of results to return in a single response page. Leverage + * the page tokens to iterate through the entire collection. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.RowAccessPolicy|RowAccessPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/row_access_policy_service.list_row_access_policies.js + * region_tag:bigquery_v2_generated_RowAccessPolicyService_ListRowAccessPolicies_async + */ + listRowAccessPoliciesAsync( + request?: protos.google.cloud.bigquery.v2.IListRowAccessPoliciesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listRowAccessPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listRowAccessPolicies iterate %j', request); + return this.descriptors.page.listRowAccessPolicies.asyncIterate( + this.innerApiCalls['listRowAccessPolicies'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.rowAccessPolicyServiceStub && !this._terminated) { + return this.rowAccessPolicyServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client_config.json new file mode 100644 index 000000000000..306172810944 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.RowAccessPolicyService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRowAccessPolicies": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "GetRowAccessPolicy": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "CreateRowAccessPolicy": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "UpdateRowAccessPolicy": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "DeleteRowAccessPolicy": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "BatchDeleteRowAccessPolicies": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/row_access_policy_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/src/v2/table_service_client.ts b/packages/google-cloud-bigquery-api/src/v2/table_service_client.ts new file mode 100644 index 000000000000..262ddd74f873 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/table_service_client.ts @@ -0,0 +1,1345 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/table_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './table_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * TableService provides methods for managing BigQuery tables and table-like + * entities such as views and snapshots. + * @class + * @memberof v2 + */ +export class TableServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('bigquery-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + tableServiceStub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of TableServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TableServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TableServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'bigquery.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listTables: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tables', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.v2.TableService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.tableServiceStub) { + return this.tableServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.v2.TableService. + this.tableServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.v2.TableService', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.v2.TableService, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const tableServiceStubMethods = [ + 'getTable', + 'insertTable', + 'patchTable', + 'updateTable', + 'deleteTable', + 'listTables', + ]; + for (const methodName of tableServiceStubMethods) { + const callPromise = this.tableServiceStub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tableServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'bigquery.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the requested table + * @param {string} request.datasetId + * Required. Dataset ID of the requested table + * @param {string} request.tableId + * Required. Table ID of the requested table + * @param {string} request.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. + * @param {google.cloud.bigquery.v2.GetTableRequest.TableMetadataView} [request.view] + * Optional. Specifies the view that determines which table information is + * returned. By default, basic table information and storage statistics + * (STORAGE_STATS) are returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.get_table.js + * region_tag:bigquery_v2_generated_TableService_GetTable_async + */ + getTable( + request?: protos.google.cloud.bigquery.v2.IGetTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | undefined, + {} | undefined, + ] + >; + getTable( + request: protos.google.cloud.bigquery.v2.IGetTableRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTable( + request: protos.google.cloud.bigquery.v2.IGetTableRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + getTable( + request?: protos.google.cloud.bigquery.v2.IGetTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IGetTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a new, empty table in the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the new table + * @param {string} request.datasetId + * Required. Dataset ID of the new table + * @param {google.cloud.bigquery.v2.Table} request.table + * Required. A tables resource to insert + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.insert_table.js + * region_tag:bigquery_v2_generated_TableService_InsertTable_async + */ + insertTable( + request?: protos.google.cloud.bigquery.v2.IInsertTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | undefined, + {} | undefined, + ] + >; + insertTable( + request: protos.google.cloud.bigquery.v2.IInsertTableRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertTable( + request: protos.google.cloud.bigquery.v2.IInsertTableRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + insertTable( + request?: protos.google.cloud.bigquery.v2.IInsertTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IInsertTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('insertTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IInsertTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('insertTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .insertTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IInsertTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('insertTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to update + * @param {string} request.datasetId + * Required. Dataset ID of the table to update + * @param {string} request.tableId + * Required. Table ID of the table to update + * @param {google.cloud.bigquery.v2.Table} request.table + * Required. A tables resource which will replace or patch the specified table + * @param {boolean} [request.autodetectSchema] + * Optional. When true will autodetect schema, else will keep original schema. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.patch_table.js + * region_tag:bigquery_v2_generated_TableService_PatchTable_async + */ + patchTable( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest | undefined, + {} | undefined, + ] + >; + patchTable( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + patchTable( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + patchTable( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('patchTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('patchTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .patchTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.ITable, + ( + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('patchTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to update + * @param {string} request.datasetId + * Required. Dataset ID of the table to update + * @param {string} request.tableId + * Required. Table ID of the table to update + * @param {google.cloud.bigquery.v2.Table} request.table + * Required. A tables resource which will replace or patch the specified table + * @param {boolean} [request.autodetectSchema] + * Optional. When true will autodetect schema, else will keep original schema. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.bigquery.v2.Table|Table}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.update_table.js + * region_tag:bigquery_v2_generated_TableService_UpdateTable_async + */ + updateTable( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest | undefined, + {} | undefined, + ] + >; + updateTable( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTable( + request: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + callback: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): void; + updateTable( + request?: protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.ITable, + protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.v2.ITable, + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.v2.ITable, + ( + | protos.google.cloud.bigquery.v2.IUpdateOrPatchTableRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes the table specified by tableId from the dataset. + * If the table contains data, all the data will be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the table to delete + * @param {string} request.datasetId + * Required. Dataset ID of the table to delete + * @param {string} request.tableId + * Required. Table ID of the table to delete + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.delete_table.js + * region_tag:bigquery_v2_generated_TableService_DeleteTable_async + */ + deleteTable( + request?: protos.google.cloud.bigquery.v2.IDeleteTableRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | undefined, + {} | undefined, + ] + >; + deleteTable( + request: protos.google.cloud.bigquery.v2.IDeleteTableRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTable( + request: protos.google.cloud.bigquery.v2.IDeleteTableRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteTable( + request?: protos.google.cloud.bigquery.v2.IDeleteTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + table_id: request.tableId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.v2.IDeleteTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.v2.IDeleteTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteTable response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Lists all tables in the specified dataset. Requires the READER dataset + * role. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the tables to list + * @param {string} request.datasetId + * Required. Dataset ID of the tables to list + * @param {google.protobuf.UInt32Value| number } request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.bigquery.v2.ListFormatTable|ListFormatTable}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTablesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTables( + request?: protos.google.cloud.bigquery.v2.IListTablesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatTable[], + protos.google.cloud.bigquery.v2.IListTablesRequest | null, + protos.google.cloud.bigquery.v2.ITableList, + ] + >; + listTables( + request: protos.google.cloud.bigquery.v2.IListTablesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListTablesRequest, + protos.google.cloud.bigquery.v2.ITableList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatTable + >, + ): void; + listTables( + request: protos.google.cloud.bigquery.v2.IListTablesRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.v2.IListTablesRequest, + protos.google.cloud.bigquery.v2.ITableList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatTable + >, + ): void; + listTables( + request?: protos.google.cloud.bigquery.v2.IListTablesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListTablesRequest, + protos.google.cloud.bigquery.v2.ITableList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatTable + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.v2.IListTablesRequest, + protos.google.cloud.bigquery.v2.ITableList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatTable + >, + ): Promise< + [ + protos.google.cloud.bigquery.v2.IListFormatTable[], + protos.google.cloud.bigquery.v2.IListTablesRequest | null, + protos.google.cloud.bigquery.v2.ITableList, + ] + > | void { + request = request || {}; + // Converts number to Unit32 or Int32 value for non-compliant APIs. + if (request.maxResults && typeof request.maxResults === 'number') { + const maxResultsObject = { value: request.maxResults }; + request.maxResults = maxResultsObject; + } + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.v2.IListTablesRequest, + protos.google.cloud.bigquery.v2.ITableList | null | undefined, + protos.google.cloud.bigquery.v2.IListFormatTable + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTables values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTables request %j', request); + return this.innerApiCalls + .listTables(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.v2.IListFormatTable[], + protos.google.cloud.bigquery.v2.IListTablesRequest | null, + protos.google.cloud.bigquery.v2.ITableList, + ]) => { + this._log.info('listTables values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listTables`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the tables to list + * @param {string} request.datasetId + * Required. Dataset ID of the tables to list + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.bigquery.v2.ListFormatTable|ListFormatTable} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTablesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTablesStream( + request?: protos.google.cloud.bigquery.v2.IListTablesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listTables']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTables stream %j', request); + return this.descriptors.page.listTables.createStream( + this.innerApiCalls.listTables as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listTables`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. Project ID of the tables to list + * @param {string} request.datasetId + * Required. Dataset ID of the tables to list + * @param {google.protobuf.UInt32Value} request.maxResults + * The maximum number of results to return in a single response page. + * Leverage the page tokens to iterate through the entire collection. + * @param {string} request.pageToken + * Page token, returned by a previous call, to request the next page of + * results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.bigquery.v2.ListFormatTable|ListFormatTable}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/table_service.list_tables.js + * region_tag:bigquery_v2_generated_TableService_ListTables_async + */ + listTablesAsync( + request?: protos.google.cloud.bigquery.v2.IListTablesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId?.toString() ?? '', + dataset_id: request.datasetId?.toString() ?? '', + }); + const defaultCallSettings = this._defaults['listTables']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listTables iterate %j', request); + return this.descriptors.page.listTables.asyncIterate( + this.innerApiCalls['listTables'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.tableServiceStub && !this._terminated) { + return this.tableServiceStub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/table_service_client_config.json b/packages/google-cloud-bigquery-api/src/v2/table_service_client_config.json new file mode 100644 index 000000000000..9834b51b9041 --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/table_service_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.bigquery.v2.TableService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617": { + "initial_retry_delay_millis": 400, + "retry_delay_multiplier": 2, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetTable": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + }, + "InsertTable": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "PatchTable": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "UpdateTable": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "DeleteTable": { + "timeout_millis": 240000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cbf71b99e5c3bbd64c526c7e742fbf8ad180a617" + }, + "ListTables": { + "timeout_millis": 64000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-api/src/v2/table_service_proto_list.json b/packages/google-cloud-bigquery-api/src/v2/table_service_proto_list.json new file mode 100644 index 000000000000..325178c4df8c --- /dev/null +++ b/packages/google-cloud-bigquery-api/src/v2/table_service_proto_list.json @@ -0,0 +1,49 @@ +[ + "../../protos/google/cloud/bigquery/v2/biglake_config.proto", + "../../protos/google/cloud/bigquery/v2/clustering.proto", + "../../protos/google/cloud/bigquery/v2/data_format_options.proto", + "../../protos/google/cloud/bigquery/v2/dataset.proto", + "../../protos/google/cloud/bigquery/v2/dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/decimal_target_types.proto", + "../../protos/google/cloud/bigquery/v2/encryption_config.proto", + "../../protos/google/cloud/bigquery/v2/error.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_dataset_options.proto", + "../../protos/google/cloud/bigquery/v2/external_catalog_table_options.proto", + "../../protos/google/cloud/bigquery/v2/external_data_config.proto", + "../../protos/google/cloud/bigquery/v2/external_dataset_reference.proto", + "../../protos/google/cloud/bigquery/v2/file_set_specification_type.proto", + "../../protos/google/cloud/bigquery/v2/gen_ai_stats.proto", + "../../protos/google/cloud/bigquery/v2/hive_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/job.proto", + "../../protos/google/cloud/bigquery/v2/job_config.proto", + "../../protos/google/cloud/bigquery/v2/job_creation_reason.proto", + "../../protos/google/cloud/bigquery/v2/job_reference.proto", + "../../protos/google/cloud/bigquery/v2/job_stats.proto", + "../../protos/google/cloud/bigquery/v2/job_status.proto", + "../../protos/google/cloud/bigquery/v2/json_extension.proto", + "../../protos/google/cloud/bigquery/v2/location_metadata.proto", + "../../protos/google/cloud/bigquery/v2/managed_table_type.proto", + "../../protos/google/cloud/bigquery/v2/map_target_type.proto", + "../../protos/google/cloud/bigquery/v2/model.proto", + "../../protos/google/cloud/bigquery/v2/model_reference.proto", + "../../protos/google/cloud/bigquery/v2/partitioning_definition.proto", + "../../protos/google/cloud/bigquery/v2/privacy_policy.proto", + "../../protos/google/cloud/bigquery/v2/project.proto", + "../../protos/google/cloud/bigquery/v2/property_graph_reference.proto", + "../../protos/google/cloud/bigquery/v2/query_parameter.proto", + "../../protos/google/cloud/bigquery/v2/range_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/restriction_config.proto", + "../../protos/google/cloud/bigquery/v2/routine.proto", + "../../protos/google/cloud/bigquery/v2/routine_reference.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy.proto", + "../../protos/google/cloud/bigquery/v2/row_access_policy_reference.proto", + "../../protos/google/cloud/bigquery/v2/session_info.proto", + "../../protos/google/cloud/bigquery/v2/standard_sql.proto", + "../../protos/google/cloud/bigquery/v2/system_variable.proto", + "../../protos/google/cloud/bigquery/v2/table.proto", + "../../protos/google/cloud/bigquery/v2/table_constraints.proto", + "../../protos/google/cloud/bigquery/v2/table_reference.proto", + "../../protos/google/cloud/bigquery/v2/table_schema.proto", + "../../protos/google/cloud/bigquery/v2/time_partitioning.proto", + "../../protos/google/cloud/bigquery/v2/udf_resource.proto" +] diff --git a/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..cbda56c7a5f2 --- /dev/null +++ b/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const bigquery = require('@google-cloud/bigquery-api'); + +function main() { + const datasetServiceClient = new bigquery.DatasetServiceClient(); + const jobServiceClient = new bigquery.JobServiceClient(); + const modelServiceClient = new bigquery.ModelServiceClient(); + const projectServiceClient = new bigquery.ProjectServiceClient(); + const routineServiceClient = new bigquery.RoutineServiceClient(); + const rowAccessPolicyServiceClient = new bigquery.RowAccessPolicyServiceClient(); + const tableServiceClient = new bigquery.TableServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..63797b9e3dd1 --- /dev/null +++ b/packages/google-cloud-bigquery-api/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { + DatasetServiceClient, + JobServiceClient, + ModelServiceClient, + ProjectServiceClient, + RoutineServiceClient, + RowAccessPolicyServiceClient, + TableServiceClient, +} from '@google-cloud/bigquery-api'; + +// check that the client class type name can be used +function doStuffWithDatasetServiceClient(client: DatasetServiceClient) { + client.close(); +} +function doStuffWithJobServiceClient(client: JobServiceClient) { + client.close(); +} +function doStuffWithModelServiceClient(client: ModelServiceClient) { + client.close(); +} +function doStuffWithProjectServiceClient(client: ProjectServiceClient) { + client.close(); +} +function doStuffWithRoutineServiceClient(client: RoutineServiceClient) { + client.close(); +} +function doStuffWithRowAccessPolicyServiceClient( + client: RowAccessPolicyServiceClient, +) { + client.close(); +} +function doStuffWithTableServiceClient(client: TableServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const datasetServiceClient = new DatasetServiceClient(); + doStuffWithDatasetServiceClient(datasetServiceClient); + // check that the client instance can be created + const jobServiceClient = new JobServiceClient(); + doStuffWithJobServiceClient(jobServiceClient); + // check that the client instance can be created + const modelServiceClient = new ModelServiceClient(); + doStuffWithModelServiceClient(modelServiceClient); + // check that the client instance can be created + const projectServiceClient = new ProjectServiceClient(); + doStuffWithProjectServiceClient(projectServiceClient); + // check that the client instance can be created + const routineServiceClient = new RoutineServiceClient(); + doStuffWithRoutineServiceClient(routineServiceClient); + // check that the client instance can be created + const rowAccessPolicyServiceClient = new RowAccessPolicyServiceClient(); + doStuffWithRowAccessPolicyServiceClient(rowAccessPolicyServiceClient); + // check that the client instance can be created + const tableServiceClient = new TableServiceClient(); + doStuffWithTableServiceClient(tableServiceClient); +} + +main(); diff --git a/packages/google-cloud-bigquery-api/system-test/install.ts b/packages/google-cloud-bigquery-api/system-test/install.ts new file mode 100644 index 000000000000..ccf167042d2e --- /dev/null +++ b/packages/google-cloud-bigquery-api/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts', + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + cjs: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_dataset_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_dataset_service_v2.ts new file mode 100644 index 000000000000..83588c244ed9 --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_dataset_service_v2.ts @@ -0,0 +1,1544 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as datasetserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.DatasetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + datasetserviceModule.v2.DatasetServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + datasetserviceModule.v2.DatasetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new datasetserviceModule.v2.DatasetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new datasetserviceModule.v2.DatasetServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new datasetserviceModule.v2.DatasetServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = datasetserviceModule.v2.DatasetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + await client.initialize(); + assert(client.datasetServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.datasetServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.datasetServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IDataset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('insertDataset', () => { + it('invokes insertDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.insertDataset = stubSimpleCall(expectedResponse); + const [response] = await client.insertDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.insertDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insertDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IDataset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.insertDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.insertDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.insertDataset(request), expectedError); + }); + }); + + describe('patchDataset', () => { + it('invokes patchDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.patchDataset = stubSimpleCall(expectedResponse); + const [response] = await client.patchDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.patchDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IDataset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.patchDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.patchDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.patchDataset(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.updateDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IDataset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteDataset = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteDataset(request), expectedError); + }); + }); + + describe('undeleteDataset', () => { + it('invokes undeleteDataset without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UndeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.undeleteDataset = stubSimpleCall(expectedResponse); + const [response] = await client.undeleteDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteDataset without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UndeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Dataset(), + ); + client.innerApiCalls.undeleteDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IDataset | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteDataset with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UndeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteDataset = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.undeleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteDataset with closed client', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UndeleteDatasetRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UndeleteDatasetRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.undeleteDataset(request), expectedError); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.v2.IListFormatDataset[] + | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatDataset[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatDataset) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request), + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatDataset[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatDataset) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request), + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatDataset(), + ), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IListFormatDataset[] = + []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = new datasetserviceModule.v2.DatasetServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListDatasetsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListDatasetsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IListFormatDataset[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_job_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_job_service_v2.ts new file mode 100644 index 000000000000..e575dcb71d04 --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_job_service_v2.ts @@ -0,0 +1,1494 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as jobserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.JobServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new jobserviceModule.v2.JobServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new jobserviceModule.v2.JobServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = jobserviceModule.v2.JobServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = jobserviceModule.v2.JobServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new jobserviceModule.v2.JobServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new jobserviceModule.v2.JobServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new jobserviceModule.v2.JobServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new jobserviceModule.v2.JobServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new jobserviceModule.v2.JobServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = jobserviceModule.v2.JobServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobserviceModule.v2.JobServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobserviceModule.v2.JobServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + await client.initialize(); + assert(client.jobServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.jobServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.jobServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CancelJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.JobCancelResponse(), + ); + client.innerApiCalls.cancelJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CancelJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.JobCancelResponse(), + ); + client.innerApiCalls.cancelJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IJobCancelResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CancelJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CancelJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CancelJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.cancelJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Job(), + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Job(), + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IJob | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('insertJob', () => { + it('invokes insertJob without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Job(), + ); + client.innerApiCalls.insertJob = stubSimpleCall(expectedResponse); + const [response] = await client.insertJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertJob without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Job(), + ); + client.innerApiCalls.insertJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insertJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IJob | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertJob with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.insertJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insertJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertJob with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.insertJob(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteJobRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteJobRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteJob(request), expectedError); + }); + }); + + describe('getQueryResults', () => { + it('invokes getQueryResults without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsResponse(), + ); + client.innerApiCalls.getQueryResults = stubSimpleCall(expectedResponse); + const [response] = await client.getQueryResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQueryResults without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsResponse(), + ); + client.innerApiCalls.getQueryResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getQueryResults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IGetQueryResultsResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQueryResults with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&job_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getQueryResults = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getQueryResults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQueryResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQueryResults with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetQueryResultsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetQueryResultsRequest', + ['jobId'], + ); + request.jobId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getQueryResults(request), expectedError); + }); + }); + + describe('query', () => { + it('invokes query without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PostQueryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PostQueryRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.QueryResponse(), + ); + client.innerApiCalls.query = stubSimpleCall(expectedResponse); + const [response] = await client.query(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.query as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.query as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes query without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PostQueryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PostQueryRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.QueryResponse(), + ); + client.innerApiCalls.query = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.query( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IQueryResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.query as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.query as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes query with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PostQueryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PostQueryRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.query = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.query(request), expectedError); + const actualRequest = (client.innerApiCalls.query as SinonStub).getCall(0) + .args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.query as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes query with closed client', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PostQueryRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PostQueryRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.query(request), expectedError); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IListFormatJob[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatJob) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request), + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatJob) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request), + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatJob(), + ), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IListFormatJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new jobserviceModule.v2.JobServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListJobsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListJobsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IListFormatJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_model_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_model_service_v2.ts new file mode 100644 index 000000000000..1fc19e777327 --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_model_service_v2.ts @@ -0,0 +1,1166 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as modelserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.ModelServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new modelserviceModule.v2.ModelServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new modelserviceModule.v2.ModelServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + modelserviceModule.v2.ModelServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + modelserviceModule.v2.ModelServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new modelserviceModule.v2.ModelServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new modelserviceModule.v2.ModelServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new modelserviceModule.v2.ModelServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = modelserviceModule.v2.ModelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelserviceModule.v2.ModelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + await client.initialize(); + assert(client.modelServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.modelServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Model(), + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Model(), + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IModel | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('patchModel', () => { + it('invokes patchModel without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PatchModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Model(), + ); + client.innerApiCalls.patchModel = stubSimpleCall(expectedResponse); + const [response] = await client.patchModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchModel without error using callback', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PatchModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Model(), + ); + client.innerApiCalls.patchModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IModel | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchModel with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PatchModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.patchModel = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.patchModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchModel with closed client', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.PatchModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.PatchModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.patchModel(request), expectedError); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteModel = stubSimpleCall(expectedResponse); + const [response] = await client.deleteModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&model_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with closed client', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteModelRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteModelRequest', + ['modelId'], + ); + request.modelId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteModel(request), expectedError); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IModel[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.Model[] = []; + stream.on('data', (response: protos.google.cloud.bigquery.v2.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request), + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.Model[] = []; + stream.on('data', (response: protos.google.cloud.bigquery.v2.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request), + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new modelserviceModule.v2.ModelServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListModelsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListModelsRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_project_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_project_service_v2.ts new file mode 100644 index 000000000000..be27739032d5 --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_project_service_v2.ts @@ -0,0 +1,388 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as projectserviceModule from '../src'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v2.ProjectServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new projectserviceModule.v2.ProjectServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new projectserviceModule.v2.ProjectServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + projectserviceModule.v2.ProjectServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + projectserviceModule.v2.ProjectServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new projectserviceModule.v2.ProjectServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new projectserviceModule.v2.ProjectServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new projectserviceModule.v2.ProjectServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = projectserviceModule.v2.ProjectServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new projectserviceModule.v2.ProjectServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.projectServiceStub, undefined); + await client.initialize(); + assert(client.projectServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.projectServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.projectServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getServiceAccount', () => { + it('invokes getServiceAccount without error', async () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetServiceAccountRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountResponse(), + ); + client.innerApiCalls.getServiceAccount = stubSimpleCall(expectedResponse); + const [response] = await client.getServiceAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceAccount without error using callback', async () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetServiceAccountRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountResponse(), + ); + client.innerApiCalls.getServiceAccount = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServiceAccount( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IGetServiceAccountResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceAccount with error', async () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetServiceAccountRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServiceAccount = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getServiceAccount(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceAccount as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceAccount with closed client', async () => { + const client = new projectserviceModule.v2.ProjectServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetServiceAccountRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetServiceAccountRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getServiceAccount(request), expectedError); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_routine_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_routine_service_v2.ts new file mode 100644 index 000000000000..61e47bf95686 --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_routine_service_v2.ts @@ -0,0 +1,1325 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as routineserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.RoutineServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new routineserviceModule.v2.RoutineServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new routineserviceModule.v2.RoutineServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + routineserviceModule.v2.RoutineServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + routineserviceModule.v2.RoutineServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new routineserviceModule.v2.RoutineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new routineserviceModule.v2.RoutineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new routineserviceModule.v2.RoutineServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = routineserviceModule.v2.RoutineServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routineserviceModule.v2.RoutineServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.routineServiceStub, undefined); + await client.initialize(); + assert(client.routineServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.routineServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.routineServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRoutine', () => { + it('invokes getRoutine without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.getRoutine = stubSimpleCall(expectedResponse); + const [response] = await client.getRoutine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRoutine without error using callback', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.getRoutine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRoutine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRoutine | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRoutine with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRoutine = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getRoutine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRoutine with closed client', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getRoutine(request), expectedError); + }); + }); + + describe('insertRoutine', () => { + it('invokes insertRoutine without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.insertRoutine = stubSimpleCall(expectedResponse); + const [response] = await client.insertRoutine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertRoutine without error using callback', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.insertRoutine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insertRoutine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRoutine | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertRoutine with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.insertRoutine = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.insertRoutine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertRoutine with closed client', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.insertRoutine(request), expectedError); + }); + }); + + describe('updateRoutine', () => { + it('invokes updateRoutine without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.updateRoutine = stubSimpleCall(expectedResponse); + const [response] = await client.updateRoutine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRoutine without error using callback', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Routine(), + ); + client.innerApiCalls.updateRoutine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRoutine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRoutine | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRoutine with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRoutine = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateRoutine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRoutine with closed client', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateRoutine(request), expectedError); + }); + }); + + describe('deleteRoutine', () => { + it('invokes deleteRoutine without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteRoutine = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRoutine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRoutine without error using callback', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteRoutine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRoutine( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRoutine with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&routine_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRoutine = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteRoutine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRoutine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRoutine with closed client', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRoutineRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRoutineRequest', + ['routineId'], + ); + request.routineId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteRoutine(request), expectedError); + }); + }); + + describe('listRoutines', () => { + it('invokes listRoutines without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + ]; + client.innerApiCalls.listRoutines = stubSimpleCall(expectedResponse); + const [response] = await client.listRoutines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRoutines without error using callback', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + ]; + client.innerApiCalls.listRoutines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRoutines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRoutine[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRoutines with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRoutines = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listRoutines(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRoutines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRoutinesStream without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + ]; + client.descriptors.page.listRoutines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRoutinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.Routine[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.Routine) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listRoutines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRoutines, request), + ); + assert( + (client.descriptors.page.listRoutines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listRoutinesStream with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRoutines.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listRoutinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.Routine[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.Routine) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRoutines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRoutines, request), + ); + assert( + (client.descriptors.page.listRoutines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listRoutines without error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + generateSampleMessage(new protos.google.cloud.bigquery.v2.Routine()), + ]; + client.descriptors.page.listRoutines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IRoutine[] = []; + const iterable = client.listRoutinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRoutines.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listRoutines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listRoutines with error', async () => { + const client = new routineserviceModule.v2.RoutineServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRoutinesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRoutinesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRoutines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRoutinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IRoutine[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRoutines.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listRoutines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_row_access_policy_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_row_access_policy_service_v2.ts new file mode 100644 index 000000000000..adc6099f886e --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_row_access_policy_service_v2.ts @@ -0,0 +1,1731 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as rowaccesspolicyserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.RowAccessPolicyServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient + .servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.rowAccessPolicyServiceStub, undefined); + await client.initialize(); + assert(client.rowAccessPolicyServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.rowAccessPolicyServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.rowAccessPolicyServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRowAccessPolicy', () => { + it('invokes getRowAccessPolicy without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.getRowAccessPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.getRowAccessPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRowAccessPolicy without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.getRowAccessPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRowAccessPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRowAccessPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRowAccessPolicy with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRowAccessPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getRowAccessPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRowAccessPolicy with closed client', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getRowAccessPolicy(request), expectedError); + }); + }); + + describe('createRowAccessPolicy', () => { + it('invokes createRowAccessPolicy without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.createRowAccessPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.createRowAccessPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRowAccessPolicy without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.createRowAccessPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRowAccessPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRowAccessPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRowAccessPolicy with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRowAccessPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.createRowAccessPolicy(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRowAccessPolicy with closed client', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.CreateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.createRowAccessPolicy(request), + expectedError, + ); + }); + }); + + describe('updateRowAccessPolicy', () => { + it('invokes updateRowAccessPolicy without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.updateRowAccessPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.updateRowAccessPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRowAccessPolicy without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ); + client.innerApiCalls.updateRowAccessPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRowAccessPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRowAccessPolicy | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRowAccessPolicy with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRowAccessPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.updateRowAccessPolicy(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRowAccessPolicy with closed client', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.updateRowAccessPolicy(request), + expectedError, + ); + }); + }); + + describe('deleteRowAccessPolicy', () => { + it('invokes deleteRowAccessPolicy without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteRowAccessPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteRowAccessPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRowAccessPolicy without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteRowAccessPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRowAccessPolicy( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRowAccessPolicy with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}&policy_id=${defaultValue4 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRowAccessPolicy = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.deleteRowAccessPolicy(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRowAccessPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRowAccessPolicy with closed client', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteRowAccessPolicyRequest', + ['policyId'], + ); + request.policyId = defaultValue4; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.deleteRowAccessPolicy(request), + expectedError, + ); + }); + }); + + describe('batchDeleteRowAccessPolicies', () => { + it('invokes batchDeleteRowAccessPolicies without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteRowAccessPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteRowAccessPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteRowAccessPolicies without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.batchDeleteRowAccessPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteRowAccessPolicies( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteRowAccessPolicies with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteRowAccessPolicies = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.batchDeleteRowAccessPolicies(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteRowAccessPolicies with closed client', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.BatchDeleteRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects( + client.batchDeleteRowAccessPolicies(request), + expectedError, + ); + }); + }); + + describe('listRowAccessPolicies', () => { + it('invokes listRowAccessPolicies without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + ]; + client.innerApiCalls.listRowAccessPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listRowAccessPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRowAccessPolicies without error using callback', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + ]; + client.innerApiCalls.listRowAccessPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRowAccessPolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IRowAccessPolicy[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRowAccessPolicies with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRowAccessPolicies = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listRowAccessPolicies(request), + expectedError, + ); + const actualRequest = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRowAccessPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRowAccessPoliciesStream without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + ]; + client.descriptors.page.listRowAccessPolicies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRowAccessPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.RowAccessPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.RowAccessPolicy) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRowAccessPolicies, request), + ); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('invokes listRowAccessPoliciesStream with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRowAccessPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRowAccessPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.RowAccessPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.RowAccessPolicy) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRowAccessPolicies, request), + ); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listRowAccessPolicies without error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.RowAccessPolicy(), + ), + ]; + client.descriptors.page.listRowAccessPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IRowAccessPolicy[] = []; + const iterable = client.listRowAccessPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRowAccessPolicies + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + + it('uses async iteration with listRowAccessPolicies with error', async () => { + const client = + new rowaccesspolicyserviceModule.v2.RowAccessPolicyServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListRowAccessPoliciesRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRowAccessPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRowAccessPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IRowAccessPolicy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRowAccessPolicies + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + ( + client.descriptors.page.listRowAccessPolicies + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/test/gapic_table_service_v2.ts b/packages/google-cloud-bigquery-api/test/gapic_table_service_v2.ts new file mode 100644 index 000000000000..51aa0c5ea2eb --- /dev/null +++ b/packages/google-cloud-bigquery-api/test/gapic_table_service_v2.ts @@ -0,0 +1,1521 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as tableserviceModule from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.TableServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new tableserviceModule.v2.TableServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new tableserviceModule.v2.TableServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + tableserviceModule.v2.TableServiceClient.servicePath; + assert.strictEqual(servicePath, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + tableserviceModule.v2.TableServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'bigquery.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new tableserviceModule.v2.TableServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new tableserviceModule.v2.TableServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new tableserviceModule.v2.TableServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new tableserviceModule.v2.TableServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'bigquery.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new tableserviceModule.v2.TableServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = tableserviceModule.v2.TableServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tableserviceModule.v2.TableServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tableserviceModule.v2.TableServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.tableServiceStub, undefined); + await client.initialize(); + assert(client.tableServiceStub); + }); + + it('has close method for the initialized client', (done) => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.initialize().catch((err) => { + throw err; + }); + assert(client.tableServiceStub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has close method for the non-initialized client', (done) => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.tableServiceStub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getTable', () => { + it('invokes getTable without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.getTable = stubSimpleCall(expectedResponse); + const [response] = await client.getTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.getTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTable( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTable = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTable with closed client', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.GetTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.GetTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getTable(request), expectedError); + }); + }); + + describe('insertTable', () => { + it('invokes insertTable without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.insertTable = stubSimpleCall(expectedResponse); + const [response] = await client.insertTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertTable without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.insertTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insertTable( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertTable with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.insertTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.insertTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.insertTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertTable with closed client', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.InsertTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.InsertTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.insertTable(request), expectedError); + }); + }); + + describe('patchTable', () => { + it('invokes patchTable without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.patchTable = stubSimpleCall(expectedResponse); + const [response] = await client.patchTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchTable without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.patchTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchTable( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchTable with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.patchTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.patchTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.patchTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes patchTable with closed client', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.patchTable(request), expectedError); + }); + }); + + describe('updateTable', () => { + it('invokes updateTable without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.updateTable = stubSimpleCall(expectedResponse); + const [response] = await client.updateTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.v2.Table(), + ); + client.innerApiCalls.updateTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTable( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.ITable | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTable with closed client', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.UpdateOrPatchTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.UpdateOrPatchTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateTable(request), expectedError); + }); + }); + + describe('deleteTable', () => { + it('invokes deleteTable without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTable = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTable(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteTable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTable( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}&table_id=${defaultValue3 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTable = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteTable(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTable as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTable with closed client', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.DeleteTableRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.DeleteTableRequest', + ['tableId'], + ); + request.tableId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteTable(request), expectedError); + }); + }); + + describe('listTables', () => { + it('invokes listTables without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + ]; + client.innerApiCalls.listTables = stubSimpleCall(expectedResponse); + const [response] = await client.listTables(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTables without error using callback', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + ]; + client.innerApiCalls.listTables = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTables( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.v2.IListFormatTable[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTables with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTables = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listTables(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTables as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTablesStream without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + ]; + client.descriptors.page.listTables.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTablesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatTable[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatTable) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTables, request), + ); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listTablesStream with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTables.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listTablesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.v2.ListFormatTable[] = []; + stream.on( + 'data', + (response: protos.google.cloud.bigquery.v2.ListFormatTable) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTables, request), + ); + assert( + (client.descriptors.page.listTables.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTables without error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListFormatTable(), + ), + ]; + client.descriptors.page.listTables.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.v2.IListFormatTable[] = []; + const iterable = client.listTablesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTables.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTables.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listTables with error', async () => { + const client = new tableserviceModule.v2.TableServiceClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.v2.ListTablesRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['projectId'], + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.v2.ListTablesRequest', + ['datasetId'], + ); + request.datasetId = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&dataset_id=${defaultValue2 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTables.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listTablesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.v2.IListFormatTable[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTables.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listTables.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-api/tsconfig.json b/packages/google-cloud-bigquery-api/tsconfig.json new file mode 100644 index 000000000000..ca73e7bfc824 --- /dev/null +++ b/packages/google-cloud-bigquery-api/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/google-cloud-bigquery-api/webpack.config.js b/packages/google-cloud-bigquery-api/webpack.config.js new file mode 100644 index 000000000000..f4947d41e6bf --- /dev/null +++ b/packages/google-cloud-bigquery-api/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'DatasetService', + filename: './dataset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +};